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.classifyClosestParameters lineA lineB

Full Usage: XLine2D.classifyClosestParameters lineA lineB

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

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). Uses the default tangent and tooShortTolerance. Use XLine2D.classifyClosestParametersCustom to set them.

lineA : Line2D

The first finite line segment.

lineB : Line2D

The second finite line segment.

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.classifyClosestParametersCustom (lineA, lineB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.classifyClosestParametersCustom (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). The optional parameters can be given by name. Use XLine2D.classifyClosestParameters for the defaults.

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.classifyClosestPoints lineA lineB

Full Usage: XLine2D.classifyClosestPoints lineA lineB

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

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). Uses the default tangent and tooShortTolerance. Use XLine2D.classifyClosestPointsCustom to set them.

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.

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.classifyClosestPointsCustom (lineA, lineB, ?tangent, ?tooShortTolerance)

Full Usage: XLine2D.classifyClosestPointsCustom (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). The optional parameters can be given by name. Use XLine2D.classifyClosestPoints for the defaults.

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.classifyEndsTouching a b

Full Usage: XLine2D.classifyEndsTouching a b

Parameters:
    a : Line2D - The first line.
    b : Line2D - The second line.

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. Uses the default tolerance of 1e-6. Use XLine2D.classifyEndsTouchingWithin to set it.

a : Line2D

The first line.

b : Line2D

The second line.

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.classifyEndsTouchingWithin tolerance a b

Full Usage: XLine2D.classifyEndsTouchingWithin tolerance a b

Parameters:
    tolerance : float - The distance tolerance.
    a : Line2D - The first line.
    b : Line2D - The second line.

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. Use XLine2D.classifyEndsTouching for the default tolerance of 1e-6.

tolerance : float

The distance tolerance.

a : Line2D

The first line.

b : Line2D

The second line.

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.classifyIntersection lineA lineB

Full Usage: XLine2D.classifyIntersection lineA lineB

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

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. Uses the default tangent and tooShortTolerance. Use XLine2D.classifyIntersectionCustom to set them.

lineA : Line2D

First finite line segment.

lineB : Line2D

Second finite line segment.

Returns: XPt

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

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

Full Usage: XLine2D.classifyIntersectionCustom (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. The optional parameters can be given by name. Use XLine2D.classifyIntersection for the defaults.

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.classifyIntersectionParameters lnA lnB

Full Usage: XLine2D.classifyIntersectionParameters lnA lnB

Parameters:
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. Uses the default tangent and tooShortTolerance. Use XLine2D.classifyIntersectionParametersCustom to set them.

lnA : Line2D

First line.

lnB : Line2D

Second line.

Returns: XParam

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

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

Full Usage: XLine2D.classifyIntersectionParametersCustom (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. The optional parameters can be given by name. Use XLine2D.classifyIntersectionParameters for the defaults.

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.classifyRayIntersection lineA lineB

Full Usage: XLine2D.classifyRayIntersection lineA lineB

Parameters:
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). Uses the default tangent and tooShortTolerance. Use XLine2D.classifyRayIntersectionCustom to set them.

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

Returns: XRay

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

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

Full Usage: XLine2D.classifyRayIntersectionCustom (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). The optional parameters can be given by name. Use XLine2D.classifyRayIntersection for the defaults.

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.classifyRayIntersectionParameters lineA lineB

Full Usage: XLine2D.classifyRayIntersectionParameters lineA lineB

Parameters:
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). Uses the default tangent and tooShortTolerance. Use XLine2D.classifyRayIntersectionParametersCustom to set them.

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

Returns: XRayParam

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

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

Full Usage: XLine2D.classifyRayIntersectionParametersCustom (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). The optional parameters can be given by name. Use XLine2D.classifyRayIntersectionParameters for the defaults.

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.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.distanceSq lineA lineB

Full Usage: XLine2D.distanceSq 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.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.doOverlap lineA lineB

Full Usage: XLine2D.doOverlap lineA lineB

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

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. Uses the default tolerance of 1e-6. Use XLine2D.doOverlapWithin to set it.

lineA : Line2D

The first line.

lineB : Line2D

The second line.

Returns: bool

XLine2D.doOverlapWithin tolerance lineA lineB

Full Usage: XLine2D.doOverlapWithin tolerance lineA lineB

Parameters:
    tolerance : float - A distance tolerance (compared against the squared distance internally). Used for checking if the distance between parallel lines is less than this value.
    lineA : Line2D - The first line.
    lineB : Line2D - The second line.

Returns: bool TRUE if the lines are coincident within the tolerance and overlap or touch at their ends.
Modifiers: inline

Checks if 2D lines are not only parallel and coincident but are also overlapping or at least touching at their ends. Use XLine2D.doOverlap for the default tolerance of 1e-6.

tolerance : float

A distance tolerance (compared against the squared distance internally). Used for checking if the distance between parallel lines is less than this value.

lineA : Line2D

The first line.

lineB : Line2D

The second line.

Returns: bool

TRUE if the lines are coincident within the tolerance and overlap or touch at their ends.

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.isWithinRanges (minParameterA, maxParameterA, minParameterB, maxParameterB, lineA, lineB)

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

Parameters:
    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.
    lineA : Line2D - First line.
    lineB : Line2D - Second line.

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

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.

lineA : Line2D

First line.

lineB : Line2D

Second line.

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.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.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.tryIntersectInRangeA minParameterA maxParameterA lineA lineB

Full Usage: XLine2D.tryIntersectInRangeA minParameterA maxParameterA lineA lineB

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

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.

minParameterA : float

The minimum parameter value of the range, inclusive.

maxParameterA : float

The maximum parameter value of the range, inclusive.

lineA : Line2D

First line.

lineB : Line2D

Second line.

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 (minParameterA, maxParameterA, minParameterB, maxParameterB, lineA, lineB)

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

Parameters:
    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.
    lineA : Line2D - First line.
    lineB : Line2D - Second line.

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.

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.

lineA : Line2D

First line.

lineB : Line2D

Second line.

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.tryIntersectRays lineA lineB

Full Usage: XLine2D.tryIntersectRays lineA lineB

Parameters:
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). Uses the default tangent of 0.25 degrees. Use XLine2D.tryIntersectRaysWithin to set it.

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.

Returns: Pt voption

The point at which the two rays intersect or ValueNone.

XLine2D.tryIntersectRaysWithin tangent lineA lineB

Full Usage: XLine2D.tryIntersectRaysWithin tangent lineA lineB

Parameters:
    tangent : float<MeasureProduct<tangent, MeasureOne>> - The tangent of the maximum allowed angle between the two line vectors. Below this angle the lines are considered parallel. For example 0.00436 corresponds to approx 0.25 degree. Use the module Euclid.UtilEuclid.Tangent to set the tolerance here.
    lineA : Line2D - First ray.
    lineB : Line2D - Second ray.

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). Use XLine2D.tryIntersectRays for the default tangent of 0.25 degrees.

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

tangent : float<MeasureProduct<tangent, MeasureOne>>

The tangent of the maximum allowed angle between the two line vectors. Below this angle the lines are considered parallel. For example 0.00436 corresponds to approx 0.25 degree. Use the module Euclid.UtilEuclid.Tangent to set the tolerance here.

lineA : Line2D

First ray.

lineB : Line2D

Second ray.

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.

Type something to start searching.