-
-
Save krisajenkins/ff02613573acf0f349ef845cd60f1917 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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