Skip to content

Commit

Permalink
Add Tabletop.positionFromAngle
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunsch committed Nov 15, 2016
1 parent 136001a commit e45beea
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Tabletop.elm
Expand Up @@ -108,6 +108,17 @@ positionFromDirection start end len =
)


positionFromAngle : Position -> Float -> Inch -> Position
positionFromAngle ( x, y ) angle len =
let
rad =
degrees angle
in
( x + (cos rad * len)
, y + (sin rad * len)
)


angle : Position -> Position -> Float
angle ( startX, startY ) ( endX, endY ) =
let
Expand Down

0 comments on commit e45beea

Please sign in to comment.