Skip to content

Instantly share code, notes, and snippets.

@krisajenkins
Last active April 27, 2016 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisajenkins/ff02613573acf0f349ef845cd60f1917 to your computer and use it in GitHub Desktop.
Save krisajenkins/ff02613573acf0f349ef845cd60f1917 to your computer and use it in GitHub Desktop.
module Main (..) where
intersectingMagnitude : Line -> Position -> Angle -> List Length
intersectingMagnitude ( ( sx, sy ), ( sa, sm ) ) ( rx, ry ) ra =
let
sdx =
cos (degrees sa)
rdx =
cos (degrees ra)
rm =
(sx + sdx * sm - rx) / rdx
in
if rm > 0 && 0 < sm && sm < 1 then
Just rm
else
Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment