信号机距离计算方式修改
This commit is contained in:
parent
8528475bcb
commit
65d84a98a8
@ -62,9 +62,9 @@ export default {
|
||||
return idx;
|
||||
},
|
||||
|
||||
// 只是用来比较就不开根号了, 同一个区段的信号机距离应该不会溢出
|
||||
// 采用合理的距离计算方式
|
||||
distanceOf(a, b) {
|
||||
return (b.x - a.x) ** 2 + (b.y - a.y) ** 2;
|
||||
return Math.hypot(b.x - a.x, b.y - a.y);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user