package helpers;

public class ExtMath {

    public static double addToAngle(double angle, double add) {
        double r = angle + add;
        while (r < 0) r += 360;
        while (r >= 360) r -= 360;

        return r;
    }

}

@@ -11,16 +11,72 @@
 lpers;%0A%0A
+import graphics.Circle;%0A%0Aimport java.awt.geom.Point2D;%0A%0A
 public c
@@ -280,10 +280,482 @@
 %0A    %7D%0A%0A
+    public static double distance(double xa, double ya, double xb, double yb) %7B%0A        return Math.sqrt(Math.pow(xb - xa, 2) + Math.pow(yb - ya, 2));%0A    %7D%0A%0A    public static double distance(Point2D p1, Point2D p2) %7B%0A        return distance(p1.getX(), p1.getY(), p2.getX(), p2.getY());%0A    %7D%0A%0A    public static double circleDistance(Circle c1, Circle c2) %7B%0A        return distance(c1.getCenter(), c2.getCenter()) -%0A                c1.getRadius() - c2.getRadius();%0A    %7D%0A%0A
 %7D%0A

add function to calculate distance between points & circle.