Header menu logo Euclid

AutoOpenLine2D Module

When Euclid is opened this module will be auto-opened. It only contains extension members for type Line2D.

Type extensions

Type extension Description

this.ClosestParameter

Full Usage: this.ClosestParameter

Parameters:
Returns: float
Modifiers: inline

Returns the parameter at which a point is closest to the (finite) line. The result is between 0.0 and 1.0. Does not fails on very short curves.

Extended Type: Line2D

p : Pt
Returns: float

this.ClosestParameterInfinite

Full Usage: this.ClosestParameterInfinite

Parameters:
Returns: float

Assumes Line2D to be infinite! Returns the parameter at which a point is closest to the infinite line. If it is smaller than 0.0 or bigger than 1.0 it is outside of the finite line. Fails on curves shorter than 1e-9 units. (ln.ClosestParameter does not)

Extended Type: Line2D

p : Pt
Returns: float

this.ClosestPoint

Full Usage: this.ClosestPoint

Parameters:
Returns: Pt

Returns closest point on (finite) line. Does not fails on very short curves.

Extended Type: Line2D

p : Pt
Returns: Pt

this.ClosestPointInfinite

Full Usage: this.ClosestPointInfinite

Parameters:
Returns: Pt

Assumes Line2D to be infinite! Returns closest point on infinite line. Fails on curves shorter than 1e-9 units. (ln.ClosestPoint does not.)

Extended Type: Line2D

p : Pt
Returns: Pt

this.DistanceSqFromPoint

Full Usage: this.DistanceSqFromPoint

Parameters:
Returns: float

Returns square distance from point to finite line.

Extended Type: Line2D

p : Pt
Returns: float

this.DistanceSqFromPointInfinite

Full Usage: this.DistanceSqFromPointInfinite

Parameters:
Returns: float

Assumes Line2D to be infinite! Returns square distance from point to infinite line. Fails on curves shorter than 1e-9 units. (ln.DistanceSqFromPoint does not.)

Extended Type: Line2D

p : Pt
Returns: float

this.DistanceToPt

Full Usage: this.DistanceToPt

Parameters:
Returns: float
Modifiers: inline

Returns distance from point to (finite) line.

Extended Type: Line2D

p : Pt
Returns: float

this.DistanceToPtInfinite

Full Usage: this.DistanceToPtInfinite

Parameters:
Returns: float
Modifiers: inline

Assumes Line2D to be infinite! Returns distance from point to infinite line. Fails on curves shorter than 1e-9 units. (ln.DistanceToPt does not.)

Extended Type: Line2D

p : Pt
Returns: float

this.EvaluateAt

Full Usage: this.EvaluateAt

Parameters:
    p : float

Returns: Pt
Modifiers: inline

Evaluate line at a given parameter (parameters 0.0 to 1.0 are on the line),

Extended Type: Line2D

p : float
Returns: Pt

this.Extend

Full Usage: this.Extend

Parameters:
    distAtStart : float
    distAtEnd : float

Returns: Line2D
Modifiers: inline

Extend 2D line by absolute amount at start and end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtStart : float
distAtEnd : float
Returns: Line2D

this.ExtendEnd

Full Usage: this.ExtendEnd

Parameters:
    distAtEnd : float

Returns: Line2D
Modifiers: inline

Extend 2D line by absolute amount at end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtEnd : float
Returns: Line2D

this.ExtendEndRel

Full Usage: this.ExtendEndRel

Parameters:
    relAtEnd : float

Returns: Line2D
Modifiers: inline

Extend 2D line by relative amount at end. A relative amount of 0.5 extends the line by half its length. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

relAtEnd : float
Returns: Line2D

this.ExtendRel

Full Usage: this.ExtendRel

Parameters:
    relAtStart : float
    relAtEnd : float

Returns: Line2D
Modifiers: inline

Extend 2D line by relative amount at start and end. A relative amount of 0.5 extends the line by half its length on each side. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

relAtStart : float
relAtEnd : float
Returns: Line2D

this.ExtendStart

Full Usage: this.ExtendStart

Parameters:
    distAtStart : float

Returns: Line2D
Modifiers: inline

Extend 2D line by absolute amount at start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtStart : float
Returns: Line2D

this.ExtendStartRel

Full Usage: this.ExtendStartRel

Parameters:
    relAtStart : float

Returns: Line2D
Modifiers: inline

Extend 2D line by relative amount at start. A relative amount of 0.5 extends the line by half its length. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

relAtStart : float
Returns: Line2D

this.IsCoincidentTo

Full Usage: this.IsCoincidentTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D lines are coincident within the distance tolerance. 1e-6 by default. This means that lines are parallel within the angle tolerance and the distance of second start to the first line is less than the distance tolerance. Also returns false on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module.

Extended Type: Line2D

other : Line2D
distanceTolerance : float
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D lines are parallel. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

other : Line2D
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 2D lines is parallel to a 2D vector. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on lines or vectors shorter than 1e-12.

Extended Type: Line2D

other : Vc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 2D lines is parallel to a 2D unit-vector. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

other : UnitVc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D lines are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

other : Line2D
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 2D lines is parallel to a 2D vector. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

other : Vc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 2D lines is parallel to a 2D unit-vector. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minium cosine value. See Euclid.Cosine module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

other : UnitVc
minCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minium cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

other : Line2D
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 2D lines is perpendicular to a 2D vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minium cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

other : Vc
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 2D lines is perpendicular to a 2D unit-vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minium cosine value. The default cosine is 0.0043633 ( = 89.75 deg) See Euclid.Cosine module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

other : UnitVc
maxCosine : float<MeasureProduct<cosine, MeasureOne>>
Returns: bool

this.IsPointOnLeft

Full Usage: this.IsPointOnLeft

Parameters:
Returns: bool
Modifiers: inline

Looking in the direction of the line. Check if a given point is on the left side of the infinite line. Also returns false if the point is on the line.

Extended Type: Line2D

pt : Pt
Returns: bool

this.IsPointOnRight

Full Usage: this.IsPointOnRight

Parameters:
Returns: bool
Modifiers: inline

Looking in the direction of the line. Check if a given point is on the right side of the infinite line. Also returns false if the point is on the line.

Extended Type: Line2D

pt : Pt
Returns: bool

this.IsTiny

