| @@ -0,0 +1,16 @@ | ||
| package utilities; | ||
|
|
||
| public class Circle { | ||
|
|
||
| public float radius, x, y; | ||
|
|
||
| public Circle(float x, float y, float radius) { | ||
| this.x = x; | ||
| this.y = y; | ||
| this.radius = radius; | ||
| } | ||
|
|
||
| public boolean intersects(Circle c) { | ||
| return (((x - c.x) * (x - c.x) + (y - c.y) * (y - c.y)) <= ((radius + c.radius) * (radius + c.radius))); | ||
| } | ||
| } |
| @@ -0,0 +1,9 @@ | ||
| package utilities; | ||
|
|
||
| public class TrigHelper { | ||
| public static float angleBetween(float x1, float y1, float x2, float y2){ | ||
| float dX = x1 - x2; | ||
| float dY = y1 - y2; | ||
| return (float) Math.atan2(dY, dX); | ||
| } | ||
| } |