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
|
|
|
Full Usage:
this.ClosestParameterXY
Parameters:
float
y : float
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 fail on very short curves.
Extended Type:
|
Full Usage:
this.ClosestParameters
Parameters:
Line2D
-
The second line.
Returns: float * float
A tuple of two floats, the first is the parameter on lnA, the second on lnB.
|
Finds the parameters of closest points between two finite 2D Lines, also works on parallel and overlapping lines. For parallel and overlapping lines the parameters returned are in the center of their overlap. If the lines intersect the returned parameters are exactly the same. This method uses a default angle tolerance of 0.25 degrees for parallel detection and a length tolerance of 1e-6 for detecting lines that are too short. For more control over these tolerances, use XLine2D.classifyClosestParameters directly.
Extended Type:
|
|
|
|
Finds the closest points between two finite 2D Lines, also works on parallel and overlapping lines. For parallel and overlapping lines the points returned are in the center of their overlap. If the lines intersect the returned points are exactly the same. This method uses a default angle tolerance of 0.25 degrees for parallel detection and a length tolerance of 1e-6 for detecting lines that are too short. For more control over these tolerances, use XLine2D.classifyClosestPoints directly.
Extended Type:
|
|
|
|
|
Full Usage:
this.DistanceRayXY
Parameters:
float
y : float
Returns: float
Modifiers: inline |
Assumes Line2D to be an infinite ray! Returns distance from point to ray. Fails on curves shorter than 1e-6 units. (ln.DistanceToPt does not.)
Extended Type:
|
Full Usage:
this.DistanceRayXYSq
Parameters:
float
y : float
Returns: float
|
Assumes Line2D to be an infinite ray! Returns square distance from point to ray. Fails on curves shorter than 1e-6 units. (ln.DistanceToPtSq does not.)
Extended Type:
|
|
|
|
|
Full Usage:
this.DistanceToXY
Parameters:
float
y : float
Returns: float
Modifiers: inline |
Returns distance from point to (finite) line.
Extended Type:
|
Full Usage:
this.DistanceToXYSq
Parameters:
float
y : float
Returns: float
|
Returns square distance from point to finite line.
Extended Type:
|
|
|
Full Usage:
this.Extend
Parameters:
float
distAtEnd : float
Returns: Line2D
Modifiers: inline |
|
|
|
|
|
Full Usage:
this.ExtendRelative
Parameters:
float
relAtEnd : float
Returns: Line2D
Modifiers: inline |
|
|
|
Full Usage:
this.ExtendStartRelative
Parameters:
float
Returns: Line2D
Modifiers: inline |
|
Full Usage:
this.IsCoincidentAndOpposingToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
maxDotProduct : float
Returns: bool
Modifiers: inline |
A fast version of IsCoincidentAndOpposingTo that uses cross-product to determine parallelism. Checks if two 2D lines are coincident on opposing rays within given tolerances. Lines are coincident if they are parallel (cross product less than parallelogramAreaTolerance) and opposing if the dot-product is negative (smaller than maxDotProduct) and the vector between their start points is also parallel to the lines. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. Lines are opposing if dot product is negative. maxDotProduct must be NEGATIVE! just below zero, -1e-6 by default ! The maxDotProduct helps to make sure FALSE is returned on very short or zero length lines. The static counterpart is Line2D.areCoincidentAndOpposingFast.
Extended Type:
|
Full Usage:
this.IsCoincidentAndOrientedToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
minDotProduct : float
Returns: bool
Modifiers: inline |
A fast version of IsCoincidentAndOrientedTo that uses cross-product to determine parallelism. Checks if two 2D lines are coincident on the same ray within given tolerances. Lines are coincident if they are parallel (cross product less than parallelogramAreaTolerance) and oriented in the same direction if the dot-product is positive (bigger than minDotProduct) and the vector between their start points is also parallel to the lines. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. Lines are oriented if dot product is positive. minDotProduct must be POSITIVE! just above zero. 1e-6 by default. The minDotProduct argument helps to make sure FALSE is returned on very short or zero length lines. The static counterpart is Line2D.areCoincidentAndOrientedFast.
Extended Type:
|
Full Usage:
this.IsCoincidentTo
Parameters:
Line2D
distanceTolerance : float
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D lines are coincident on the same ray 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 zero Length lines. The default angle tolerance is 0.25 degrees. Tangent.``0.25`` is about 0.0044. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. The static counterpart is Line2D.areCoincident.
Extended Type:
|
Full Usage:
this.IsCoincidentToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
Returns: bool
Modifiers: inline |
A fast version of IsCoincidentTo that uses cross-product to determine parallelism. Checks if two 2D lines are coincident within a given tolerance for their cross product. Lines are coincident if they are parallel (cross product less than parallelogramAreaTolerance) and the vector between their start points is also parallel to the lines. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. ATTENTION this method returns TRUE on zero length or very small lines. It returns FALSE on almost coincident lines that are very long. Pick a bigger parallelogramAreaTolerance for longer lines. The static counterpart is Line2D.areCoincidentFast.
Extended Type:
|
Full Usage:
this.IsParallelAndOpposingToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
maxDotProduct : float
Returns: bool
Modifiers: inline |
A fast version of IsParallelToAndOpposingTo that uses cross-product to determine parallelism. Checks if two 2D lines are parallel within a given tolerance for their cross product and opposing by having a negative dot-product. Lines are parallel if cross product is less than given parallelogramAreaTolerance. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. Lines are opposing if dot product is negative. maxDotProduct must be NEGATIVE! just below zero, -1e-6 by default ! The maxDotProduct helps to make sure FALSE is returned on very short or zero length lines. The static counterpart is Line2D.areParallelAndOpposingFast.
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
Line2D
minTangent : float<MeasureProduct<tangent, MeasureOne>>
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. Tangent.``0.25`` is about 0.0044. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Line2D.areParallelAndOriented.
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
Vc
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D line is parallel to a 2D vector. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. Tangent.``0.25`` is about 0.0044. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than 1e-12. The static counterpart is Line2D.isParallelAndOrientedToVc.
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedTo
Parameters:
UnitVc
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D line is parallel to a 2D unit-vector. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. Tangent.``0.25`` is about 0.0044. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Line2D.isParallelAndOrientedToUnitVc.
Extended Type:
|
Full Usage:
this.IsParallelAndOrientedToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
minDotProduct : float
Returns: bool
Modifiers: inline |
A fast version of IsParallelToAndOrientedTo that uses cross-product to determine parallelism. Checks if two 2D lines are parallel within a given tolerance for their cross product and oriented in the same direction by having a positive dot-product. Lines are parallel if cross product is less than given parallelogramAreaTolerance. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. Lines are oriented if dot product is positive. minDotProduct must be POSITIVE! just above zero. 1e-6 by default. The minDotProduct argument helps to make sure FALSE is returned on very short or zero length lines. The static counterpart is Line2D.areParallelAndOrientedFast.
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
Line2D
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if two 2D lines are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. Tangent.``0.25`` is about 0.0044. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Line2D.areParallel.
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
Vc
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D line is parallel to a 2D vector. Ignores the line orientation. The default angle tolerance is 0.25 degrees. Tangent.``0.25`` is about 0.0044. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Line2D.isParallelToVc.
Extended Type:
|
Full Usage:
this.IsParallelTo
Parameters:
UnitVc
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D line is parallel to a 2D unit-vector. Ignores the line orientation. The default angle tolerance is 0.25 degrees. Tangent.``0.25`` is about 0.0044. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Line2D.isParallelToUnitVc.
Extended Type:
|
Full Usage:
this.IsParallelToFast
Parameters:
Line2D
parallelogramAreaTolerance : float
Returns: bool
Modifiers: inline |
A fast version of IsParallelTo that uses cross-product to determine parallelism. Checks if two 2D lines are parallel within a given tolerance for their cross product. Lines are parallel if cross product is less than parallelogramAreaTolerance. The cross product corresponds to the signed area of the parallelogram spanned by the two direction vectors. ATTENTION this method returns TRUE on zero length or very small lines. It returns FALSE on almost coincident lines that are very long. Pick a bigger parallelogramAreaTolerance for longer lines. The static counterpart is Line2D.areParallelFast.
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
Line2D
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
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. Tangent.``89.75`` is about 229.2. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Line2D.arePerpendicular.
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
Vc
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D line is perpendicular to a 2D vector. The default angle tolerance is 89.75 to 90.25 degrees. Tangent.``89.75`` is about 229.2. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Line2D.isPerpendicularToVc.
Extended Type:
|
Full Usage:
this.IsPerpendicularTo
Parameters:
UnitVc
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool
Modifiers: inline |
Checks if a 2D line is perpendicular to a 2D unit-vector. The default angle tolerance is 89.75 to 90.25 degrees. Tangent.``89.75`` is about 229.2. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The static counterpart is Line2D.isPerpendicularToUnitVc.
Extended Type:
|
|
|
|
|
Full Usage:
this.IsTiny
Parameters:
float
Returns: bool
Modifiers: inline |
Returns TRUE if line is shorter than tolerance. Or has NaN components.
Extended Type:
|
Full Usage:
this.IsTinySq
Parameters:
float
Returns: bool
Modifiers: inline |
Returns TRUE if the line's square length is shorter than squared tolerance. Or has NaN components.
Extended Type:
|
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 the Y-axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsXYOnLeft
Parameters:
float
y : float
Returns: bool
Modifiers: inline |
Looking in the direction of the line. Check if a given point is on the left side of the infinite ray. Also returns FALSE if the point is on the line.
Extended Type:
|
Full Usage:
this.IsXYOnRight
Parameters:
float
y : float
Returns: bool
Modifiers: inline |
Looking in the direction of the line. Check if a given point is on the right side of the ray. Also returns FALSE if the point is on the line.
Extended Type:
|
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 the X-axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.
Extended Type:
|
Full Usage:
this.IsZeroLength
Parameters:
unit
Returns: bool
Modifiers: inline |
Check if the line has the same starting and ending point.
Extended Type:
|
Full Usage:
this.LengthFromParameter
Parameters:
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:
|
Full Usage:
this.LengthTillParameter
Parameters:
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
this.RayClosestParameterXY
Parameters:
float
y : float
Returns: float
|
Assumes the Line2D to be an infinite ray! Returns the parameter at which a point is closest to the ray. 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-6 units. (ln.ClosestParameter does not)
Extended Type:
|
|
|
|
|
|
Rotate a Line2D by a Rotation2D. The resulting line has the same length as the input.
Extended Type:
|
Full Usage:
this.RotateAround
Parameters:
Pt
-
The center point of the rotation.
r : Rotation2D
-
The rotation to apply.
Returns: Line2D
The rotated 2D line.
Modifiers: inline |
Rotate the Line2D counter-clockwise around a given center point by a Rotation2D. The resulting line has the same length as the input.
Extended Type:
|
Full Usage:
this.RotateDegrees
Parameters:
float
-
The rotation angle in degrees.
Returns: Line2D
The rotated 2D line.
Modifiers: inline |
|
|
|
Full Usage:
this.RotateRadians
Parameters:
float
-
The rotation angle in radians.
Returns: Line2D
The rotated 2D line.
Modifiers: inline |
|
|
|
|
|
|
|
Full Usage:
this.Shrink
Parameters:
float
distAtEnd : float
Returns: Line2D
Modifiers: inline |
|
|
|
|
|
Full Usage:
this.SubLine
Parameters:
float
endParameter : float
Returns: Line2D
Modifiers: inline |
|
|
|
Full Usage:
Line2D.areCoincident distanceTolerance minTangent lnA lnB
Parameters:
float
minTangent : float<MeasureProduct<tangent, MeasureOne>>
lnA : Line2D
lnB : Line2D
Returns: bool
Modifiers: inline |
Checks if two 2D lines are coincident on the same ray within the distance tolerance. This means that lines are parallel within the angle tolerance. Also returns FALSE on zero length lines. e.g. Tangent.``0.25`` is about 0.0044. Use a precomputed value from Euclid.Tangent module as tolerance. The instance counterpart is Line2D.IsCoincidentTo.
Extended Type:
|
|
|
|
Checks if two 2D lines are Not parallel. Ignoring orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``0.25`` is about 0.0044. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).
Extended Type:
|
Full Usage:
Line2D.areParallel minTangent lnA lnB
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
lnA : Line2D
lnB : Line2D
Returns: bool
Modifiers: inline |
Checks if two 2D lines are parallel. Ignoring orientation. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``0.25`` is about 0.0044. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsParallelTo.
Extended Type:
|
Full Usage:
Line2D.areParallelAndOriented minTangent lnA lnB
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
lnA : Line2D
lnB : Line2D
Returns: bool
Modifiers: inline |
Checks if two 2D lines are parallel and orientated the same way. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``0.25`` is about 0.0044. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsParallelAndOrientedTo.
Extended Type:
|
|
|
Full Usage:
Line2D.arePerpendicular maxTangent lnA lnB
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
lnA : Line2D
lnB : Line2D
Returns: bool
Modifiers: inline |
Checks if two 2D lines are perpendicular to each other. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``89.75`` is about 229.2. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsPerpendicularTo.
Extended Type:
|
|
|
|
|
|
|
Full Usage:
Line2D.closestParameterXY x y ln
Parameters:
float
y : float
ln : Line2D
Returns: float
Modifiers: inline |
|
|
Finds the parameters of closest points between two finite 2D Lines, also works on parallel and overlapping lines. For parallel and overlapping lines the parameters returned are in the center of their overlap. If the lines intersect the returned parameters are exactly the same
Extended Type:
|
|
|
|
Finds the closest points between two finite 2D Lines, also works on parallel and overlapping lines. For parallel and overlapping lines the points returned are in the center of their overlap. If the lines intersect the returned points are exactly the same
Extended Type:
|
|
|
|
|
|
|
|
|
|
Returns the Cross Product or Determinant between the vectors of the Two lines. In 2D it is just a scalar equal to the signed area of the parallelogram spanned by the input vectors. If the result is zero the two lines are parallel (or one line is zero-length). This is tupled, like Vc.cross, because the order of the arguments matters.
Extended Type:
|
|
|
|
|
Full Usage:
Line2D.distanceRayXY x y ln
Parameters:
float
y : float
ln : Line2D
Returns: float
Modifiers: inline |
|
Full Usage:
Line2D.distanceRayXYSq x y ln
Parameters:
float
y : float
ln : Line2D
Returns: float
Modifiers: inline |
|
|
|
|
|
|
|
|
|
Full Usage:
Line2D.distanceToXY x y ln
Parameters:
float
y : float
ln : Line2D
Returns: float
Modifiers: inline |
|
Full Usage:
Line2D.distanceToXYSq x y ln
Parameters:
float
y : float
ln : Line2D
Returns: float
Modifiers: inline |
|
|
|
|
Divides a 2D line into segments of given length. Includes start and end point. If the line length is smaller than the given distance just the start and end point is returned. Adds end point only if there is a remainder bigger than 0.1% of the segment length.
Extended Type:
|
|
Divides a 2D line into segments of given length. Excludes start and end point. If the line length is smaller than the given distance an empty array is returned. Adds last div point before end only if there is a remainder bigger than 0.1% of the segment length.
Extended Type:
|
|
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:
|
|
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:
|
|
A fast test tests if two finite 2D lines truly intersect. Does not use a default tolerance for parallel or coincident lines. Just checks within line range and not NaN. Returns FALSE on zero length lines or if parallel lines are touching or overlapping each other. Use the XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident. This does not check for an explicit angle tolerance, so overlapping almost parallel lines may return TRUE.
Extended Type:
|
|
Tests if two finite 2D lines intersect or touch. Also returns TRUE if parallel lines are touching or overlapping each other. Also returns TRUE if a zero length lines are at the same location. This method uses an angle of 0.25 degrees to classify Lines as parallel. In which case it also checks if they overlap or touch. Use the Euclid's XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident.
Extended Type:
|
|
|
|
|
|
Checks if two 2D lines are equal within tolerance. Identical Lines in opposite directions are not considered equal. The tolerance applies to each coordinate of the start and end points separately, not to the Euclidean distance between them. Use Line2D.equalsExact to check for an exact match.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Intersects two infinite 2D lines. Fails if they are parallel. Use the XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident.
Extended Type:
|
Full Usage:
Line2D.isParallelAndOrientedToUnitVc minTangent other ln
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
other : UnitVc
ln : Line2D
Returns: bool
Modifiers: inline |
Checks if a 2D line is parallel to a 2D unit-vector and oriented the same way. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``0.25`` is about 0.0044. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsParallelAndOrientedTo.
Extended Type:
|
Full Usage:
Line2D.isParallelAndOrientedToVc minTangent other ln
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
other : Vc
ln : Line2D
Returns: bool
Modifiers: inline |
Checks if a 2D line is parallel to a 2D vector and oriented the same way. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``0.25`` is about 0.0044. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsParallelAndOrientedTo.
Extended Type:
|
Full Usage:
Line2D.isParallelToUnitVc minTangent other ln
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
other : UnitVc
ln : Line2D
Returns: bool
Modifiers: inline |
Checks if a 2D line is parallel to a 2D unit-vector. Ignores orientation. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``0.25`` is about 0.0044. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsParallelTo.
Extended Type:
|
Full Usage:
Line2D.isParallelToVc minTangent other ln
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
other : Vc
ln : Line2D
Returns: bool
Modifiers: inline |
Checks if a 2D line is parallel to a 2D vector. Ignores orientation. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``0.25`` is about 0.0044. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsParallelTo.
Extended Type:
|
Full Usage:
Line2D.isPerpendicularToUnitVc maxTangent other ln
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
other : UnitVc
ln : Line2D
Returns: bool
Modifiers: inline |
Checks if a 2D line is perpendicular to a 2D unit-vector. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``89.75`` is about 229.2. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsPerpendicularTo.
Extended Type:
|
Full Usage:
Line2D.isPerpendicularToVc maxTangent other ln
Parameters:
float<MeasureProduct<tangent, MeasureOne>>
other : Vc
ln : Line2D
Returns: bool
Modifiers: inline |
Checks if a 2D line is perpendicular to a 2D vector. Use a precomputed value from Euclid.Tangent module as tolerance. e.g. Tangent.``89.75`` is about 229.2. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). The instance counterpart is Line2D.IsPerpendicularTo.
Extended Type:
|
|
|
|
|
|
|
Full Usage:
Line2D.isTinySq tol l
Parameters:
float
l : Line2D
Returns: bool
Modifiers: inline |
|
|
Checks if the two finite 2D lines are touching each other at any of end points within the given tolerance. This will also return TRUE if the lines are touching on both points. Use XLine2D.classifyEndsTouching to get more detailed information about which ends are touching.
Extended Type:
|
|
|
Full Usage:
Line2D.isXYOnLeft x y ln
Parameters:
float
y : float
ln : Line2D
Returns: bool
Modifiers: inline |
|
Full Usage:
Line2D.isXYOnRight x y ln
Parameters:
float
y : float
ln : Line2D
Returns: bool
Modifiers: inline |
|
|
|
|
|
|
|
Full Usage:
Line2D.lengthFromParameter t ln
Parameters:
float
ln : Line2D
Returns: float
Modifiers: inline |
|
|
|
Full Usage:
Line2D.lengthTillParameter p ln
Parameters:
float
ln : Line2D
Returns: float
Modifiers: inline |
|
|
Assumes Line2D to be an infinite ray! Returns the parameter at which a point is closest to the infinite ray. If it is smaller than 0.0 or bigger than 1.0 it is outside of the finite line. Get distance from start of line to point projected onto line, may be negative.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Line2D.pointAtDistance dist ln
Parameters:
^a
ln : Line2D
Returns: Pt
Modifiers: inline Type parameters: ^a, ^b, ^c (requires (static member op_Multiply : Microsoft.FSharp.Core.float * ^a -> ^b) and (static member op_Division : ^b * Microsoft.FSharp.Core.float -> ^c) and (static member op_Division : ^b * Microsoft.FSharp.Core.float -> ^c) and (static member op_Addition : Microsoft.FSharp.Core.float * ^c -> Microsoft.FSharp.Core.float)) |
|
Full Usage:
Line2D.pointAtDistanceFromEnd dist ln
Parameters:
^a
ln : Line2D
Returns: Pt
Modifiers: inline Type parameters: ^a, ^b, ^c (requires (static member op_Multiply : Microsoft.FSharp.Core.float * ^a -> ^b) and (static member op_Division : ^b * Microsoft.FSharp.Core.float -> ^c) and (static member op_Division : ^b * Microsoft.FSharp.Core.float -> ^c) and (static member op_Subtraction : Microsoft.FSharp.Core.float * ^c -> Microsoft.FSharp.Core.float)) |
|
|
|
|
|
Full Usage:
Line2D.rayClosestParameterXY x y ln
Parameters:
float
y : float
ln : Line2D
Returns: float
Modifiers: inline |
|
|
|
|
|
Full Usage:
Line2D.rotate r ln
Parameters:
Rotation2D
ln : Line2D
Returns: Line2D
Modifiers: inline |
|
Full Usage:
Line2D.rotateAround cen r ln
Parameters:
Pt
-
The center point of the rotation.
r : Rotation2D
-
The rotation to apply.
ln : Line2D
-
The 2D line to rotate.
Returns: Line2D
The rotated 2D line.
Modifiers: inline |
Rotate a Line2D counter-clockwise around a given center point by a Rotation2D. The resulting line has the same length as the input.
Extended Type:
|
|
Rotate a Line2D counter-clockwise around the World Origin by an angle in degrees. For better performance precompute the Rotation2D struct and rotate with Line2D.rotate.
Extended Type:
|
|
|
|
Rotate a Line2D counter-clockwise around the World Origin by an angle in radians. For better performance precompute the Rotation2D struct and rotate with Line2D.rotate.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
|
|
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:
|
|
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Line2D.tryGetOverlap lnA lnB
Parameters: Returns: (float * float) voption
A voption of a tuple of two floats.
Returns the tuple containing the start and end parameter of the overlap on lnA if the lines are parallel and overlapping.
Returns ValueNone if the lines are not parallel, not overlapping, or too short.
|
Checks if lines are parallel, coincident and overlapping. If the first parameter in the overlap is smaller than the second the lines are oriented in the same direction. If the first parameter is greater than the second the lines are oriented in the opposite direction. Parallel lines are treated as coincident when their perpendicular distance is below 1e-6 (1e-12 squared), the same tolerance as Line2D.tryIntersectOrOverlap.
Extended Type:
|
|
A fast intersection of two finite 2D lines. Does not use a default tolerance for parallel or coincident lines. Just checks if both parameters are within line range and not NaN. Use the XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident.
Extended Type:
|
|
Intersects two finite 2D Lines. Also returns a point if parallel lines are touching or overlapping each other. Also returns a point if zero-length lines are at the same location within 1e-6 distance. This method uses an angle of 0.25 degrees to classify Lines as parallel. In which case it also checks if they overlap or touch. Parallel lines are treated as coincident when their perpendicular distance is below 1e-6 (1e-12 squared), the same tolerance as Line2D.tryGetOverlap. Use the Euclid's XLine2D module for more specialized intersection calculations. Like getting the kind of Parallel relation between lines, only getting the parameter of one line, or setting a tolerance for when lines are parallel or coincident.
Extended Type:
|
|
Tries to get intersection point of two rays (rays are 2D lines extended infinitely). If the lines are parallel or coincident, or if the parameter on Line A is bigger than 1e12 in absolute value, ValueNone is returned.
Extended Type:
|
|
|
|
Tries to project a line onto another line considered finite. Returns ValueNone if there is no overlap. Returns ValueSome (startParam, endParam) if there is an overlap. The parameters are between 0.0 and 1.0 on the target line The first parameter is from the start of the line to project. The second parameter is from the end of the line to project. Therefore, if the first parameter is greater than the second, the lines have opposite orientations.
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Line2D.withLengthFromStart len ln
Parameters:
^a
ln : Line2D
Returns: Line2D
Modifiers: inline Type parameters: ^a, ^b, ^c (requires (static member op_Multiply : Microsoft.FSharp.Core.float * ^a -> ^b) and (static member op_Division : ^b * Microsoft.FSharp.Core.float -> ^c) and (static member op_Division : ^b * Microsoft.FSharp.Core.float -> ^c) and (static member op_Addition : Microsoft.FSharp.Core.float * ^c -> Microsoft.FSharp.Core.float)) |
|
Full Usage:
Line2D.withLengthToEnd len ln
Parameters:
^a
ln : Line2D
Returns: Line2D
Modifiers: inline Type parameters: ^a, ^b, ^c (requires (static member op_Multiply : Microsoft.FSharp.Core.float * ^a -> ^b) and (static member op_Division : ^b * Microsoft.FSharp.Core.float -> ^c) and (static member op_Division : ^b * Microsoft.FSharp.Core.float -> ^c) and (static member op_Addition : Microsoft.FSharp.Core.float * ^c -> Microsoft.FSharp.Core.float)) |
|
|
|
|
Euclid