Skip to content

Instantly share code, notes, and snippets.

@fadookie
Created April 22, 2012 06:42
Show Gist options
  • Save fadookie/2462065 to your computer and use it in GitHub Desktop.
Save fadookie/2462065 to your computer and use it in GitHub Desktop.
Arc/point collision
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