mathnet-spatial
mathnet-spatial copied to clipboard
Does a line have direction or is a line just two points unordered?
This would affect equality and it does not make any sense to have a direction property if it is unordered.
An alternative could perhaps be two types Line2D
and DirectedLine2D
might be confusing.
A line, in my understanding, is simply the points in space which satisfy an equation of the form y=mx+b or a=B+tV in vector form. Our two point representation of Line2D and Line3D is a convenient representation because it also lets us interpret it as a line segment, but that isn't the original intent of those objects.
Lines are directionless, so I think the Line2D
and Line3D
IsParallelTo
method should return true for parallel lines regardless of the direction and it should be up to the user to account for direction if they are using the line structs to represent a segment instead of a line of infinite length.
As far as vectors go, I'm not sure. I'm inclined to believe that two vectors supported by parallel lines are parallel as well.
Yeah, Line2D and Line3D may be poorly named. Should perhaps be LineSegment2D and 3D.
That's fair. A true line should probably be represented in point-direction form.
The closest thing I can find to a formal definition of parallel is that in 2D space they refer to lines that do not intersect, and in 3d space lines that maintain constant separation.
By that definition, I think the methods work correctly as they are for both vectors and lines, and renaming the current Line constructs to Segments and creating true line representations should be an entirely separate issue.
http://mathworld.wolfram.com/Parallel.html
Thanks for looking into this. I've been crazy busy and going to be for a while. Hope you don't find it annoying that the PRs are not getting much review.
Can you please check if this issue is still valid or can we close it?