Header menu logo Euclid

Line2D Type

An immutable finite line in 2D. Represented by a 2D start and 2D end point.

Record fields

Record Field Description

FromX

Full Usage: FromX

Field type: float

Returns the X coordinate of the start point of the line.

Field type: float

FromY

Full Usage: FromY

Field type: float

Returns the Y coordinate of the start point of the line.

Field type: float

ToX

Full Usage: ToX

Field type: float

Returns the X coordinate of the end point of the line.

Field type: float

ToY

Full Usage: ToY

Field type: float

Returns the Y coordinate of the end point of the line.

Field type: float

Constructors

Constructor Description

Line2D(fromX, fromY, toX, toY)

Full Usage: Line2D(fromX, fromY, toX, toY)

Parameters:
    fromX : float
    fromY : float
    toX : float
    toY : float

Returns: Line2D

Create Line2D from 2D start point's x and y and 2D end point's x and y .

fromX : float
fromY : float
toX : float
toY : float
Returns: Line2D

Line2D(fromPt, toPt)

Full Usage: Line2D(fromPt, toPt)

Parameters:
    fromPt : Pt
    toPt : Pt

Returns: Line2D

Create Line2D from 2D start point and 2D end point.

fromPt : Pt
toPt : Pt
Returns: Line2D

Instance members

Instance member Description

this.AsString

Full Usage: this.AsString

Returns: string

Format 2D line into string from X and Y for start and end points. Using nice floating point number formatting . But without full type name as in v.ToString()

Returns: string

this.Direction

Full Usage: this.Direction

Returns: Vc
Modifiers: inline

Same as ln.Vector or ln.Tangent. The returned vector has the same length as the Line2D.

Returns: Vc

this.From

Full Usage: this.From

Returns: Pt
Modifiers: inline

The Start point of the 2D Line2D,

Returns: Pt

this.Length

Full Usage: this.Length

Returns: float
Modifiers: inline

Returns the length of the line.

Returns: float

this.LengthSq

Full Usage: this.LengthSq

Returns: float
Modifiers: inline

Returns the square length of the line.

Returns: float

this.Tangent

Full Usage: this.Tangent

Returns: Vc
Modifiers: inline

Same as ln.Vector or ln.Direction. The returned vector has the same length as the Line2D.

Returns: Vc

this.To

Full Usage: this.To

Returns: Pt
Modifiers: inline

The End point of the 2D Line2D,

Returns: Pt

this.UnitTangent

Full Usage: this.UnitTangent

Returns: UnitVc
Modifiers: inline

Returns a unit-vector of the line Direction.

Returns: UnitVc

this.Vector

Full Usage: this.Vector

Returns: Vc
Modifiers: inline

Same as ln.Tangent or ln.Direction. The returned vector has the same length as the Line2D.

Returns: Vc

Type something to start searching.