Here you can find the source of absoluteBearing(Point2D.Double sourceLocation, Point2D.Double target)
public static double absoluteBearing(Point2D.Double sourceLocation, Point2D.Double target)
//package com.java2s; import java.awt.geom.Point2D; public class Main { public static double absoluteBearing(Point2D.Double sourceLocation, Point2D.Double target) { return Math.atan2(target.x - sourceLocation.x, target.y - sourceLocation.y);//w w w . j a va 2 s .c o m } }