package com.gci.boot.common.util;

/**
 * @author lyz
 * @date 2023/10/31 17:55
 */
public class CalcTool {

    public static double getDistance(double p_FirstLongitude,double p_FirstLatitude,
                                     double p_SecondLongitude,double p_SecondLatitude) {
        double distance = 6366707.01949329* Math.acos(
                Math.sin(p_FirstLatitude*0.0174532925199444)*Math.sin(p_SecondLatitude*0.0174532925199444)+
                        Math.cos(p_FirstLatitude*0.0174532925199444)*Math.cos(p_SecondLatitude*0.0174532925199444)*
                                Math.cos((p_FirstLongitude-p_SecondLongitude)*0.0174532925199444)
        );
        return (distance+(distance*0.2))/1000.0;
    }
}
