commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (GEOMETRY-17) Euclidean Vector Method Follow-Up
Date Sun, 23 Sep 2018 10:30:00 GMT


Gilles commented on GEOMETRY-17:

{quote}primarily for validation (and some optimization on retrieving a norm).
Actually I saw it the other way around: storing the norm so that it is computed once.
{quote}I'm having trouble picturing a use case
The general idea is that when a set of validated vectors is passed to any algorithm that would
need to access the norm, all these computations will be avoided.
 How is it different from creating a normalized vector for passing it around (in order to
avoid recomputing it every time a normalized vector is needed)?
{quote}mismatch between what we're saying the norm is and what it actually is given the vector
I see, but if the norm is not 1, then there is a mismatch between what the code is supposed
to mean and what it actually does...
 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).

> Euclidean Vector Method Follow-Up
> ---------------------------------
>                 Key: GEOMETRY-17
>                 URL:
>             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:

This message was sent by Atlassian JIRA

View raw message