commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (GEOMETRY-9) New Euclidean Vector Methods
Date Wed, 05 Sep 2018 16:05:00 GMT


Gilles commented on GEOMETRY-9:

Sorry I missed that a PR was available...

There are some design issues:
# Wherever {{IllegalStateException}} is used, I think that {{IllegalArgumentException}} would
convey the right meaning.
# Class {{Vectors}} is a a so-called "utility" class, which is viewed as an [anti-pattern|].
 Without having looked at the implications, I'd suggest to rethink its necessity. If it's
just syntactic sugar to speed development, please consider putting it in an "internal" package
so that the "bad" API is not public and can be replaced without notice.
# Why is a {{static}} version needed, since as the comment says "it simply calls" the other

> New Euclidean Vector Methods
> ----------------------------
>                 Key: GEOMETRY-9
>                 URL:
>             Project: Apache Commons Geometry
>          Issue Type: Wish
>            Reporter: Matt Juntunen
>            Priority: Minor
> We should add some more methods to the Euclidean vector classes for user convenience
and algorithm clarity.
>  # length() – more intuitive alias for getNorm()
>  # project(Vector) – returns the current vector projected onto the given vector
>  # static project(Vector, Vector) – static version of project
>  # reject(Vector) – returns the current vector projected onto the plane whose normal
is passed to the method (vec equals vec.project(v) + vec.reject(v))
>  # static reject(Vector, Vector) – static version of reject
>  # lerp(Vector, double) – linear interpolation between the current vector and the given
>  # static lerp(Vector, Vector, double) – static version of lerp
>  # withLength(double) – returns the current vector with the given length. This is equivalent
to vector.normalize().scalarMultiply(x) but without the intermediate vector.
> Pull request: []

This message was sent by Atlassian JIRA

View raw message