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

Matt Juntunen commented on GEOMETRY-23:
---------------------------------------

{quote}Did you explore why the design of the non-matching libraries was as it 
was?
{quote}
Actually, I don't know of _any_ libraries that actually have separate Point and 
Vector classes:-) The idea came from one of the computer graphics textbooks 
that I've used before (I can't think of the name right now), where it 
recommends this sort of structure. It then points to G3D as an example. G3D 
does have Point3D and Vector3D types in its code, but I didn't realize until 
just recently that Point3D is simply a typedef for Vector3D 
(https://casual-effects.com/g3d/G3D10/G3D-base.lib/include/G3D-base/Vector3.h). 
There is a note included above the typedef that essentially says that making 
Point3D its own class is more of a pain than its worth. Considering how much 
code I removed in this pull request, I can believe that now.
{quote}Consequently to the changes, I'd prefer the factory method in 
{{Vector3D}} to be renamed {{ofCartesian}} (even if the implementation is with 
Cartesian coordinates).
 Do you agree?
{quote}
No:-) It seems unnecessarily verbose and I don't think the method is ambiguous 
in any way in its current form.

> Remove Euclidean Point Classes
> ------------------------------
>
>                 Key: GEOMETRY-23
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-23
>             Project: Apache Commons Geometry
>          Issue Type: Improvement
>            Reporter: Matt Juntunen
>            Priority: Major
>              Labels: pull-request-available
>
> Based on discussion of the current Point/Vector API in GEOMETRY-14 and 
> research into other geometric libraries, I think we should remove the 
> Euclidean Point?D classes and make Vector?D also implement Point. This will 
> end up being similar to the previous commons-math design but avoids the issue 
> raised in MATH-1284 since the Point and Vector interfaces are not related. 
> They just happen to be implemented by the same class, which we're calling 
> Vector?D since a vector can be used to indicate a point (by adding it to the 
> origin).
> In the course of trying this out this design, I ended up removing 7 classes 
> and simplifying several methods. I think that's a good indicator that this is 
> a good design choice.
>  
> Pull request: https://github.com/apache/commons-geometry/pull/15



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

Reply via email to