/** * Returns the direction in which another coordinate lies; 0 if the * coordinates are equal. * * @param d the destination coordinate. */ public int direction(Coords d) { return (int) Math.round(radian(d) / HEXSIDE) % 6; }
/** * Returns the degree direction of another Coords. * * @param d the destination coordinate. */ public final int degree(Coords d) { return (int) Math.round((180 / Math.PI) * radian(d)); }
final Point t = this.bv.getHexLocation(entityM.getPosition()); final double an = (entityE.getPosition().radian( entityM.getPosition()) + (Math.PI * 1.5)) % (Math.PI * 2); // angle
if (split) { centerDirection = (int) Math.round(src.radian(dest) + 0.0001 / HEXSIDE) % 6;
next = en.getPassedThrough().get(1); currPoint = bv.getCentreHexLocation(curr, true); angle = curr.radian(next); flyOverPoly.addPoint(currPoint.x + (int) (Math.cos(angle) * lw + 0.5), currPoint.y + (int) (Math.sin(angle) * lw + 0.5)); currPoint.y = (int) (currPoint.y - yDiff / 2 + 0.5); angle = (curr.radian(next) + Math.PI) % (2 * Math.PI); flyOverPoly.addPoint(currPoint.x + (int) (Math.cos(angle) * lw + 0.5), currPoint.y + (int) (Math.sin(angle) * lw + 0.5)); currPoint.y = (int) (currPoint.y - yDiff / 2 + 0.5); angle = curr.radian(next); flyOverPoly.addPoint(currPoint.x + (int) (Math.cos(angle) * lw + 0.5), currPoint.y + (int) (Math.sin(angle) * lw + 0.5)); prev = en.getPassedThrough().get(1); currPoint = bv.getCentreHexLocation(curr, true); angle = prev.radian(curr); flyOverPoly.addPoint(currPoint.x + (int) (Math.cos(angle) * lw + 0.5), currPoint.y + (int) (Math.sin(angle) * lw + 0.5));
an = (start.radian(end) + (Math.PI * 1.5)) % (Math.PI * 2); // angle makePoly();
targetPosition = target.getPosition(); an = (ae.getPosition().radian(targetPosition) + (Math.PI * 1.5)) % (Math.PI * 2); // angle makePoly();