Full Usage: this.IsTiny

Parameters:
    tol : float

Returns: bool
Modifiers: inline

Check if line is shorter than tolerance. Or has NaN components.

Extended Type: Line2D

tol : float
Returns: bool

this.IsTinySq

Full Usage: this.IsTinySq

Parameters:
    tol : float

Returns: bool
Modifiers: inline

Check if the lines square length is shorter than squared tolerance. Or has NaN components.

Extended Type: Line2D

tol : float
Returns: bool

this.IsXAligned

Full Usage: this.IsXAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 2D line is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9. Fails on lines shorter than 1e-6.

Extended Type: Line2D

() : unit
Returns: bool

this.IsXAligned

Full Usage: this.IsXAligned

Returns: bool
Modifiers: inline

Checks if 2D line is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y axis is 1e-9. Fails on lines shorter than 1e-6.

Extended Type: Line2D

Returns: bool

this.IsYAligned

Full Usage: this.IsYAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 2D line is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9. Fails on lines shorter than 1e-6.

Extended Type: Line2D

() : unit
Returns: bool

this.IsYAligned

Full Usage: this.IsYAligned

Returns: bool
Modifiers: inline

Checks if 2D line is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X axis is 1e-9. Fails on lines shorter than 1e-6.

Extended Type: Line2D

Returns: bool

this.IsZeroLength

Full Usage: this.IsZeroLength

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Check if the line has same starting and ending point.

Extended Type: Line2D

() : unit
Returns: bool

this.IsZeroLength

Full Usage: this.IsZeroLength

Returns: bool
Modifiers: inline

Check if the line has same starting and ending point.

Extended Type: Line2D

Returns: bool

this.LengthFromParam

Full Usage: this.LengthFromParam

Parameters:
    t : float

Returns: float
Modifiers: inline

Returns the length of the line segment from the given parameter till the line End. This length is negative if the parameter is bigger than 1.0.

Extended Type: Line2D

t : float
Returns: float

this.LengthTillParam

Full Usage: this.LengthTillParam

Parameters:
    p : float

Returns: float
Modifiers: inline

Returns the length of the line segment from the start point to the given parameter. This length is negative if the parameter is negative.

Extended Type: Line2D

p : float
Returns: float

this.MatchesOrientation180

Full Usage: this.MatchesOrientation180

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 2D lines is less than 180 degrees. Calculates the dot product of two 2D lines. Then checks if it is bigger than 1e-12.

Extended Type: Line2D

l : Line2D
Returns: bool

this.MatchesOrientation180

Full Usage: this.MatchesOrientation180

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the a 2D line and a 2D vector is less than 180 degrees. Calculates the dot product of both. Then checks if it is bigger than 1e-12.

Extended Type: Line2D

v : Vc
Returns: bool

this.MatchesOrientation180

Full Usage: this.MatchesOrientation180

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the a 2D line and a 2D unit-vector is less than 180 degrees. Calculates the dot product of both. Then checks if it is bigger than 1e-12.

Extended Type: Line2D

v : UnitVc
Returns: bool

this.MatchesOrientation90

Full Usage: this.MatchesOrientation90

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 2D lines is less than 90 degrees. Calculates the dot product of the unit-vectors of the two 2D lines. Then checks if it is bigger than 0.707107 (cosine of 90 degrees).

Extended Type: Line2D

l : Line2D
Returns: bool

this.Mid

Full Usage: this.Mid

Parameters:
    () : unit

Returns: Pt
Modifiers: inline

Returns the midpoint of the line,

Extended Type: Line2D

() : unit
Returns: Pt

this.Mid

Full Usage: this.Mid

Returns: Pt
Modifiers: inline

Returns the midpoint of the line,

Extended Type: Line2D

Returns: Pt

this.Move

Full Usage: this.Move

Parameters:
Returns: Line2D
Modifiers: inline

Returns a Line2D moved by a vector.

Extended Type: Line2D

v : Vc
Returns: Line2D

this.MoveX

Full Usage: this.MoveX

Parameters:
    distance : float

Returns: Line2D
Modifiers: inline

Returns a Line2D moved by a given distance in X direction.

Extended Type: Line2D

distance : float
Returns: Line2D

this.MoveY

Full Usage: this.MoveY

Parameters:
    distance : float

Returns: Line2D
Modifiers: inline

Returns a Line2D moved by a given distance in Y direction.

Extended Type: Line2D

distance : float
Returns: Line2D

this.Reversed

Full Usage: this.Reversed

Parameters:
    () : unit

Returns: Line2D
Modifiers: inline

Returns the Line2D reversed.

Extended Type: Line2D

() : unit
Returns: Line2D

this.Reversed

Full Usage: this.Reversed

Returns: Line2D
Modifiers: inline

Returns the Line2D reversed.

Extended Type: Line2D

Returns: Line2D

this.Segment

Full Usage: this.Segment

Parameters:
    a : float
    b : float

Returns: Line2D
Modifiers: inline

Returns a Line2D from point at Parameter a to point at Parameter b.

Extended Type: Line2D

a : float
b : float
Returns: Line2D

this.Shrink

Full Usage: this.Shrink

Parameters:
    distAtStart : float
    distAtEnd : float

Returns: Line2D
Modifiers: inline

Shrink 2D line by absolute amount at start and end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtStart : float
distAtEnd : float
Returns: Line2D

this.ShrinkEnd

Full Usage: this.ShrinkEnd

Parameters:
    distAtEnd : float

Returns: Line2D
Modifiers: inline

Shrink 2D line by absolute amount at end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtEnd : float
Returns: Line2D

this.ShrinkStart

Full Usage: this.ShrinkStart

Parameters:
    distAtStart : float

Returns: Line2D
Modifiers: inline

Shrink 2D line by absolute amount at start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtStart : float
Returns: Line2D

this.SubLine

Full Usage: this.SubLine

Parameters:
    start : float
    ende : float

Returns: Line2D
Modifiers: inline

Evaluate line at a given parameters (parameters 0.0 to 1.0 are on the line), Return a new line from evaluated points.

Extended Type: Line2D

start : float
ende : float
Returns: Line2D

Line2D.areCoincident a b

Full Usage: Line2D.areCoincident a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D lines are coincident within tolerance. This means that lines are parallel within 0.25 degrees and the distance of second start point to the first line is less than 1e-6.

