Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static float getAngle(float x1, float y1, float x2, float y2) { return (float) Math.atan2(y1 - y2, x2 - x1); } }