Namespaces

Types in MathNet.Spatial.Euclidean

Type Line3D

Namespace MathNet.Spatial.Euclidean

Parent ValueType

Interfaces IEquatable<Line3D>, IXmlSerializable

A line between two points

Constructors

Static Functions

Methods

Properties

Fields

Public Constructors

Line3D(Point3D startPoint, Point3D endPoint)

Initializes a new instance of the Line3D struct. Throws an ArgumentException if the startPoint is equal to the endPoint.
Parameters
Point3D startPoint

The starting point of the line segment.

Point3D endPoint

The ending point of the line segment.

Public Static Functions

Line3D Parse(string startPoint, string endPoint)

Returns a new Line2D from a pair of strings which represent points. See Parse for details on acceptable formats.
Parameters
string startPoint

The string representation of the first point.

string endPoint

The string representation of the second point.

Return
Line3D

A line segment from the first point to the second point.

Public Methods

Tuple<Point3D, Point3D> ClosestPointsBetween(Line3D other)

Computes the pair of points which represent the closest distance between this Line3D and another Line3D, with the first point being the point on this Line3D, and the second point being the corresponding point on the other Line3D. If the lines intersect the points will be identical, if the lines are parallel the first point will be the start point of this line.
Parameters
Line3D other

line to compute the closest points with

Return
Tuple<Point3D, Point3D>

A tuple of two points representing the endpoints of the shortest distance between the two lines

Tuple<Point3D, Point3D> ClosestPointsBetween(Line3D other, bool mustBeOnSegments)

Computes the pair of points which represents the closest distance between this Line3D and another Line3D, with the option of treating the lines as segments bounded by their start and end points.
Parameters
Line3D other

line to compute the closest points with

bool mustBeOnSegments

if true, the lines are treated as segments bounded by the start and end point

Return
Tuple<Point3D, Point3D>

A tuple of two points representing the endpoints of the shortest distance between the two lines or segments

Point3D ClosestPointTo(Point3D p, bool mustBeOnSegment)

Returns the closest point on the line to the given point.
Parameters
Point3D p

The point that the returned point is the closest point on the line to

bool mustBeOnSegment

If true the returned point is contained by the segment ends, otherwise it can be anywhere on the projected line

Return
Point3D

The closest point on the line to the provided point

bool Equals(Line3D other)

bool Equals(object obj)

int GetHashCode()

Type GetType()

Nullable<Point3D> IntersectionWith(Plane plane, double tolerance)

Find the intersection between the line and a plane
Parameters
Plane plane

The plane.

double tolerance

A tolerance (epsilon) to compensate for floating point error

Return
Nullable<Point3D>

A point where the line and plane intersect; null if no such point exists

bool IsParallelTo(Line3D other)

Checks to determine whether or not two lines are parallel to each other, using the dot product within the double precision specified in the MathNet.Numerics package.
Parameters
Line3D other

The other line to check this one against

Return
bool

True if the lines are parallel, false if they are not

bool IsParallelTo(Line3D other, Angle angleTolerance)

Checks to determine whether or not two lines are parallel to each other within a specified angle tolerance
Parameters
Line3D other

The other line to check this one against

Angle angleTolerance

If the angle between line directions is less than this value, the method returns true

Return
bool

True if the lines are parallel within the angle tolerance, false if they are not

Line3D LineTo(Point3D p, bool mustStartBetweenStartAndEnd)

Returns the shortest line between this line and a point.
Parameters
Point3D p

the point to create a line to

bool mustStartBetweenStartAndEnd

If false the start point can extend beyond the start and endpoint of the line

Return
Line3D

The shortest line between the line and the point

Line3D ProjectOn(Plane plane)

The line projected on a plane
Parameters
Plane plane

The plane.

Return
Line3D

A projected line.

string ToString()

Public Properties

UnitVector3D Direction get;

Gets the direction from the StartPoint to EndPoint

double Length get;

Gets distance from StartPoint to EndPoint , the length of the line

Public fields

Point3D StartPoint

The start point of the line
return Point3D

Point3D EndPoint

The end point of the line
return Point3D