mathnet-spatial icon indicating copy to clipboard operation
mathnet-spatial copied to clipboard

Does a line have direction or is a line just two points unordered?

Open JohanLarsson opened this issue 8 years ago • 6 comments

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.

JohanLarsson avatar Mar 09 '16 18:03 JohanLarsson

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.

mattj23 avatar Mar 11 '16 15:03 mattj23

Yeah, Line2D and Line3D may be poorly named. Should perhaps be LineSegment2D and 3D.

JohanLarsson avatar Mar 11 '16 16:03 JohanLarsson

That's fair. A true line should probably be represented in point-direction form.

mattj23 avatar Mar 11 '16 16:03 mattj23

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

mattj23 avatar Mar 14 '16 13:03 mattj23

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.

JohanLarsson avatar Mar 14 '16 14:03 JohanLarsson

Can you please check if this issue is still valid or can we close it?

jkalias avatar Mar 29 '23 12:03 jkalias