Java examples for java.lang:Math Geometry Line
get Line Angle
//package com.java2s; import java.awt.*; public class Main { public static double getAngle(Point p1, Point p2) { double deltaX = p2.x - p1.x; double deltaY = p2.y - p1.y; return Math.atan2(deltaY, deltaX) * 180 / Math.PI; }// ww w . j ava 2 s . co m }