Extended Type: Line2D

a : Line2D
b : Line2D
Returns: bool

Line2D.areParallel l ln

Full Usage: Line2D.areParallel l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D lines are parallel. Ignoring orientation. Calculates the Cross Product of the two line vectors. (= the area of the parallelogram) And checks if it is smaller than 1e-9 (NOTE: for very long lines a higher tolerance might be needed)

Extended Type: Line2D

l : Line2D
ln : Line2D
Returns: bool

Line2D.areParallelAndMatchOrientation l ln

Full Usage: Line2D.areParallelAndMatchOrientation l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D lines are parallel and orientated the same way. Calculates the Cross Product of the two line vectors. (= the area of the parallelogram) And checks if it is smaller than 1e-9 Then calculates the dot product and checks if it is positive. (NOTE: for very long lines a higher tolerance might be needed)

Extended Type: Line2D

l : Line2D
ln : Line2D
Returns: bool

Line2D.arePerpendicular l ln

Full Usage: Line2D.arePerpendicular l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D lines are perpendicular. Calculates the dot product and checks if it is smaller than 1e-9. (NOTE: for very long lines a higher tolerance might be needed)

Extended Type: Line2D

l : Line2D
ln : Line2D
Returns: bool

Line2D.areTouchingAny tol a b

Full Usage: Line2D.areTouchingAny tol a b

Parameters:
    tol : float - The tolerance for the distance between the end points.
    a : Line2D - The first line.
    b : Line2D - The second line.

Returns: int An integer value indicating the touching case: 0 if not touching, 1 if touching at End of A and Start of B, 2 if touching at Start of A and End of B, 3 if touching at Start of A and Start of B, 4 if touching at End of A and End of B

Checks if the two finite 2D lines are touching each other at any of end points within the given tolerance. This will also return found result if the lines are touching on both points.

Extended Type: Line2D

tol : float

The tolerance for the distance between the end points.

a : Line2D

The first line.

b : Line2D

The second line.

Returns: int

An integer value indicating the touching case: 0 if not touching, 1 if touching at End of A and Start of B, 2 if touching at Start of A and End of B, 3 if touching at Start of A and Start of B, 4 if touching at End of A and End of B

Line2D.areTouchingEither tol a b

Full Usage: Line2D.areTouchingEither tol a b

Parameters:
    tol : float - The tolerance for the distance between the end points.
    a : Line2D - The first line.
    b : Line2D - The second line.

Returns: int An integer value indicating the touching case: 0 if not touching, 1 if touching at End of A and Start of B, 2 if touching at Start of A and End of B, 3 if touching at Start of A and Start of B, 4 if touching at End of A and End of B, 5 if touching at both Start and End. Lines are identical and in same orientation. 6 if touching at both at the other Start or End. Lines are identical but in opposite orientation.

Checks if the two finite 2D lines are touching each other at exactly one of their end points within the given tolerance. This will return a separate case (5 or 6) if the lines are touching on both points.

Extended Type: Line2D

tol : float

The tolerance for the distance between the end points.

a : Line2D

The first line.

b : Line2D

The second line.

Returns: int

An integer value indicating the touching case: 0 if not touching, 1 if touching at End of A and Start of B, 2 if touching at Start of A and End of B, 3 if touching at Start of A and Start of B, 4 if touching at End of A and End of B, 5 if touching at both Start and End. Lines are identical and in same orientation. 6 if touching at both at the other Start or End. Lines are identical but in opposite orientation.

Line2D.closestParameter p ln

Full Usage: Line2D.closestParameter p ln

Parameters:
Returns: float
Modifiers: inline

Returns the parameter at which a point is closest to the (finite) line. The result is between 0.0 and 1.0.

Extended Type: Line2D

p : Pt
ln : Line2D
Returns: float

Line2D.closestParameterInfinite p ln

Full Usage: Line2D.closestParameterInfinite p ln

Parameters:
Returns: float
Modifiers: inline

Assumes Line2D to be infinite! Returns the parameter at which a point is closest to the infinite line. If it is smaller than 0.0 or bigger than 1.0 it is outside of the finite line.

Extended Type: Line2D

p : Pt
ln : Line2D
Returns: float

Line2D.closestPoint p ln

Full Usage: Line2D.closestPoint p ln

Parameters:
Returns: Pt
Modifiers: inline

Returns closest point on (finite) line.

Extended Type: Line2D

p : Pt
ln : Line2D
Returns: Pt

Line2D.closestPointInfinite p ln

Full Usage: Line2D.closestPointInfinite p ln

Parameters:
Returns: Pt
Modifiers: inline

Assumes Line2D to be infinite! Returns closest point on infinite line.

Extended Type: Line2D

p : Pt
ln : Line2D
Returns: Pt

Line2D.createFromPtAndVc (p, v)

Full Usage: Line2D.createFromPtAndVc (p, v)

Parameters:
Returns: Line2D
Modifiers: inline

Creates a line starting at given point and going to along the given vector.

Extended Type: Line2D

p : Pt
v : Vc
Returns: Line2D

Line2D.createFromVec v

Full Usage: Line2D.createFromVec v

Parameters:
Returns: Line2D
Modifiers: inline

Creates a line starting at World Origin and going to along the given vector.

Extended Type: Line2D

v : Vc
Returns: Line2D

Line2D.direction ln

Full Usage: Line2D.direction ln

Parameters:
Returns: Vc
Modifiers: inline

Same as Line2D.vector or Line2D.tangent. The returned vector has the same length as the Line2D.

Extended Type: Line2D

ln : Line2D
Returns: Vc

Line2D.distanceBetweenLines (lnA, lnB)

Full Usage: Line2D.distanceBetweenLines (lnA, lnB)

Parameters:
Returns: float
Modifiers: inline

Returns the distance between two finite 2D lines. For parallel lines the distance is calculate form the actual finit elements. (like in the other cases.) So it is maybe bigger than the parallel offset. For Coincident and intersecting lines it always returns 0.0 even if there is actually a distance less than 1e-6.

Extended Type: Line2D

lnA : Line2D
lnB : Line2D
Returns: float

Line2D.distanceSqFromPoint p ln

Full Usage: Line2D.distanceSqFromPoint p ln

Parameters:
Returns: float
Modifiers: inline

