Struct Line3D
Represents a line in 3D space that is composed of single-precision floating-point X, Y and Z coordinates.
Namespace: X10D.Drawing
Assembly: X10D.dll
Syntax
public struct Line3D : IEquatable<Line3D>, IComparable<Line3D>, IComparable
Constructors
| Improve this Doc View SourceLine3D(Vector3, Vector3)
Initializes a new instance of the Line3D struct by taking the start and end points.
Declaration
public Line3D(in Vector3 start, in Vector3 end)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | start | The start point. |
Vector3 | end | The end point. |
Fields
| Improve this Doc View SourceEmpty
The empty line. That is, a line whose start and end points are at (0, 0).
Declaration
public static readonly Line3D Empty
Field Value
Type | Description |
---|---|
Line3D |
One
The line whose start point is at (0, 0, 0) and end point is at (1, 1, 1).
Declaration
public static readonly Line3D One
Field Value
Type | Description |
---|---|
Line3D |
UnitX
The line whose start point is at (0, 0, 0) and end point is at (1, 0, 0).
Declaration
public static readonly Line3D UnitX
Field Value
Type | Description |
---|---|
Line3D |
UnitY
The line whose start point is at (0, 0, 0) and end point is at (0, 1, 0).
Declaration
public static readonly Line3D UnitY
Field Value
Type | Description |
---|---|
Line3D |
UnitZ
The line whose start point is at (0, 0, 0) and end point is at (0, 0, 1).
Declaration
public static readonly Line3D UnitZ
Field Value
Type | Description |
---|---|
Line3D |
Properties
| Improve this Doc View SourceEnd
Gets the end point of the line.
Declaration
public Vector3 End { get; }
Property Value
Type | Description |
---|---|
Vector3 | The end point. |
Length
Gets the length of this line.
Declaration
public float Length { get; }
Property Value
Type | Description |
---|---|
System.Single | The length. |
LengthSquared
Gets the length of this line, squared.
Declaration
public float LengthSquared { get; }
Property Value
Type | Description |
---|---|
System.Single | The squared length. |
Start
Gets the start point of the line.
Declaration
public Vector3 Start { get; }
Property Value
Type | Description |
---|---|
Vector3 | The start point. |
Methods
| Improve this Doc View SourceCompareTo(Nullable<Object>)
Compares this instance to another object.
Declaration
public int CompareTo(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj | The object with with which to compare |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
System.Int32 | A signed number indicating the relative values of this instance and
|
Remarks
Comparison internally measures the LengthSquared property to avoid calls to obj
is not an instance of Line3D.
CompareTo(Line3D)
Compares this instance to another Line3D.
Declaration
public int CompareTo(Line3D other)
Parameters
Type | Name | Description |
---|---|---|
Line3D | other |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
System.Int32 | A signed number indicating the relative values of this instance and
|
Remarks
Comparison internally measures the LengthSquared property to avoid calls to
Equals(Nullable<Object>)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Line3D)
Returns a value indicating whether this instance and another instance are equal.
Declaration
public bool Equals(Line3D other)
Parameters
Type | Name | Description |
---|---|---|
Line3D | other | The instance with which to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if this instance and |
FromLine(Line)
Declaration
public static Line3D FromLine(in Line line)
Parameters
Type | Name | Description |
---|---|---|
Line | line | The line to convert. |
Returns
Type | Description |
---|---|
Line3D | The converted line. |
FromLineF(LineF)
Declaration
public static Line3D FromLineF(in LineF line)
Parameters
Type | Name | Description |
---|---|---|
LineF | line | The line to convert. |
Returns
Type | Description |
---|---|
Line3D | The converted line. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Operators
| Improve this Doc View SourceEquality(Line3D, Line3D)
Returns a value indicating whether two instances of Line3D are equal.
Declaration
public static bool operator ==(Line3D left, Line3D right)
Parameters
Type | Name | Description |
---|---|---|
Line3D | left | The first instance. |
Line3D | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
GreaterThan(Line3D, Line3D)
Returns a value indicating whether the length of one line is greater than that of another.
Declaration
public static bool operator>(in Line3D left, in Line3D right)
Parameters
Type | Name | Description |
---|---|---|
Line3D | left | The first instance. |
Line3D | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Length of |
GreaterThanOrEqual(Line3D, Line3D)
Returns a value indicating whether the length of one line is greater than or equal to that of another.
Declaration
public static bool operator >=(in Line3D left, in Line3D right)
Parameters
Type | Name | Description |
---|---|---|
Line3D | left | The first instance. |
Line3D | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Length of |
Implicit(Line to Line3D)
Declaration
public static implicit operator Line3D(in Line line)
Parameters
Type | Name | Description |
---|---|---|
Line | line | The line to convert. |
Returns
Type | Description |
---|---|
Line3D | The converted line. |
Implicit(LineF to Line3D)
Declaration
public static implicit operator Line3D(in LineF line)
Parameters
Type | Name | Description |
---|---|---|
LineF | line | The line to convert. |
Returns
Type | Description |
---|---|
Line3D | The converted line. |
Inequality(Line3D, Line3D)
Returns a value indicating whether two instances of Line3D are not equal.
Declaration
public static bool operator !=(Line3D left, Line3D right)
Parameters
Type | Name | Description |
---|---|---|
Line3D | left | The first instance. |
Line3D | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
LessThan(Line3D, Line3D)
Returns a value indicating whether the length of one line is less than that of another.
Declaration
public static bool operator <(in Line3D left, in Line3D right)
Parameters
Type | Name | Description |
---|---|---|
Line3D | left | The first instance. |
Line3D | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Length of |
LessThanOrEqual(Line3D, Line3D)
Returns a value indicating whether the length of one line is less than or equal to that of another.
Declaration
public static bool operator <=(in Line3D left, in Line3D right)
Parameters
Type | Name | Description |
---|---|---|
Line3D | left | The first instance. |
Line3D | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Length of |