Here you can find the source of angle(float x, float y, float x1, float y1)
public static double angle(float x, float y, float x1, float y1)
//package com.java2s; public class Main { public static double angle(float x, float y, float x1, float y1) { return Math.atan((y1 - y) / (x1 - x)) + (x1 < x ? Math.PI : 0); }/*ww w .ja va 2 s. com*/ }