Here you can find the source of getAngle(Point2D center, Point2D point)
public static double getAngle(Point2D center, Point2D point)
//package com.java2s; import java.awt.geom.Point2D; public class Main { public static double getAngle(Point2D center, Point2D point) { return Math.atan2(-(point.getY() - center.getY()), point.getX() - center.getX()); }/* ww w . j a v a2 s . c o m*/ }