Here you can find the source of angleInRadians(float originX, float originY, float targetX, float targetY)
public static float angleInRadians(float originX, float originY, float targetX, float targetY)
//package com.java2s; //License from project: Apache License public class Main { public static float angleInRadians(float originX, float originY, float targetX, float targetY) { return (float) Math.atan2(targetY - originY, targetX - originX); }//from w ww. ja v a 2 s .c o m }