Logo Euclid

XLine2D Type

A type containing only static member functions for computing 2D line intersections. Some functions return Discriminated Unions from the XLine2D module.

Static members

Static member Description

XLine2D.closestParameters (lineA, lineB)

Full Usage: XLine2D.closestParameters (lineA, lineB)

Parameters:
    lineA : Line2D - First line.
    lineB : Line2D - Second line.

Returns: float * float A (t,u) tuple where t is the parameter on line A and u on line B at their closest points.

Gets the parameters on the finite lines where the lines are closest to each other. For parallel or overlapping lines, there are many solutions, The parameter pair closest to 0.0 on line A is returned.

lineA : Line2D

First line.

lineB : Line2D

Second line.

Returns: float * float

A (t,u) tuple where t is the parameter on line A and u on line B at their closest points.

XLine2D.closestParameters (pA, pB, vA, vB)

Full Usage: XLine2D.closestParameters (pA, pB, vA, vB)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.

Returns: float * float A (t,u) tuple where t is the parameter on line A and u on line B at their closest points.

Gets the parameters on the finite lines where the lines are closest to each other. For parallel or overlapping lines, there are many solutions, The parameter pair closest to 0.0 on line A is returned.

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

Returns: float * float

A (t,u) tuple where t is the parameter on line A and u on line B at their closest points.

XLine2D.doIntersect (lineA, lineB)

Full Usage: XLine2D.doIntersect (lineA, lineB)

Parameters:
    lineA : Line2D - First line.
    lineB : Line2D - Second line.

Returns: bool TRUE if both lines have an intersection parameter in the range 0.0 to 1.0 (with 1e-6 tolerance). FALSE if the lines are parallel, coincident or at least one intersection parameter is outside of the range.
Modifiers: inline

Checks if two 2D-lines intersect within the parameter range 0.0 to 1.0 (with 1e-6 tolerance) on both lines.

This does not check for an explicit angle tolerance, so overlapping almost parallel lines may return TRUE.

lineA : Line2D

First line.

lineB : Line2D

Second line.

Returns: bool

TRUE if both lines have an intersection parameter in the range 0.0 to 1.0 (with 1e-6 tolerance). FALSE if the lines are parallel, coincident or at least one intersection parameter is outside of the range.

XLine2D.doIntersect (pA, pB, vA, vB)

Full Usage: XLine2D.doIntersect (pA, pB, vA, vB)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.

Returns: bool TRUE if both lines have an intersection parameter in the range 0.0 to 1.0 (with 1e-6 tolerance). FALSE if the lines are parallel, coincident or at least one intersection parameter is outside of the range.
Modifiers: inline

Checks if two 2D-lines intersect within the parameter range 0.0 to 1.0 (with 1e-6 tolerance) on both lines.

This does not check for an explicit angle tolerance, so overlapping almost parallel lines may return TRUE.

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

Returns: bool

TRUE if both lines have an intersection parameter in the range 0.0 to 1.0 (with 1e-6 tolerance). FALSE if the lines are parallel, coincident or at least one intersection parameter is outside of the range.

XLine2D.doOverlap (lineA, lineB, ?tolerance)

Full Usage: XLine2D.doOverlap (lineA, lineB, ?tolerance)

Parameters:
    lineA : Line2D - The first line.
    lineB : Line2D - The second line.
    ?tolerance : float - Is an optional distance tolerance (compared against the squared distance internally). 1e-6 by default. Used for checking if the distance between parallel lines is less than this value.

Returns: bool
Modifiers: inline

Checks if 2D lines are not only parallel and coincident but are also overlapping or at least touching at their ends.

lineA : Line2D

The first line.

lineB : Line2D

The second line.

?tolerance : float

Is an optional distance tolerance (compared against the squared distance internally). 1e-6 by default. Used for checking if the distance between parallel lines is less than this value.

Returns: bool

XLine2D.doOverlap (pA, pB, vA, vB, ?tolerance)

Full Usage: XLine2D.doOverlap (pA, pB, vA, vB, ?tolerance)

Parameters:
    pA : Pt - The start point on the first line.
    pB : Pt - The start point on the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.
    ?tolerance : float - Is an optional distance tolerance (compared against the squared distance internally). 1e-6 by default. Used for checking if the distance between parallel lines is less than this value.

Returns: bool
Modifiers: inline

Checks if 2D lines are not only parallel and coincident but are also overlapping or at least touching at their ends.

