private float headTowards(float x, float y) {
        /*
         * use cross product to see if we need
         * to turn left or right. return true if
         * we are 'at' the point.
         */
        Vector3d u = new Vector3d(x - flyingDot.p.x, y - flyingDot.p.y, 0);
        Vector3d v = new Vector3d(flyingDot.v.x, flyingDot.v.y, 0);
        float d = u.length();

        if (d < flyingDot.my_turn_radius / 4) {
            //we are there
            targetPoint = null;
            if (circuit != null) reachedCircuitPoint();
            return 0;
        }

        // are we flying ~ staight towards target ?
        float dot = u.dot(v) / (flyingDot.ds * d);
        if (dot > 0.99) {
            return 0;
        }

        Vector3d c = v.crossed(u);
        float sin = c.length() / (flyingDot.ds * d);
        float sin1 = flyingDot.ds / flyingDot.my_turn_radius;

        if (sin <= sin1 * 2 && sin >= -sin1 * 2) {
            /*
             * maintain ~ current heading (with
             * a bit of fine tuning to eliminate wobble)
             * eq1: ds = r * dtheta
             * eq2: dtheta ~ sin(dtheta) ( for small dtheta )
             */

            if (c.z > 0) sin *= -1;    //left
            //System.out.println("sin: " + sin);
            float r = flyingDot.ds / sin;
            //System.out.println("Fine tune MTR/r:" + flyingDot.my_turn_radius/r);

            //convert so that 1/2 my turn radius goes to 2
            return flyingDot.my_turn_radius / r;
        }

        if (c.z > 0) {
            if (circuit == null) return -1;
            else return -2; //left
        } else {
            if (circuit == null) return 1;
            else return 2; //right
        }
    }