Returns the square distance from point to (finite) line.

Extended Type: Line2D

p : Pt
ln : Line2D
Returns: float

Line2D.distanceSqFromPointInfinite p ln

Full Usage: Line2D.distanceSqFromPointInfinite p ln

Parameters:
Returns: float
Modifiers: inline

Assumes Line2D to be infinite! Returns the square distance from point to infinite line.

Extended Type: Line2D

p : Pt
ln : Line2D
Returns: float

Line2D.distanceToPt p ln

Full Usage: Line2D.distanceToPt p ln

Parameters:
Returns: float
Modifiers: inline

Returns distance from point to (finite) line.

Extended Type: Line2D

p : Pt
ln : Line2D
Returns: float

Line2D.distanceToPtInfinite p ln

Full Usage: Line2D.distanceToPtInfinite p ln

Parameters:
Returns: float
Modifiers: inline

Assumes Line2D to be infinite! Returns distance from point to infinite line.

Extended Type: Line2D

p : Pt
ln : Line2D
Returns: float

Line2D.divide segments ln

Full Usage: Line2D.divide segments ln

Parameters:
Returns: Pt[]

Divides a 2D line into given amount of segments. Returns an array of 2D points of length: segment count + 1. Includes start and endpoint of line.

Extended Type: Line2D

segments : int
ln : Line2D
Returns: Pt[]

Line2D.divideEvery dist l

Full Usage: Line2D.divideEvery dist l

Parameters:
Returns: ResizeArray<Pt>

Divides a 2D line into segments of given length. Includes start and end point Adds end point only if there is a remainder bigger than 1% of the segment length.

Extended Type: Line2D

dist : float
l : Line2D
Returns: ResizeArray<Pt>

Line2D.divideInsideEvery dist l

Full Usage: Line2D.divideInsideEvery dist l

Parameters:
Returns: ResizeArray<Pt>

Divides a 2D line into segments of given length. Excludes start and end point Adds last div point before end only if there is a remainder bigger than 1% of the segment length.

Extended Type: Line2D

dist : float
l : Line2D
Returns: ResizeArray<Pt>

Line2D.divideMaxLength maxSegmentLength ln

Full Usage: Line2D.divideMaxLength maxSegmentLength ln

Parameters:
    maxSegmentLength : float
    ln : Line2D

Returns: Pt[]

Divides a 2D line into as few as segments as possible respecting the maximum segment length. Returned Array includes start and endpoint of line. The input maxSegmentLength is multiplied by factor 0.999999 of to avoid numerical errors. That means in an edge case there are fewer segments returned, not more.

Extended Type: Line2D

maxSegmentLength : float
ln : Line2D
Returns: Pt[]

Line2D.divideMinLength minSegmentLength ln

Full Usage: Line2D.divideMinLength minSegmentLength ln

Parameters:
    minSegmentLength : float
    ln : Line2D

Returns: Pt[]

Divides a 2D line into as many as segments as possible respecting the minimum segment length. Returned Array includes start and endpoint of line. The input minSegmentLength is multiplied by factor 1.000001 of to avoid numerical errors. That means in an edge case there are more segments returned, not fewer.

Extended Type: Line2D

minSegmentLength : float
ln : Line2D
Returns: Pt[]

Line2D.ende l

Full Usage: Line2D.ende l

Parameters:
Returns: Pt
Modifiers: inline

Returns the End point of the line. Same as Line2D.to'

Extended Type: Line2D

l : Line2D
Returns: Pt

Line2D.equals tol a b

Full Usage: Line2D.equals tol a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 2D-lines are equal within tolerance. Identical Lines in opposite directions are not considered equal. Use a tolerance of 0.0 to check for an exact match.

Extended Type: Line2D

tol : float
a : Line2D
b : Line2D
Returns: bool

Line2D.evaluateAt t ln

Full Usage: Line2D.evaluateAt t ln

Parameters:
Returns: Pt
Modifiers: inline

Evaluate line at a given parameter ( parameters 0.0 to 1.0 are on the line)

Extended Type: Line2D

t : float
ln : Line2D
Returns: Pt

Line2D.extend distAtStart distAtEnd ln

Full Usage: Line2D.extend distAtStart distAtEnd ln

Parameters:
    distAtStart : float
    distAtEnd : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Extend 2D line by absolute amount at start and end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtStart : float
distAtEnd : float
ln : Line2D
Returns: Line2D

Line2D.extendEnd distAtEnd ln

Full Usage: Line2D.extendEnd distAtEnd ln

Parameters:
    distAtEnd : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Extend 2D line by absolute amount at end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtEnd : float
ln : Line2D
Returns: Line2D

Line2D.extendEndRel relAtEnd ln

Full Usage: Line2D.extendEndRel relAtEnd ln

Parameters:
    relAtEnd : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Extend 2D line by relative amount at end. A relative amount of 0.5 extends the line by half its length. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

relAtEnd : float
ln : Line2D
Returns: Line2D

Line2D.extendRel relAtStart relAtEnd ln

Full Usage: Line2D.extendRel relAtStart relAtEnd ln

Parameters:
    relAtStart : float
    relAtEnd : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Extend 2D line by relative amount at start and end. A relative amount of 0.5 extends the line by half its length on each side. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

relAtStart : float
relAtEnd : float
ln : Line2D
Returns: Line2D

Line2D.extendStart distAtStart ln

Full Usage: Line2D.extendStart distAtStart ln

Parameters:
    distAtStart : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Extend 2D line by absolute amount at start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtStart : float
ln : Line2D
Returns: Line2D

Line2D.extendStartRel relAtStart ln

Full Usage: Line2D.extendStartRel relAtStart ln

Parameters:
    relAtStart : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Extend 2D line by relative amount at start. A relative amount of 0.5 extends the line by half its length. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

relAtStart : float
ln : Line2D
Returns: Line2D

Line2D.flip ln

Full Usage: Line2D.flip ln

Parameters:
Returns: Line2D
Modifiers: inline

Reverse or flip the Line2D (same as Line2D.reverse)

Extended Type: Line2D

ln : Line2D
Returns: Line2D

Line2D.from l

Full Usage: Line2D.from l

Parameters:
Returns: Pt
Modifiers: inline

Returns the Start point of the line. Same as Line2D.start.

