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

Matt Juntunen commented on GEOMETRY-92:
---------------------------------------

When I said that things were independent of dimension, I was referring to the 
hyperplane vs sub-hyperplane comparison. Maybe the following class descriptions 
will clear things up. Classes with an "*" already exist in the form needed for 
this issue.

- {{Line}}* - represents a line in 2D space; implements {{Hyperplane}}
- {{Segment}} - represents a finite portion of a line in 2D space; implements 
{{ConvexSubHyperplane}}
- {{OutgoingRay}} / {{IncomingRay}} - represents a half-line in 2D space; only 
one end/start point is present; implements {{ConvexSubHyperplane}}
- {{FullLine}} ? - represents all points on the line in 2D space; implements 
{{ConvexSubHyperplane}}

- {{Line3D}}* - represents a line in 3D space; implements {{Embedding<Vector3D, 
Vector1D>}}
- {{Segment3D}} - represents a finite portion of a line in 3D space
- {{OutoingRay3D}} / {{IncomingRay3D}} - represents a half-line in 3D space; 
only on end/start point is present
- {{FullLine3D}} ?-  represents all points on the line in 3D space

So, in each dimension we have a mathematical line. For that line, we have a 
number of other class we can use to select a subset of the points lying on the 
line. In the {{FullLine}} and {{FullLine3D}} cases, we happen to select every 
single point on the line. But, {{FullLine}} and {{FullLine3D}} are not 
themselves lines. That's the distinction I was trying to make: {{Line}} and 
{{FullLine}} represent different concepts.



> Segment is not mathematically correct
> -------------------------------------
>
>                 Key: GEOMETRY-92
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-92
>             Project: Apache Commons Geometry
>          Issue Type: Improvement
>            Reporter: Matt Juntunen
>            Priority: Major
>
> The {{Segment}} class is not mathematically correct because line segments are 
> defined as having distinct start and end points, whereas the start and end 
> points in {{Segment}} are optional. In other words, an instance of 
> {{Segment}} can represent an entire line, a ray, or a segment. I propose 
> renaming the existing {{Segment}} class to {{ConvexSubLine}} and creating 
> subclasses to represent the distinct types of sublines. 
>  * {{ConvexSubLine}} -  Abstract convex subline class. The factory methods 
> (such as fromPoints()), would examine the inputs and return one of the 
> specific subclasses below. Each subclass would also contain its own factory 
> methods that apply input validation (eg, no null points when creating a 
> {{Segment}}). This would also allow each subclass to optimize some 
> computations based on the known characteristics of the represented entity.
>  ** {{FullLine}} - no start or end points
>  ** {{Segment}} - contains non-null start point and end point
>  ** {{Ray}} - contains non-null start point and null end point
>  ** {{ReverseRay}} - contains non-null end point and null start point (not 
> sure if there is a more mathematical term for this)
> These changes would also apply to the 3D classes:
>  * {{ConvexSubLine3D}}
>  ** {{FullLine3D}}
>  ** {{Segment3D}}
>  ** {{Ray3D}}
>  ** {{ReverseRay3D}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to