pA : Pt

The start point on the first line.

pB : Pt

The start point on the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

?tolerance : float

Is an optional distance tolerance (compared against the squared distance internally). 1e-6 by default. Used for checking if the distance between parallel lines is less than this value.

Returns: bool

XLine2D.getClosestParameters (lineA, lineB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getClosestParameters (lineA, lineB, ?tangent, ?tooShortTolerance)

Parameters:
    lineA : Line2D - The first finite line segment.
    lineB : Line2D - The second finite line segment.
    ?tangent : MeasureProduct<tangent, MeasureOne> - This is an optional tolerance for considering lines parallel. This is a precomputed tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this the middle point of any overlapping segment is returned. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?tooShortTolerance : float - Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then a 'TooShort' union case is returned.

Returns: ClParams A ClParams Discriminated Union with the following cases: | Intersect of float*float | Apart of parameterA:float * parameterB:float * squareDistance:float | Parallel of float*float | TooShortA | TooShortB | TooShortBoth
Modifiers: inline

Gets the parameters on the finite lines where the lines are closest to each other. For parallel or coincident lines, this returns the midpoint of the interval spanned by the projected endpoints (which coincides with the middle of any overlapping segment when one exists).

lineA : Line2D

The first finite line segment.

lineB : Line2D

The second finite line segment.

?tangent : MeasureProduct<tangent, MeasureOne>

This is an optional tolerance for considering lines parallel. This is a precomputed tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this the middle point of any overlapping segment is returned. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?tooShortTolerance : float

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

Returns: ClParams

A ClParams Discriminated Union with the following cases: | Intersect of float*float | Apart of parameterA:float * parameterB:float * squareDistance:float | Parallel of float*float | TooShortA | TooShortB | TooShortBoth

XLine2D.getClosestParameters (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getClosestParameters (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Parameters:
    pA : Pt - The start point on the first line.
    pB : Pt - The start point on the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.
    ?tangent : MeasureProduct<tangent, MeasureOne> - This is an optional tolerance for considering lines parallel. This is a precomputed tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this the middle point of any overlapping segment is returned. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?tooShortTolerance : float - Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then a 'TooShort' union case is returned.

Returns: ClParams A ClParams Discriminated Union with the following cases: | Intersect of float*float | Apart of parameterA:float * parameterB:float * squareDistance:float | Parallel of float*float | TooShortA | TooShortB | TooShortBoth
Modifiers: inline

Gets the parameters on the finite lines where the lines are closest to each other. For parallel or coincident lines, this returns the midpoint of the interval spanned by the projected endpoints (which coincides with the middle of any overlapping segment when one exists).

pA : Pt

The start point on the first line.

pB : Pt

The start point on the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

?tangent : MeasureProduct<tangent, MeasureOne>

This is an optional tolerance for considering lines parallel. This is a precomputed tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this the middle point of any overlapping segment is returned. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?tooShortTolerance : float

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

Returns: ClParams

A ClParams Discriminated Union with the following cases: | Intersect of float*float | Apart of parameterA:float * parameterB:float * squareDistance:float | Parallel of float*float | TooShortA | TooShortB | TooShortBoth

XLine2D.getClosestPoints (lineA, lineB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getClosestPoints (lineA, lineB, ?tangent, ?tooShortTolerance)

Parameters:
    lineA : Line2D - The first line.
    lineB : Line2D - The second line.
    ?tangent : MeasureProduct<tangent, MeasureOne> - This is an optional tolerance for considering lines parallel. This is a precomputed tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this the middle point of any overlapping segment is returned. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: ClPts A ClPts Discriminated Union with the following cases: | Intersect of Pt | Apart of Pt * Pt * squareDistance:float | Parallel of Pt * Pt | TooShortA | TooShortB | TooShortBoth
Modifiers: inline

Gets the point or points on the finite lines where the lines are closest to each other. For parallel or coincident lines, this returns the midpoint of the interval spanned by the projected endpoints (matching the middle of the overlapping segment when one exists).

This method uses a small tolerance of 1e-6 to account for numerical inaccuracies when checking the 0..1 range.

lineA : Line2D

The first line.

lineB : Line2D

The second line.

?tangent : MeasureProduct<tangent, MeasureOne>

This is an optional tolerance for considering lines parallel. This is a precomputed tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this the middle point of any overlapping segment is returned. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: ClPts

A ClPts Discriminated Union with the following cases: | Intersect of Pt | Apart of Pt * Pt * squareDistance:float | Parallel of Pt * Pt | TooShortA | TooShortB | TooShortBoth

XLine2D.getClosestPoints (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getClosestPoints (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Parameters:
    pA : Pt - The start point on the first line.
    pB : Pt - The start point on the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.
    ?tangent : MeasureProduct<tangent, MeasureOne> - This is an optional tolerance for considering lines parallel. This is a precomputed tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this the middle point of any overlapping segment is returned. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: ClPts A ClPts Discriminated Union with the following cases: | Intersect of Pt | Apart of Pt * Pt * squareDistance:float | Parallel of Pt * Pt | TooShortA | TooShortB | TooShortBoth
Modifiers: inline

Gets the point or points on the finite lines where the lines are closest to each other. For parallel or coincident lines, this returns the midpoint of the interval spanned by the projected endpoints (matching the middle of the overlapping segment when one exists).

This method uses a small tolerance of 1e-6 to account for numerical inaccuracies when checking the 0..1 range.

pA : Pt

The start point on the first line.

pB : Pt

The start point on the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

?tangent : MeasureProduct<tangent, MeasureOne>

This is an optional tolerance for considering lines parallel. This is a precomputed tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this the middle point of any overlapping segment is returned. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: ClPts

A ClPts Discriminated Union with the following cases: | Intersect of Pt | Apart of Pt * Pt * squareDistance:float | Parallel of Pt * Pt | TooShortA | TooShortB | TooShortBoth

XLine2D.getEndsTouching (a, b, ?tolerance)

Full Usage: XLine2D.getEndsTouching (a, b, ?tolerance)

Parameters:
    a : Line2D - The first line.
    b : Line2D - The second line.
    ?tolerance : float - Is an optional distance tolerance. 1e-6 by default.

Returns: XEnds A Discriminated Union Line2D.XEnds that describes the possible cases of two finite 2D lines touching at their ends: | NotTouching | StartA_StartB | EndA_EndB | EndA_StartB | StartA_EndB | Identical | IdenticalFlipped

Checks if the two finite 2D lines are touching each other at exactly one of their end points within the given tolerance.

a : Line2D

The first line.

b : Line2D

The second line.

?tolerance : float

Is an optional distance tolerance. 1e-6 by default.

Returns: XEnds

A Discriminated Union Line2D.XEnds that describes the possible cases of two finite 2D lines touching at their ends: | NotTouching | StartA_StartB | EndA_EndB | EndA_StartB | StartA_EndB | Identical | IdenticalFlipped

XLine2D.getIntersection (lineA, lineB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getIntersection (lineA, lineB, ?tangent, ?tooShortTolerance)

Parameters:
    lineA : Line2D - First finite line segment.
    lineB : Line2D - Second finite line segment.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: XPt An XPt Discriminated Union with the following cases: | Intersect of Pt | Parallel | TooShortBoth | TooShortA | TooShortB
Modifiers: inline

Tries to get intersection point of two finite 2D lines.

lineA : Line2D

First finite line segment.

lineB : Line2D

Second finite line segment.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: XPt

An XPt Discriminated Union with the following cases: | Intersect of Pt | Parallel | TooShortBoth | TooShortA | TooShortB

XLine2D.getIntersection (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getIntersection (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: XPt An XPt Discriminated Union with the following cases: | Intersect of Pt | Parallel | TooShortBoth | TooShortA | TooShortB
Modifiers: inline

Tries to get intersection point of two finite 2D lines.

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: XPt

An XPt Discriminated Union with the following cases: | Intersect of Pt | Parallel | TooShortBoth | TooShortA | TooShortB

XLine2D.getIntersectionParam (lnA, lnB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getIntersectionParam (lnA, lnB, ?tangent, ?tooShortTolerance)

Parameters:
    lnA : Line2D - First line.
    lnB : Line2D - Second line.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: XParam An XParam Discriminated Union with the following cases: | Intersect of float*float | Parallel | TooShortBoth | TooShortA | TooShortB
Modifiers: inline

Tries to get intersection parameters of two finite 2D-lines.

lnA : Line2D

First line.

lnB : Line2D

Second line.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: XParam

An XParam Discriminated Union with the following cases: | Intersect of float*float | Parallel | TooShortBoth | TooShortA | TooShortB

XLine2D.getIntersectionParam (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getIntersectionParam (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: XParam An XParam Discriminated Union with the following cases: | Intersect of float*float | Parallel | TooShortBoth | TooShortA | TooShortB
Modifiers: inline

Tries to get intersection parameters of two finite 2D-lines.

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: XParam

An XParam Discriminated Union with the following cases: | Intersect of float*float | Parallel | TooShortBoth | TooShortA | TooShortB

XLine2D.getRayIntersection (lineA, lineB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getRayIntersection (lineA, lineB, ?tangent, ?tooShortTolerance)

Parameters:
    lineA : Line2D - First ray.
    lineB : Line2D - Second ray.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: XRay An XRay Discriminated Union with the following cases: | Intersect of Pt | Parallel | TooShortBoth | TooShortA | TooShortB
Modifiers: inline

Tries to get intersection point of two rays (rays are 2D lines extended infinitely).

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: XRay

An XRay Discriminated Union with the following cases: | Intersect of Pt | Parallel | TooShortBoth | TooShortA | TooShortB

XLine2D.getRayIntersection (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getRayIntersection (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Parameters:
    pA : Pt - The start point of the first ray.
    pB : Pt - The start point of the second ray.
    vA : Vc - The direction vector of the first ray.
    vB : Vc - The direction vector of the second ray.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: XRay An XRay Discriminated Union with the following cases: | Intersect of Pt | Parallel | TooShortBoth | TooShortA | TooShortB
Modifiers: inline

Tries to get intersection point of two rays (rays are 2D lines extended infinitely).

pA : Pt

The start point of the first ray.

pB : Pt

The start point of the second ray.

vA : Vc

The direction vector of the first ray.

vB : Vc

The direction vector of the second ray.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: XRay

An XRay Discriminated Union with the following cases: | Intersect of Pt | Parallel | TooShortBoth | TooShortA | TooShortB

XLine2D.getRayIntersectionParam (lineA, lineB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getRayIntersectionParam (lineA, lineB, ?tangent, ?tooShortTolerance)

Parameters:
    lineA : Line2D - First ray.
    lineB : Line2D - Second ray.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?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: XRayParam An XRayParam discriminated union with the following cases: | Intersect of float*float | Parallel | TooShortA | TooShortB | TooShortBoth
Modifiers: inline

Tries to get intersection parameters of two rays (rays are 2D lines extended infinitely).

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?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: XRayParam

An XRayParam discriminated union with the following cases: | Intersect of float*float | Parallel | TooShortA | TooShortB | TooShortBoth

XLine2D.getRayIntersectionParam (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.getRayIntersectionParam (pA, pB, vA, vB, ?tangent, ?tooShortTolerance)

Parameters:
    pA : Pt - The start point of the first ray.
    pB : Pt - The start point of the second ray.
    vA : Vc - The direction vector of the first ray.
    vB : Vc - The direction vector of the second ray.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
    ?tooShortTolerance : float - Is an optional length tolerance. 1e-6 by default. If one or both lines are shorter than this, then a 'TooShort' union case is returned.

Returns: XRayParam An XRayParam discriminated union with the following cases: | Intersect of float*float | Parallel | TooShortA | TooShortB | TooShortBoth
Modifiers: inline

Tries to get intersection parameters of two rays (rays are 2D lines extended infinitely).

pA : Pt

The start point of the first ray.

pB : Pt

The start point of the second ray.

vA : Vc

The direction vector of the first ray.

vB : Vc

The direction vector of the second ray.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

?tooShortTolerance : float

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

Returns: XRayParam

An XRayParam discriminated union with the following cases: | Intersect of float*float | Parallel | TooShortA | TooShortB | TooShortBoth

XLine2D.getSqDistance (lineA, lineB)

Full Usage: XLine2D.getSqDistance (lineA, lineB)

Parameters:
    lineA : Line2D - The first line.
    lineB : Line2D - The second line.

Returns: float The squared distance between the two lines.
Modifiers: inline

Gets the square distance between two finite lines. Works on Parallel lines too.

lineA : Line2D

The first line.

lineB : Line2D

The second line.

Returns: float

The squared distance between the two lines.

XLine2D.getSqDistance (pA, pB, vA, vB)

Full Usage: XLine2D.getSqDistance (pA, pB, vA, vB)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.

Returns: float The squared distance between the two lines.
Modifiers: inline

Gets the square distance between two finite lines. Works on Parallel lines too.

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

Returns: float

The squared distance between the two lines.

XLine2D.intersectRays (lineA, lineB)

Full Usage: XLine2D.intersectRays (lineA, lineB)

Parameters:
Returns: Pt The intersection point of the two rays.
Modifiers: inline

Intersects two infinite 2D lines. Fails if they are parallel or zero length.

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

Returns: Pt

The intersection point of the two rays.

XLine2D.intersectRays (pA, pB, vA, vB)

Full Usage: XLine2D.intersectRays (pA, pB, vA, vB)

Parameters:
    pA : Pt - The start point of the first ray.
    pB : Pt - The start point of the second ray.
    vA : Vc - The direction vector of the first ray.
    vB : Vc - The direction vector of the second ray.

Returns: Pt The intersection point of the two rays.
Modifiers: inline

Intersects two infinite 2D lines. Fails if they are parallel or zero length.

pA : Pt

The start point of the first ray.

pB : Pt

The start point of the second ray.

vA : Vc

The direction vector of the first ray.

vB : Vc

The direction vector of the second ray.

Returns: Pt

The intersection point of the two rays.

XLine2D.isWithinRanges (lineA, lineB, minParameterA, maxParameterA, minParameterB, maxParameterB)

Full Usage: XLine2D.isWithinRanges (lineA, lineB, minParameterA, maxParameterA, minParameterB, maxParameterB)

Parameters:
    lineA : Line2D - First line.
    lineB : Line2D - Second line.
    minParameterA : float - The minimum parameter value of the range, inclusive.
    maxParameterA : float - The maximum parameter value of the range, inclusive.
    minParameterB : float - The minimum parameter value of the range, inclusive.
    maxParameterB : float - The maximum parameter value of the range, inclusive.

Returns: bool TRUE if both lines have an intersection parameter in the range (inclusive min and max value). FALSE if the lines are parallel, coincident or at least one intersection parameter is outside of the range.
Modifiers: inline

Checks if two 2D-lines both have intersection parameters within the given ranges for each line

lineA : Line2D

First line.

lineB : Line2D

Second line.

minParameterA : float

The minimum parameter value of the range, inclusive.

maxParameterA : float

The maximum parameter value of the range, inclusive.

minParameterB : float

The minimum parameter value of the range, inclusive.

maxParameterB : float

The maximum parameter value of the range, inclusive.

Returns: bool

TRUE if both lines have an intersection parameter in the range (inclusive min and max value). FALSE if the lines are parallel, coincident or at least one intersection parameter is outside of the range.

XLine2D.isWithinRanges (pA, pB, vA, vB, minParameterA, maxParameterA, minParameterB, maxParameterB)

Full Usage: XLine2D.isWithinRanges (pA, pB, vA, vB, minParameterA, maxParameterA, minParameterB, maxParameterB)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.
    minParameterA : float - The minimum parameter value of the range, inclusive.
    maxParameterA : float - The maximum parameter value of the range, inclusive.
    minParameterB : float - The minimum parameter value of the range, inclusive.
    maxParameterB : float - The maximum parameter value of the range, inclusive.

Returns: bool TRUE if both lines have an intersection parameter in the range (inclusive min and max value). FALSE if the lines are parallel, coincident or at least one intersection parameter is outside of the range.
Modifiers: inline

Checks if two 2D-lines both have intersection parameters within the given ranges for each line

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

minParameterA : float

The minimum parameter value of the range, inclusive.

maxParameterA : float

The maximum parameter value of the range, inclusive.

minParameterB : float

The minimum parameter value of the range, inclusive.

maxParameterB : float

The maximum parameter value of the range, inclusive.

Returns: bool

TRUE if both lines have an intersection parameter in the range (inclusive min and max value). FALSE if the lines are parallel, coincident or at least one intersection parameter is outside of the range.

XLine2D.parameterA (lineA, lineB)

Full Usage: XLine2D.parameterA (lineA, lineB)

Parameters:
Returns: float The parameter on lineA at the intersection with lineB. NaN if both start points coincide and vectors are exactly parallel (0.0/0.0). Positive/Negative Infinity for almost parallel lines.
Modifiers: inline

Returns the intersection parameter on the first ray (A) where ray A and ray B intersect. Returns NaN or Infinity for zero length or parallel lines.

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

Returns: float

The parameter on lineA at the intersection with lineB. NaN if both start points coincide and vectors are exactly parallel (0.0/0.0). Positive/Negative Infinity for almost parallel lines.

XLine2D.parameterA (pA, pB, vA, vB)

Full Usage: XLine2D.parameterA (pA, pB, vA, vB)

Parameters:
    pA : Pt - The start point of the first ray.
    pB : Pt - The start point of the second ray.
    vA : Vc - The direction vector of the first ray.
    vB : Vc - The direction vector of the second ray.

Returns: float The parameter on line A at the intersection with line B. NaN if both points coincide and vectors are exactly parallel (0.0/0.0). Positive/Negative Infinity for almost parallel lines.
Modifiers: inline

Returns the intersection parameter on the first ray (A) where ray A and ray B intersect. Returns NaN or Infinity for zero length or parallel lines.

pA : Pt

The start point of the first ray.

pB : Pt

The start point of the second ray.

vA : Vc

The direction vector of the first ray.

vB : Vc

The direction vector of the second ray.

Returns: float

The parameter on line A at the intersection with line B. NaN if both points coincide and vectors are exactly parallel (0.0/0.0). Positive/Negative Infinity for almost parallel lines.

XLine2D.parameters (lineA, lineB)

Full Usage: XLine2D.parameters (lineA, lineB)

Parameters:
Returns: float * float A (t,u) tuple where t is the parameter on line A and u on line B at their intersection. These are NaN if A and B points are identical and the vectors are exactly parallel (zero divided by zero). These are positive or negative Infinity for almost parallel lines.
Modifiers: inline

Returns the intersection parameters on both rays. Returns NaN or Infinity for zero length or parallel lines.

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

Returns: float * float

A (t,u) tuple where t is the parameter on line A and u on line B at their intersection. These are NaN if A and B points are identical and the vectors are exactly parallel (zero divided by zero). These are positive or negative Infinity for almost parallel lines.

XLine2D.parameters (pA, pB, vA, vB)

Full Usage: XLine2D.parameters (pA, pB, vA, vB)

Parameters:
    pA : Pt - The start point of the first ray.
    pB : Pt - The start point of the second ray.
    vA : Vc - The direction vector of the first ray.
    vB : Vc - The direction vector of the second ray.

Returns: float * float A (t,u) tuple where t is the parameter on line A and u on line B at their intersection. These are NaN if A and B points are identical and the vectors are exactly parallel (zero divided by zero). These are positive or negative Infinity for almost parallel lines.
Modifiers: inline

Returns the intersection parameters on both rays A and B. Returns NaN or Infinity for zero length or parallel lines.

pA : Pt

The start point of the first ray.

pB : Pt

The start point of the second ray.

vA : Vc

The direction vector of the first ray.

vB : Vc

The direction vector of the second ray.

Returns: float * float

A (t,u) tuple where t is the parameter on line A and u on line B at their intersection. These are NaN if A and B points are identical and the vectors are exactly parallel (zero divided by zero). These are positive or negative Infinity for almost parallel lines.

XLine2D.tryIntersect (lineA, lineB)

Full Usage: XLine2D.tryIntersect (lineA, lineB)

Parameters:
    lineA : Line2D - First finite line segment.
    lineB : Line2D - Second finite line segment.

Returns: Pt voption The intersection point if both parameters are within 0.0 to 1.0; ValueNone otherwise or if parallel/coincident.
Modifiers: inline

Returns the intersection point of two finite line segments if they intersect.

This method uses a small tolerance of 1e-6 to account for numerical inaccuracies when checking the 0..1 range.

lineA : Line2D

First finite line segment.

lineB : Line2D

Second finite line segment.

Returns: Pt voption

The intersection point if both parameters are within 0.0 to 1.0; ValueNone otherwise or if parallel/coincident.

XLine2D.tryIntersect (pA, pB, vA, vB)

Full Usage: XLine2D.tryIntersect (pA, pB, vA, vB)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - Vector from pA to the other end of line A (its length defines the domain 0..1).
    vB : Vc - Vector from pB to the other end of line B (its length defines the domain 0..1).

Returns: Pt voption The intersection point if both parameters are within 0.0 to 1.0; ValueNone otherwise or if parallel/coincident.
Modifiers: inline

Returns the intersection point of two finite line segments if they intersect.

This method uses a small tolerance of 1e-6 to account for numerical inaccuracies when checking the 0..1 range.

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

Vector from pA to the other end of line A (its length defines the domain 0..1).

vB : Vc

Vector from pB to the other end of line B (its length defines the domain 0..1).

Returns: Pt voption

The intersection point if both parameters are within 0.0 to 1.0; ValueNone otherwise or if parallel/coincident.

XLine2D.tryIntersectInRangeA (lineA, lineB, minParameterA, maxParameterA)

Full Usage: XLine2D.tryIntersectInRangeA (lineA, lineB, minParameterA, maxParameterA)

Parameters:
    lineA : Line2D - First line.
    lineB : Line2D - Second line.
    minParameterA : float - The minimum parameter value of the range, inclusive.
    maxParameterA : float - The maximum parameter value of the range, inclusive.

Returns: Pt voption A point if lineA has an intersection parameter in the range (inclusive min and max value). ValueNone if the lines are parallel, coincident or the intersection parameter is outside of the range.
Modifiers: inline

Returns the intersection point of two rays if it is within the given parameter range for line A.

lineA : Line2D

First line.

lineB : Line2D

Second line.

minParameterA : float

The minimum parameter value of the range, inclusive.

maxParameterA : float

The maximum parameter value of the range, inclusive.

Returns: Pt voption

A point if lineA has an intersection parameter in the range (inclusive min and max value). ValueNone if the lines are parallel, coincident or the intersection parameter is outside of the range.

XLine2D.tryIntersectInRangeA (pA, pB, vA, vB, minParameterA, maxParameterA)

Full Usage: XLine2D.tryIntersectInRangeA (pA, pB, vA, vB, minParameterA, maxParameterA)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.
    minParameterA : float - The minimum parameter value of the range, inclusive.
    maxParameterA : float - The maximum parameter value of the range, inclusive.

Returns: Pt voption A point if lineA has an intersection parameter in the range (inclusive min and max value). ValueNone if the lines are parallel, coincident or the intersection parameter is outside of the range.
Modifiers: inline

Returns the intersection point of two rays if it is within the given parameter range for line A.

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

minParameterA : float

The minimum parameter value of the range, inclusive.

maxParameterA : float

The maximum parameter value of the range, inclusive.

Returns: Pt voption

A point if lineA has an intersection parameter in the range (inclusive min and max value). ValueNone if the lines are parallel, coincident or the intersection parameter is outside of the range.

XLine2D.tryIntersectInRanges (lineA, lineB, minParameterA, maxParameterA, minParameterB, maxParameterB)

Full Usage: XLine2D.tryIntersectInRanges (lineA, lineB, minParameterA, maxParameterA, minParameterB, maxParameterB)

Parameters:
    lineA : Line2D - First line.
    lineB : Line2D - Second line.
    minParameterA : float - The minimum parameter value of the range, inclusive.
    maxParameterA : float - The maximum parameter value of the range, inclusive.
    minParameterB : float - The minimum parameter value of the range, inclusive.
    maxParameterB : float - The maximum parameter value of the range, inclusive.

Returns: Pt voption A point if both lines have an intersection parameter in the range (inclusive min and max value). ValueNone if the lines are parallel, coincident or at least one intersection parameter is outside of the range.
Modifiers: inline

Returns the intersection point of two rays if it is within the given parameter ranges for line A and line B.

lineA : Line2D

First line.

lineB : Line2D

Second line.

minParameterA : float

The minimum parameter value of the range, inclusive.

maxParameterA : float

The maximum parameter value of the range, inclusive.

minParameterB : float

The minimum parameter value of the range, inclusive.

maxParameterB : float

The maximum parameter value of the range, inclusive.

Returns: Pt voption

A point if both lines have an intersection parameter in the range (inclusive min and max value). ValueNone if the lines are parallel, coincident or at least one intersection parameter is outside of the range.

XLine2D.tryIntersectInRanges (pA, pB, vA, vB, minParameterA, maxParameterA, minParameterB, maxParameterB)

Full Usage: XLine2D.tryIntersectInRanges (pA, pB, vA, vB, minParameterA, maxParameterA, minParameterB, maxParameterB)

Parameters:
    pA : Pt - The start point of the first line.
    pB : Pt - The start point of the second line.
    vA : Vc - The direction vector of the first line.
    vB : Vc - The direction vector of the second line.
    minParameterA : float - The minimum parameter value of the range, inclusive.
    maxParameterA : float - The maximum parameter value of the range, inclusive
    minParameterB : float - The minimum parameter value of the range, inclusive.
    maxParameterB : float - The maximum parameter value of the range, inclusive.

Returns: Pt voption A point if both lines have an intersection parameter in the range (inclusive min and max value). ValueNone if the lines are parallel, coincident or at least one intersection parameter is outside of the range.
Modifiers: inline

Returns the intersection point of two rays if it is within the given parameter ranges for line A and line B.

pA : Pt

The start point of the first line.

pB : Pt

The start point of the second line.

vA : Vc

The direction vector of the first line.

vB : Vc

The direction vector of the second line.

minParameterA : float

The minimum parameter value of the range, inclusive.

maxParameterA : float

The maximum parameter value of the range, inclusive

minParameterB : float

The minimum parameter value of the range, inclusive.

maxParameterB : float

The maximum parameter value of the range, inclusive.

Returns: Pt voption

A point if both lines have an intersection parameter in the range (inclusive min and max value). ValueNone if the lines are parallel, coincident or at least one intersection parameter is outside of the range.

XLine2D.tryIntersectRay (lineA, lineB, ?tangent)

Full Usage: XLine2D.tryIntersectRay (lineA, lineB, ?tangent)

Parameters:
    lineA : Line2D - First ray.
    lineB : Line2D - Second ray.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

Returns: Pt voption The point at which the two rays intersect or ValueNone.
Modifiers: inline

Tries to get intersection point of two rays (rays are 2D lines extended infinitely).

If the lines are parallel or coincident (within the tangent tolerance), or too short, ValueNone is returned.

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

Returns: Pt voption

The point at which the two rays intersect or ValueNone.

XLine2D.tryIntersectRay (pA, pB, vA, vB, ?tangent)

Full Usage: XLine2D.tryIntersectRay (pA, pB, vA, vB, ?tangent)

Parameters:
    pA : Pt - The start point of the first ray.
    pB : Pt - The start point of the second ray.
    vA : Vc - The direction vector of the first ray.
    vB : Vc - The direction vector of the second ray.
    ?tangent : MeasureProduct<tangent, MeasureOne> - Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

Returns: Pt voption The point at which the two rays intersect or ValueNone.
Modifiers: inline

Tries to get intersection point of two rays (rays are 2D lines extended infinitely).

If the lines are parallel or coincident (within the tangent tolerance) or too short, ValueNone is returned.

pA : Pt

The start point of the first ray.

pB : Pt

The start point of the second ray.

vA : Vc

The direction vector of the first ray.

vB : Vc

The direction vector of the second ray.

?tangent : MeasureProduct<tangent, MeasureOne>

Is an optional tangent of the maximum allowed angle between the two line vectors. The default value is '0.00436' this corresponds to approx 0.25 degree. Below this angle the lines are considered parallel. Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.

Returns: Pt voption

The point at which the two rays intersect or ValueNone.

XLine2D.tryParameterA (lineA, lineB)

Full Usage: XLine2D.tryParameterA (lineA, lineB)

Parameters:
Returns: float voption The parameter on lineA at the intersection with lineB if it is smaller than 1e12 in absolute value, or ValueNone if the parameter is bigger than 1e12 or if they are parallel or coincident.
Modifiers: inline

Returns the intersection parameter on the first ray (A) where ray A and ray B intersect.

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

Returns: float voption

The parameter on lineA at the intersection with lineB if it is smaller than 1e12 in absolute value, or ValueNone if the parameter is bigger than 1e12 or if they are parallel or coincident.

XLine2D.tryParameterA (pA, pB, vA, vB)

Full Usage: XLine2D.tryParameterA (pA, pB, vA, vB)

Parameters:
    pA : Pt - The start point of the first ray.
    pB : Pt - The start point of the second ray.
    vA : Vc - The direction vector of the first ray.
    vB : Vc - The direction vector of the second ray.

Returns: float voption The parameter on line A at the intersection with line B if it is smaller than 1e12 in absolute value, or ValueNone if the parameter is bigger than 1e12 or if they are parallel or coincident.
Modifiers: inline

Returns the intersection parameter on the first ray (A) where ray A and ray B intersect.

pA : Pt

The start point of the first ray.

pB : Pt

The start point of the second ray.

vA : Vc

The direction vector of the first ray.

vB : Vc

The direction vector of the second ray.

Returns: float voption

The parameter on line A at the intersection with line B if it is smaller than 1e12 in absolute value, or ValueNone if the parameter is bigger than 1e12 or if they are parallel or coincident.

Type something to start searching.