Math.hypot(dx, dy) prevents overflow or underflow. It is quite slower than a direct Math.sqrt(dx*dx + dy*dy), but in OTS this is never used in performance critical code. Usages are:
Bezier (2), used before simulation.
OtsLine3d.projectFractional() (2), used with lane changes.
LaneChange (2), used with lane changes.
ConflictBuilder(Parallel) (4/4), used before simulation.
Math.hypot(dx, dy)
prevents overflow or underflow. It is quite slower than a directMath.sqrt(dx*dx + dy*dy)
, but in OTS this is never used in performance critical code. Usages are:Bezier
(2), used before simulation.OtsLine3d.projectFractional()
(2), used with lane changes.LaneChange
(2), used with lane changes.ConflictBuilder(Parallel)
(4/4), used before simulation.