vincentlu
3 天以前 908421d77423a632630fccb49bf0eb2aa1431cd4
zy-acs-manager/src/main/java/com/zy/acs/manager/core/domain/VehicleFootprint.java
New file
@@ -0,0 +1,27 @@
package com.zy.acs.manager.core.domain;
import lombok.Data;
/**
 * 车辆在自身坐标系下的矩形轮廓描述
 */
@Data
public class VehicleFootprint {
    private double head;
    private double tail;
    private double halfWidth;
    public VehicleFootprint(double head, double tail, double halfWidth) {
        this.head = head;
        this.tail = tail;
        this.halfWidth = halfWidth;
    }
    public double maxExtent() {
//        double frontDiag = Math.hypot(head, halfWidth);
//        double rearDiag = Math.hypot(tail, halfWidth);
//        return Math.max(frontDiag, rearDiag);
        return Math.hypot(Math.max(head, tail), halfWidth);
    }
}