[ 
https://issues.apache.org/jira/browse/GEOMETRY-17?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16625231#comment-16625231
 ] 

Matt Juntunen commented on GEOMETRY-17:
---------------------------------------

{quote}How is it different from creating a normalized vector for passing it 
around
{quote}
The difference is in the method signatures. normalize() already returns a new 
Vector instance whereas getNorm() returns a single value. It seems odd to me to 
create a new Vector instance (ie, a CheckedVector) in order to access the norm. 
It's more straightforward to just get the norm and check if it's what we want. 
I guess I'm just not sold on the idea.
{quote}I think that either the actual (but inaccurate) norm is "close enough", 
within the "context", to 1 (so that returning 1 won't, and should not, change 
the semantics), or it is not close enough and an exception must be raised (to 
signal a potentially dangerous inconsistency).
{quote}
Yes, we'll have to look into this more. I don't think we're doing anything 
wrong here in the code; we're just running up against floating point 
limitations. However, it would be good to quantify exactly what's happening 
here (in GEOMETRY-21).

> Euclidean Vector Method Follow-Up
> ---------------------------------
>
>                 Key: GEOMETRY-17
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-17
>             Project: Apache Commons Geometry
>          Issue Type: Improvement
>            Reporter: Matt Juntunen
>            Priority: Major
>
> This is a follow-up issue to GEOMETRY-9. The following tasks should be 
> completed:
>  # Vector2D - needs an orthogonal() method like Vector3D
>  # Vector#getMagnitude() should be removed. I originally added this as part 
> of GEOMETRY-9 as an alias for getNorm(), but after thinking about it more and 
> working with it, I believe it's more confusing than useful to have multiple 
> names in the code base for the same idea.
>  # Vector#withMagnitude() should be renamed to Vector#withNorm() for the same 
> reason as above.
>  # Vector#getRealNonZeroNorm() - This is currently a private method in the 
> Vector implementation classes but I believe it is useful enough to be made 
> public. The idea is that this would return the vector norm but throw an 
> IllegalNormException if the norm is zero, NaN, or infinite. I've already come 
> across some places in other classes (such as Rotation) where I want to use 
> this.
>  
> Pull request: https://github.com/apache/commons-geometry/pull/11



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to