#
vincentlu
2 天以前 67de3f38ab7a5ae9a9ae1aeec369c285004ee4d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.zy.acs.manager.core.domain;
 
import com.zy.acs.manager.common.utils.MapDataUtils;
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);
 
        double hypot = Math.hypot(Math.max(head, tail), halfWidth);
        return MapDataUtils.getVehicleWaveSafeDistance(hypot);
    }
}