#
vincentlu
昨天 f076136ab3d84d0129a2b5898ee92dc1b70a4a30
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
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);
    }
}