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

Gilles commented on GEOMETRY-23:
--------------------------------

{quote}my prior confusion when I first saw the class name "Cartesian3D"
{quote}
If some class named Cartesian3D "implements" (or "extends") another class named 
Vector3D, and Vector3D has methods "normalize" and "dot", then by virtue of OO 
programming, it provides all the above functionalities.

What confuses me is that a class named Vector3D would be tied to a specific 
implementation/coordinate system.

I've asked that question before: Are you positive that no other implementation 
will ever be useful? In the context of geometry, the answer is certainly "no", 
but perhaps such "advanced functionality" is forever deemed beyond the scope of 
this library.
 Then if so, I would *not* have any conversion _methods_ (such as 
"fromSpherical") within the class representing a vector: it's up to the user to 
construct the instance using appropriate inputs (i.e. Cartesian coordinates).
 We can of course provide the code to do the conversion, but it would be a 
separate "utility" class (e.g. "CoordinateConverter"). The distinction may be 
subtle but I would see it as a way to avoid confusion (by stressing that 
Cartesian coordinates are the _only_ ones being used within the library).

> 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