Extended Type: Line2D

l : Line2D
Returns: Pt

Line2D.fromX l

Full Usage: Line2D.fromX l

Parameters:
Returns: float
Modifiers: inline

Returns the Start point's X coordinate of the line.

Extended Type: Line2D

l : Line2D
Returns: float

Line2D.fromY l

Full Usage: Line2D.fromY l

Parameters:
Returns: float
Modifiers: inline

Returns the Start point's Y coordinate of the line.

Extended Type: Line2D

l : Line2D
Returns: float

Line2D.intersection (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Full Usage: Line2D.intersection (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Parameters:
    lnA : Line2D - The first line.
    lnB : Line2D - The second line.
    relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>> - This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle the 'Parallel' or 'Coincident' union case is returned. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.
    coincidentTolerance : float - Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then the 'Coincident' union case is returned.
    tooShortTolerance : float - Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then the 'TooShort' union case is returned.

Returns: IntersectionKind * Pt * Pt
Modifiers: inline

Returns the intersection kind and the points at which two (finite) 2D Lines are intersecting or closest to each other. The returned points are on the respective lines. For parallel and coincident lines it still returns the two end points that are closest to each other or a point in the middle of their overlap. First point is on lnA, second point is on lnB. The possible result cases are: | Intersecting : The finite lines are intersecting each other in one point. | IntersectingEndsBoth: The finite lines are intersecting each other at one of their end or start points point. | IntersectingEndsFirst: The finite lines are intersecting. The first line is touching the second one with its end or start point. | IntersectingEndsSecond: The finite lines are intersecting. The second line is touching the first one with its end or start point. | Skew: (but only applicable for 3D lines) | Apart: The finite lines are not intersecting. At least one of the points of closets points would be outside of the range 0.0 and 1.0. The returned points still indicate where the finite lines are closest to each other. ------- Parallel and other special cases for finite lines: --------------- | Parallel : The finite lines are parallel. Within 0.25 degrees. The returned points are in the middle of their overlap, or the two end points that are closest to each other. | Overlapping The lines are coincident, overlapping and parallel within 0.25 degrees. The returned points are at start and end of overlap. | CoincidentApart: The lines are coincident, parallel within 0.25 degrees. But ends are apart. The returned points still indicate where the lines are closest to each other. | Continuation : The lines are coincident, parallel within 0.25 degrees. The ends are meeting in exactly one point. And Oriented the same way. The returned points indicate which ends these are. | ContinuationFlipped: The lines are coincident, parallel within 0.25 degrees. The ends are meeting in exactly one point. But orientation is flipped. The returned points indicate which ends these are. | Identical: The lines are identical, in orientation too with in 1e-6 tolerance. The returned points still indicate where the lines start and end. | IdenticalFlipped: The lines are identical. But orientation is flipped. The returned points still indicate where the lines start and end. ------------------------------Error Cases: ----------------------------- | TooShortA Input line A is shorter than the given minimum Length tolerance. The returned points are the middle of line A and the closets point to it on line B. | TooShortB Input line B is shorter than the given minimum Length tolerance. The returned points are the closets point to lineA from the middle of line B and the middle of line B. | TooShortBoth Both input lines are shorter than the given minimum Length tolerance. The returned points are in the middle of both lines.

Extended Type: Line2D

lnA : Line2D

The first line.

lnB : Line2D

The second line.

relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>>

This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle the 'Parallel' or 'Coincident' union case is returned. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.

coincidentTolerance : float

Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then the 'Coincident' union case is returned.

tooShortTolerance : float

Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then the 'TooShort' union case is returned.

Returns: IntersectionKind * Pt * Pt

Line2D.intersectionInfinite (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Full Usage: Line2D.intersectionInfinite (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Parameters:
    lnA : Line2D - The first line.
    lnB : Line2D - The second line.
    relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>> - This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle the 'Parallel' or 'Coincident' union case is returned. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.
    coincidentTolerance : float - Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then the 'Coincident' union case is returned.
    tooShortTolerance : float

Returns: IntersectionPoints2D An IntersectionPoints2D Discriminated Union with the following cases: Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then the 'TooShort' union case is returned. | Point of xPoint : Pnt The points of 2D intersection. | Parallel: The lines are parallel, within the given tolerance. | Coincident: The lines are coincident or maybe even identical. As infinite lines they have infinitely many points in common. | TooShort: One or both input lines is shorter than the given minimum Length tolerance.
Modifiers: inline

Gets the points at which two infinite 2D lines intersect. Or are closest to each other.

Extended Type: Line2D

lnA : Line2D

The first line.

lnB : Line2D

The second line.

relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>>

This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle the 'Parallel' or 'Coincident' union case is returned. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.

coincidentTolerance : float

Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then the 'Coincident' union case is returned.

tooShortTolerance : float
Returns: IntersectionPoints2D

An IntersectionPoints2D Discriminated Union with the following cases: Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then the 'TooShort' union case is returned. | Point of xPoint : Pnt The points of 2D intersection. | Parallel: The lines are parallel, within the given tolerance. | Coincident: The lines are coincident or maybe even identical. As infinite lines they have infinitely many points in common. | TooShort: One or both input lines is shorter than the given minimum Length tolerance.

Line2D.intersectionParam (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Full Usage: Line2D.intersectionParam (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Parameters:
    lnA : Line2D - The first line.
    lnB : Line2D - The second line.
    relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>> - This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle the 'Parallel' or 'Coincident' union case is returned. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.
    coincidentTolerance : float - Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then the 'Coincident' union case is returned.
    tooShortTolerance : float - Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then the 'TooShort' union case is returned.

Returns: IntersectionKind * float * float
Modifiers: inline

Returns the intersection kind and the parameters at which two (finite) 2D Lines intersect or are closest to each other. The returned parameters are both between 0.0 and 1.0. For parallel and coincident lines it still returns the two end points that are closest to each other or a point in the middle of their overlap. First parameter is on lnA, second parameter is on lnB. The possible result cases are: | Intersecting : The finite lines are intersecting each other in one point inside both lines. | IntersectingEndsBoth: The finite lines are intersecting each other at one of their end or start points point. | IntersectingEndsFirst: The finite lines are intersecting. The first line is touching the second one with its end or start point. | IntersectingEndsSecond: The finite lines are intersecting. The second line is touching the first one with its end or start point. | Skew: (only applicable for 3D lines) | Apart: The finite lines are not intersecting . At least one of the parameters of closets points would be outside of the range 0.0 and 1.0. The returned parameters still indicate where the finite lines are closest to each other. ------- Parallel and other special cases for finite lines: --------------- | Parallel : The finite lines are parallel. Within 0.25 degrees. The returned parameters are in the middle of their overlap, or the two end points that are closest to each other. | Overlapping The lines are coincident, overlapping and parallel within 0.25 degrees. The returned parameters are at start and end of overlap. | CoincidentApart: The lines are coincident, parallel within 0.25 degrees. But ends are apart. The returned parameters still indicate where the lines are closest to each other. | Continuation : The lines are coincident, parallel within 0.25 degrees. The ends are meeting in exactly one point. And Oriented the same way. The returned parameters indicate which ends these are. | ContinuationFlipped: The lines are coincident, parallel within 0.25 degrees. The ends are meeting in exactly one point. But orientation is flipped. The returned parameters indicate which ends these are. | Identical: The lines are identical, in orientation too with in 1e-6 tolerance. The returned parameters still indicate where the lines start and end. | IdenticalFlipped: The lines are identical. But orientation is flipped. The returned parameters still indicate where the lines start and end. ------------------------------Error Cases: ----------------------------- | TooShortA Input line A is shorter than the given minimum Length tolerance. The returned parameters are 0.5 for line A and the closets point to lineB from the middle of line A. | TooShortB Input line B is shorter than the given minimum Length tolerance. The returned parameters are the closets point to lineA from the middle of line B and 0.5 for line B. | TooShortBoth Both input lines are shorter than the given minimum Length tolerance. The returned parameters are 0.5 and 0.5 for both lines.

Extended Type: Line2D

lnA : Line2D

The first line.

lnB : Line2D

The second line.

relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>>

This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle the 'Parallel' or 'Coincident' union case is returned. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.

coincidentTolerance : float

Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then the 'Coincident' union case is returned.

tooShortTolerance : float

Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then the 'TooShort' union case is returned.

Returns: IntersectionKind * float * float

Line2D.intersectionParamInfinite (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Full Usage: Line2D.intersectionParamInfinite (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Parameters:
    lnA : Line2D - The first line.
    lnB : Line2D - The second line.
    relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>> - This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle the 'Parallel' or 'Coincident' union case is returned. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.
    coincidentTolerance : float - Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then the 'Coincident' union case is returned.
    tooShortTolerance : float - Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then the 'TooShort' union case is returned.

Returns: IntersectionParam An IntersectionParam Discriminated Union with the following cases: | TwoParam of twoParams : struct(float*float): The infinite lines are intersecting. They have each one point where they are intersecting each other. The tuple's order corresponds to the input order. | Parallel: The lines are parallel within 0.25 degrees. They have no points in common. | Coincident: The lines are coincident (or maybe even identical) . As infinite lines they have infinitely many points in common. They might still not have the same start and end points in their finit definition. | TooShort: One or both input lines is shorter than the given minimum Length tolerance.
Modifiers: inline

Intersects two infinite 2D lines.

Extended Type: Line2D

lnA : Line2D

The first line.

lnB : Line2D

The second line.

relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>>

This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle the 'Parallel' or 'Coincident' union case is returned. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.

coincidentTolerance : float

Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then the 'Coincident' union case is returned.

tooShortTolerance : float

Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then the 'TooShort' union case is returned.

Returns: IntersectionParam

An IntersectionParam Discriminated Union with the following cases: | TwoParam of twoParams : struct(float*float): The infinite lines are intersecting. They have each one point where they are intersecting each other. The tuple's order corresponds to the input order. | Parallel: The lines are parallel within 0.25 degrees. They have no points in common. | Coincident: The lines are coincident (or maybe even identical) . As infinite lines they have infinitely many points in common. They might still not have the same start and end points in their finit definition. | TooShort: One or both input lines is shorter than the given minimum Length tolerance.

Line2D.intersectionPoint (lnA, lnB)

Full Usage: Line2D.intersectionPoint (lnA, lnB)

Parameters:
Returns: Pt option

Returns the single points where these two finite lines actually intersect each other. Or None. Unless the coincident lines ar continuing each other and just touching in one point.

Extended Type: Line2D

lnA : Line2D
lnB : Line2D
Returns: Pt option

Line2D.intersectionPointInfinite (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Full Usage: Line2D.intersectionPointInfinite (lnA, lnB, relAngleDiscriminant, coincidentTolerance, tooShortTolerance)

Parameters:
    lnA : Line2D - The first line.
    lnB : Line2D - The second line.
    relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>> - This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle an EuclidException is raised. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.
    coincidentTolerance : float - Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then an EuclidException is raised.
    tooShortTolerance : float - Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then an EuclidException is raised.

Returns: Pt A single 2D point

Gets the single points where these two infinite 2D lines actually intersect each other. The returned point is on line A.

Extended Type: Line2D

lnA : Line2D

The first line.

lnB : Line2D

The second line.

relAngleDiscriminant : float<MeasureProduct<relAngDiscr, MeasureOne>>

This is an optional tolerance for the internally calculated relative Angle Discriminant. The default value is '0.00000952' this corresponds to approx 0.25 degree. Below this angle an EuclidException is raised. Use the module Euclid.UtilEuclid.RelAngleDiscriminant to set another tolerance here.

coincidentTolerance : float

Is an optional distance tolerance. 1e-6 by default. If parallel lines are closer than this, then an EuclidException is raised.

tooShortTolerance : float

Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then an EuclidException is raised.

Returns: Pt

A single 2D point

Line2D.isTiny tol l

Full Usage: Line2D.isTiny tol l

Parameters:
Returns: bool
Modifiers: inline

Check if line is shorter than tolerance. Or contains a NaN value

Extended Type: Line2D

tol : float
l : Line2D
Returns: bool

Line2D.isTinySq tol l

Full Usage: Line2D.isTinySq tol l

Parameters:
Returns: bool
Modifiers: inline

Check if line is shorter than squared tolerance. Or contains a NaN value

Extended Type: Line2D

tol : float
l : Line2D
Returns: bool

Line2D.isXAligned l

Full Usage: Line2D.isXAligned l

Parameters:
Returns: bool
Modifiers: inline

Checks if 2D line is parallel to the world X axis. Ignoring orientation. Tolerance is 1e-6. Fails on lines shorter than 1e-6.

Extended Type: Line2D

l : Line2D
Returns: bool

Line2D.isYAligned l

Full Usage: Line2D.isYAligned l

Parameters:
Returns: bool
Modifiers: inline

Checks if 2D line is parallel to the world Y axis. Ignoring orientation. Tolerance is 1e-6. Fails on lines shorter than 1e-6.

Extended Type: Line2D

l : Line2D
Returns: bool

Line2D.isZeroLength l

Full Usage: Line2D.isZeroLength l

Parameters:
Returns: bool
Modifiers: inline

Check if the line has same starting and ending point.

Extended Type: Line2D

l : Line2D
Returns: bool

Line2D.length l

Full Usage: Line2D.length l

Parameters:
Returns: float
Modifiers: inline

Returns the length of the line.

Extended Type: Line2D

l : Line2D
Returns: float

Line2D.lengthSq l

Full Usage: Line2D.lengthSq l

Parameters:
Returns: float
Modifiers: inline

Returns the square length of the line.

Extended Type: Line2D

l : Line2D
Returns: float

Line2D.lengthToPtOnLine line pt

Full Usage: Line2D.lengthToPtOnLine line pt

Parameters:
Returns: float
Modifiers: inline

Get distance from start of line to point projected onto line, may be negative.

Extended Type: Line2D

line : Line2D
pt : Pt
Returns: float

Line2D.matchOrientation orientationToMatch lineToFlip

Full Usage: Line2D.matchOrientation orientationToMatch lineToFlip

Parameters:
Returns: Line2D
Modifiers: inline

Ensure 2D line has a positive dot product with given orientation line.

Extended Type: Line2D

orientationToMatch : Line2D
lineToFlip : Line2D
Returns: Line2D

Line2D.matchUnitVcOrientation orientationToMatch lineToFlip

Full Usage: Line2D.matchUnitVcOrientation orientationToMatch lineToFlip

Parameters:
Returns: Line2D
Modifiers: inline

Ensure 2D line has a positive dot product with given orientation 2D vector.

Extended Type: Line2D

orientationToMatch : UnitVc
lineToFlip : Line2D
Returns: Line2D

Line2D.matchVcOrientation orientationToMatch lineToFlip

Full Usage: Line2D.matchVcOrientation orientationToMatch lineToFlip

Parameters:
    orientationToMatch : Vc
    lineToFlip : Line2D

Returns: Line2D
Modifiers: inline

Ensure 2D line has a positive dot product with given orientation 2D vector.

Extended Type: Line2D

orientationToMatch : Vc
lineToFlip : Line2D
Returns: Line2D

Line2D.matchesOrientation180 l ln

Full Usage: Line2D.matchesOrientation180 l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 2D lines is less than 180 degrees. Calculates the dot product of two 2D lines. Then checks if it is positive.

Extended Type: Line2D

l : Line2D
ln : Line2D
Returns: bool

Line2D.matchesOrientation90 l ln

Full Usage: Line2D.matchesOrientation90 l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 2D lines is less than 90 degrees. Calculates the dot product of the unit-vectors of the two 2D lines. Then checks if it is bigger than 0.707107 (cosine of 90 degrees).

Extended Type: Line2D

l : Line2D
ln : Line2D
Returns: bool

Line2D.mid ln

Full Usage: Line2D.mid ln

Parameters:
Returns: Pt
Modifiers: inline

Get point at center of line.

Extended Type: Line2D

ln : Line2D
Returns: Pt

Line2D.move v ln

Full Usage: Line2D.move v ln

Parameters:
Returns: Line2D
Modifiers: inline

Move a Line2D by a vector. (same as Line2D.translate)

Extended Type: Line2D

v : Vc
ln : Line2D
Returns: Line2D

Line2D.moveX distance ln

Full Usage: Line2D.moveX distance ln

Parameters:
    distance : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Returns a Line2D moved by a given distance in X direction.

Extended Type: Line2D

distance : float
ln : Line2D
Returns: Line2D

Line2D.moveY distance ln

Full Usage: Line2D.moveY distance ln

Parameters:
    distance : double
    ln : Line2D

Returns: Line2D
Modifiers: inline

Returns a Line2D moved by a given distance in Y direction.

Extended Type: Line2D

distance : double
ln : Line2D
Returns: Line2D

Line2D.notEquals tol a b

Full Usage: Line2D.notEquals tol a b

Parameters:
Returns: bool

Check if two 2D-lines are not equal within a given tolerance. Use a tolerance of 0.0 to check if the two 2D-lines are not exactly equal.

Extended Type: Line2D

tol : float
a : Line2D
b : Line2D
Returns: bool

Line2D.offset amount ln

Full Usage: Line2D.offset amount ln

Parameters:
Returns: Line2D

Offset line in XY-Plane to left side in line direction. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). If amount is 0.0 no offset is computed and the input line is returned.

Extended Type: Line2D

amount : float
ln : Line2D
Returns: Line2D

Line2D.pointAtDistance dist ln

Full Usage: Line2D.pointAtDistance dist ln

Parameters:
Returns: Pt
Modifiers: inline

Finds point at given distance from line start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

dist : float
ln : Line2D
Returns: Pt

Line2D.reverse ln

Full Usage: Line2D.reverse ln

Parameters:
Returns: Line2D
Modifiers: inline

Reverse or flip the Line2D (same as Line2D.flip)

Extended Type: Line2D

ln : Line2D
Returns: Line2D

Line2D.rotate r ln

Full Usage: Line2D.rotate r ln

Parameters:
Returns: Line2D
Modifiers: inline

Rotation a Line2D.

Extended Type: Line2D

r : Rotation2D
ln : Line2D
Returns: Line2D

Line2D.rotateWithCenter cen r ln

Full Usage: Line2D.rotateWithCenter cen r ln

Parameters:
Returns: Line2D
Modifiers: inline

Rotation a Line2D around a given Center.

Extended Type: Line2D

cen : Pt
r : Rotation2D
ln : Line2D
Returns: Line2D

Line2D.segment a b ln

Full Usage: Line2D.segment a b ln

Parameters:
    a : float
    b : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Returns new Line2D from point at Parameter a to point at Parameter b.

Extended Type: Line2D

a : float
b : float
ln : Line2D
Returns: Line2D

Line2D.setEnd pt ln

Full Usage: Line2D.setEnd pt ln

Parameters:
Returns: Line2D
Modifiers: inline

Set Line2D end point, returns a new line.

Extended Type: Line2D

pt : Pt
ln : Line2D
Returns: Line2D

Line2D.setStart pt ln

Full Usage: Line2D.setStart pt ln

Parameters:
Returns: Line2D
Modifiers: inline

Set Line2D start point, returns a new line.

Extended Type: Line2D

pt : Pt
ln : Line2D
Returns: Line2D

Line2D.shrink distAtStart distAtEnd ln

Full Usage: Line2D.shrink distAtStart distAtEnd ln

Parameters:
    distAtStart : float
    distAtEnd : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Shrink 2D line by absolute amount at start and end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtStart : float
distAtEnd : float
ln : Line2D
Returns: Line2D

Line2D.shrinkEnd distAtEnd ln

Full Usage: Line2D.shrinkEnd distAtEnd ln

Parameters:
    distAtEnd : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Shrink 2D line by absolute amount at end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtEnd : float
ln : Line2D
Returns: Line2D

Line2D.shrinkStart distAtStart ln

Full Usage: Line2D.shrinkStart distAtStart ln

Parameters:
    distAtStart : float
    ln : Line2D

Returns: Line2D
Modifiers: inline

Shrink 2D line by absolute amount at start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

distAtStart : float
ln : Line2D
Returns: Line2D

Line2D.split gap segments ln

Full Usage: Line2D.split gap segments ln

Parameters:
    gap : float
    segments : int
    ln : Line2D

Returns: Line2D[]

Divides a 2D line into given amount of segments. Includes a gap between the segments. But not at the start or end. Returns an array of 2D Lines. Returns an empty array if the length of the line is less than gap-size x segment-count-minus-1.

Extended Type: Line2D

gap : float
segments : int
ln : Line2D
Returns: Line2D[]

Line2D.splitMaxLength gap maxSegmentLength ln

Full Usage: Line2D.splitMaxLength gap maxSegmentLength ln

Parameters:
    gap : float
    maxSegmentLength : float
    ln : Line2D

Returns: Line2D[]

Divides a 2D line into as few as segments as possible respecting the maximum segment length and the gap. Includes a gap between the segments. But not at the start or end. Returns an array of 2D Lines The input maxSegmentLength is multiplied by factor 0.999999 of to avoid numerical errors. That means in an edge case there are fewer segments returned, not more.

Extended Type: Line2D

gap : float
maxSegmentLength : float
ln : Line2D
Returns: Line2D[]

Line2D.splitMinLength gap minSegmentLength ln

Full Usage: Line2D.splitMinLength gap minSegmentLength ln

Parameters:
    gap : float
    minSegmentLength : float
    ln : Line2D

Returns: Line2D[]

Divides a 2D line into as many as segments as possible respecting the minimum segment length and the gap. Includes a gap between the segments. But not at the start or end. Returns an array of 2D Lines The input minSegmentLength is multiplied by factor 1.000001 of to avoid numerical errors. That means in an edge case there are more segments returned, not fewer.

Extended Type: Line2D

gap : float
minSegmentLength : float
ln : Line2D
Returns: Line2D[]

Line2D.start l

Full Usage: Line2D.start l

Parameters:
Returns: Pt
Modifiers: inline

Returns the Start point of the line. Same as Line2D.from.

Extended Type: Line2D

l : Line2D
Returns: Pt

Line2D.tangent ln

Full Usage: Line2D.tangent ln

Parameters:
Returns: Vc
Modifiers: inline

Same as Line2D.vector or Line2D.direction. The returned vector has the same length as the Line2D.

Extended Type: Line2D

ln : Line2D
Returns: Vc

Line2D.to' l

Full Usage: Line2D.to' l

Parameters:
Returns: Pt
Modifiers: inline

Returns the End point of the line. Same as Line2D.ende.

Extended Type: Line2D

l : Line2D
Returns: Pt

Line2D.toX l

Full Usage: Line2D.toX l

Parameters:
Returns: float
Modifiers: inline

Returns the End point's X coordinate of the line.

Extended Type: Line2D

l : Line2D
Returns: float

Line2D.toY l

Full Usage: Line2D.toY l

Parameters:
Returns: float
Modifiers: inline

Returns the End point's Y coordinate of the line.

Extended Type: Line2D

l : Line2D
Returns: float

Line2D.translate v ln

Full Usage: Line2D.translate v ln

Parameters:
Returns: Line2D
Modifiers: inline

Move a Line2D by a vector. (same as Line2D.move)

Extended Type: Line2D

v : Vc
ln : Line2D
Returns: Line2D

Line2D.unitTangent ln

Full Usage: Line2D.unitTangent ln

Parameters:
Returns: UnitVc
Modifiers: inline

Returns a unit-vector of the line Direction.

Extended Type: Line2D

ln : Line2D
Returns: UnitVc

Line2D.vector ln

Full Usage: Line2D.vector ln

Parameters:
Returns: Vc
Modifiers: inline

Same as Line2D.tangent or Line2D.direction. The returned vector has the same length as the Line2D.

Extended Type: Line2D

ln : Line2D
Returns: Vc

Line2D.withLengthFromMid len ln

Full Usage: Line2D.withLengthFromMid len ln

Parameters:
Returns: Line2D
Modifiers: inline

Returns new Line2D with given length. Fixed in the midpoint. Missing length is added to or subtracted from both the end and start of the line. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

len : float
ln : Line2D
Returns: Line2D

Line2D.withLengthFromStart len ln

Full Usage: Line2D.withLengthFromStart len ln

Parameters:
Returns: Line2D
Modifiers: inline

Returns new Line2D with given length, going out from start in direction of end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

len : float
ln : Line2D
Returns: Line2D

Line2D.withLengthToEnd len ln

Full Usage: Line2D.withLengthToEnd len ln

Parameters:
Returns: Line2D
Modifiers: inline

Returns new Line2D ending at current LineEnd with given length coming from direction of start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line2D

len : float
ln : Line2D
Returns: Line2D

Type something to start searching.