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