fei.wang
2024-04-16 70223b3ef4df02622869425fed4ba9b290e1aa74
src/main/java/com/hxzk/Main.java
@@ -2,11 +2,25 @@
import com.hxzk.pojo.TbHeartRecord;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.List;
public class Main {
    public static void main(String[] args) {
    public static void main(String[] args) {
        double x1 = 13521978.408849519;
        double y1 = 3584501.125890286;
        double x2 = 13521642.21136821;
        double y2 = 3584507.2560229967;
        double distance = calculateDistance(x1, y1, x2, y2);
        System.out.println(distance);
    }
    public static double calculateDistance(double x1, double y1, double x2, double y2) {
        double distance = Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2));
        return distance;
    }
}