Struct LineF
Represents a line in 2D space that is composed of single-precision floating-point X and Y coordinates.
Namespace: X10D.Drawing
Assembly: X10D.dll
Syntax
public struct LineF : IEquatable<LineF>, IComparable<LineF>, IComparable
Constructors
| Improve this Doc View SourceLineF(PointF, PointF)
Initializes a new instance of the LineF struct by taking the start and end points.
Declaration
public LineF(PointF start, PointF end)
Parameters
Type | Name | Description |
---|---|---|
PointF | start | The start point. |
PointF | end | The end point. |
LineF(Vector2, Vector2)
Initializes a new instance of the LineF struct by taking the start and end points.
Declaration
public LineF(Vector2 start, Vector2 end)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | start | The start point. |
Vector2 | 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 LineF Empty
Field Value
Type | Description |
---|---|
LineF |
One
The line whose start point is at (0, 0) and end point is at (1, 1).
Declaration
public static readonly LineF One
Field Value
Type | Description |
---|---|
LineF |
UnitX
The line whose start point is at (0, 0) and end point is at (1, 0).
Declaration
public static readonly LineF UnitX
Field Value
Type | Description |
---|---|
LineF |
UnitY
The line whose start point is at (0, 0) and end point is at (0, 1).
Declaration
public static readonly LineF UnitY
Field Value
Type | Description |
---|---|
LineF |
Properties
| Improve this Doc View SourceEnd
Gets the end point of the line.
Declaration
public PointF End { get; }
Property Value
Type | Description |
---|---|
PointF | 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 PointF Start { get; }
Property Value
Type | Description |
---|---|
PointF | 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 Line.
CompareTo(LineF)
Compares this instance to another Line.
Declaration
public int CompareTo(LineF other)
Parameters
Type | Name | Description |
---|---|---|
LineF | 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(LineF)
Returns a value indicating whether this instance and another instance are equal.
Declaration
public bool Equals(LineF other)
Parameters
Type | Name | Description |
---|---|---|
LineF | other | The instance with which to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if this instance and |
FromLine(Line)
Declaration
public static LineF FromLine(in Line line)
Parameters
Type | Name | Description |
---|---|---|
Line | line | The line to convert. |
Returns
Type | Description |
---|---|
LineF | The converted line. |
FromLine3D(Line3D)
Declaration
public static LineF FromLine3D(in Line3D line)
Parameters
Type | Name | Description |
---|---|---|
Line3D | line | The line to convert. |
Returns
Type | Description |
---|---|
LineF | The converted line. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Operators
| Improve this Doc View SourceEquality(LineF, LineF)
Returns a value indicating whether two instances of LineF are equal.
Declaration
public static bool operator ==(in LineF left, in LineF right)
Parameters
Type | Name | Description |
---|---|---|
LineF | left | The first instance. |
LineF | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Explicit(Line3D to LineF)
Declaration
public static explicit operator LineF(in Line3D line)
Parameters
Type | Name | Description |
---|---|---|
Line3D | line | The line to convert. |
Returns
Type | Description |
---|---|
LineF | The converted line. |
GreaterThan(LineF, LineF)
Returns a value indicating whether the length of one line is greater than that of another.
Declaration
public static bool operator>(in LineF left, in LineF right)
Parameters
Type | Name | Description |
---|---|---|
LineF | left | The first instance. |
LineF | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Length of |
GreaterThanOrEqual(LineF, LineF)
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 LineF left, in LineF right)
Parameters
Type | Name | Description |
---|---|---|
LineF | left | The first instance. |
LineF | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Length of |
Implicit(Line to LineF)
Declaration
public static implicit operator LineF(in Line line)
Parameters
Type | Name | Description |
---|---|---|
Line | line | The line to convert. |
Returns
Type | Description |
---|---|
LineF | The converted line. |
Inequality(LineF, LineF)
Returns a value indicating whether two instances of LineF are not equal.
Declaration
public static bool operator !=(in LineF left, in LineF right)
Parameters
Type | Name | Description |
---|---|---|
LineF | left | The first instance. |
LineF | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
LessThan(LineF, LineF)
Returns a value indicating whether the length of one line is less than that of another.
Declaration
public static bool operator <(in LineF left, in LineF right)
Parameters
Type | Name | Description |
---|---|---|
LineF | left | The first instance. |
LineF | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Length of |
LessThanOrEqual(LineF, LineF)
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 LineF left, in LineF right)
Parameters
Type | Name | Description |
---|---|---|
LineF | left | The first instance. |
LineF | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Length of |