package com.sqx.common.utils;

import com.sqx.modules.errand.util.LonLatUtil;
import org.gavaghan.geodesy.Ellipsoid;
import org.gavaghan.geodesy.GlobalCoordinates;

/**
 * 距离计算
 *
 * @author: codingliang
 * @date: 2024-04-20 21:29
 */
public class DistanceUtil {

    public static double distance(double ol, double od, double dl, double dd) {
        GlobalCoordinates source = new GlobalCoordinates(ol, od);
        GlobalCoordinates target = new GlobalCoordinates(dl, dd);
        return LonLatUtil.getDistanceMeter(source, target, Ellipsoid.Sphere);
    }

}
