Created
April 22, 2012 06:42
-
-
Save fadookie/2462065 to your computer and use it in GitHub Desktop.
Arc/point collision
This file contains 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
class Arc { | |
boolean collidesWith(PolarCoord point) { | |
return !( sin(startAngle) > sin(point.t) || | |
sin(stopAngle) < sin(point.t) || | |
cos(startAngle) > cos(point.t) || | |
cos(stopAngle) < cos(point.t) || | |
minRadius > point.r || | |
maxRadius < point.r ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment