Android examples for java.lang:Math Geometry
get Line Slope
//package com.java2s; public class Main { public static float getSlope(float x1, float y1, float x2, float y2) { float x = (x2 - x1); float y = y2 - y1; if (x == 0) { return Float.NaN; }/* ww w. j av a 2 s . c o m*/ return y / x; } }