/** * Calculates whether the point is within the radius of a fixed point * @ October 20, 2016 * @param a longitude 1 known * @param b latitude 1 known * @param x longitude 2 * @param y Latitude 2 * @param radius distance of R radius (m) comparison * @return Object[0] is in the known range*/ Public StaticObject[] Getmanypoint (DoubleADoubleBDoubleXDoubleYDoubleR) {object[] obj=Newobject[2]; DoublePK = the/3.14169; DoubleA1 = A/PK; DoubleA2 = bPK; DoubleB1 = x/PK; DoubleB2 = y/PK; DoubleT1 = Math.Cos (A1) * MATH.COS (A2) * MATH.COS (B1) *Math.Cos (B2); DoubleT2 = Math.Cos (A1) * Math.sin (A2) * MATH.COS (B1) *Math.sin (B2); DoubleT3 = Math.sin (A1) *Math.sin (B1); Doublett =6366000* Math.acos (t1 + t2 +T3); if(R >=TT) {obj[0] =true; }Else{obj[0] =false; } obj[1] =tt; returnobj; }
Java calculates the distance between two latitude and longitude degrees