[
https://issues.apache.org/jira/browse/GEOMETRY-50?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17028366#comment-17028366
]
Gilles Sadowski commented on GEOMETRY-50:
-----------------------------------------
In the the context of "Commons Geometry" usage, are there examples where
{{Math.hypot}} is required? If not, a common implementation of the norm
computation would avoid some future puzzling about the performance issue.
bq. {{SafeNorm}} [is] a modest performance hit in 3D.
(5026-4191)/(12742-4111) = 0.0967
So, if IIUC the above table, {{SafeNorm}} is ~10 times slower.
> Overflow in Vector norm and distance
> ------------------------------------
>
> Key: GEOMETRY-50
> URL: https://issues.apache.org/jira/browse/GEOMETRY-50
> Project: Apache Commons Geometry
> Issue Type: Bug
> Reporter: Baljit Singh
> Priority: Major
>
> In Euclidean Vector classes (Vector2D, Vector3D), norm() and distance() rely
> on Math.sqrt(), which can overflow if the components of the vectors are
> large. Instead, they should rely on SafeNorm.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)