public class EuclidGeometryTools
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
HALF_PI
Constant used to save some computation.
|
static double |
IS_POINT_ON_LINE_EPS
Tolerance used to identify edge cases.
|
static double |
ONE_MILLIONTH
Tolerance used to identify edge cases.
|
static double |
ONE_TEN_MILLIONTH
Tolerance used to identify edge cases.
|
static double |
ONE_TRILLIONTH
Tolerance used to identify edge cases.
|
Constructor and Description |
---|
EuclidGeometryTools() |
Modifier and Type | Method and Description |
---|---|
static double |
angleFromFirstToSecondVector2D(double firstVectorX,
double firstVectorY,
double secondVectorX,
double secondVectorY)
Computes the angle in radians from the first 2D vector to the second 2D vector.
|
static double |
angleFromFirstToSecondVector3D(double firstVectorX,
double firstVectorY,
double firstVectorZ,
double secondVectorX,
double secondVectorY,
double secondVectorZ)
Computes the angle in radians from the first 3D vector to the second 3D vector.
|
static double |
angleFromXForwardToVector2D(double vectorX,
double vectorY)
Computes the angle in radians from
xForward = (1.0, 0.0) to the given 2D vector. |
static double |
angleFromXForwardToVector2D(us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly vector)
Computes the angle in radians from
xForward = (1.0, 0.0) to the given 2D vector. |
static boolean |
areLine2DsCollinear(double pointOnLine1x,
double pointOnLine1y,
double lineDirection1x,
double lineDirection1y,
double pointOnLine2x,
double pointOnLine2y,
double lineDirection2x,
double lineDirection2y,
double angleEpsilon,
double distanceEpsilon)
Tests if the two given lines are collinear given a tolerance on the angle between in the range
]0; pi/2[.
|
static boolean |
areLine2DsCollinear(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine2,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine2,
double angleEpsilon,
double distanceEpsilon)
Tests if the two given lines are collinear given a tolerance on the angle between in the range
]0; pi/2[.
|
static boolean |
areLine2DsCollinear(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine2,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine2,
double angleEpsilon,
double distanceEpsilon)
Tests if the two given lines are collinear given a tolerance on the angle between in the range
]0; pi/2[.
|
static boolean |
areLine2DsCollinear(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine2,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection2,
double angleEpsilon,
double distanceEpsilon)
Tests if the two given lines are collinear given a tolerance on the angle between in the range
]0; pi/2[.
|
static boolean |
areLine3DsCollinear(double pointOnLine1x,
double pointOnLine1y,
double pointOnLine1z,
double lineDirection1x,
double lineDirection1y,
double lineDirection1z,
double pointOnLine2x,
double pointOnLine2y,
double pointOnLine2z,
double lineDirection2x,
double lineDirection2y,
double lineDirection2z,
double angleEpsilon,
double distanceEpsilon)
Tests if the two given lines are collinear given a tolerance on the angle between in the range
]0; pi/2[.
|
static boolean |
areLine3DsCollinear(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine2,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine2,
double angleEpsilon,
double distanceEpsilon)
Tests if the two given lines are collinear given a tolerance on the angle between in the range
]0; pi/2[.
|
static boolean |
areLine3DsCollinear(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine1,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine2,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection2,
double angleEpsilon,
double distanceEpsilon)
Tests if the two given lines are collinear given a tolerance on the angle between in the range
]0; pi/2[.
|
static boolean |
arePlane3DsCoincident(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane1,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane2,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal2,
double angleEpsilon,
double distanceEpsilon)
Tests if the two given planes are coincident:
planeNormal1 and planeNormal2 are parallel given the tolerance
angleEpsilon . |
static boolean |
areVector2DsParallel(double firstVectorX,
double firstVectorY,
double secondVectorX,
double secondVectorY,
double angleEpsilon)
Tests if the two given vectors are parallel given a tolerance on the angle between the two vector
axes in the range ]0; pi/2[.
|
static boolean |
areVector2DsParallel(us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly firstVector,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly secondVector,
double angleEpsilon)
Tests if the two given vectors are parallel given a tolerance on the angle between the two vector
axes in the range ]0; pi/2[.
|
static boolean |
areVector3DsParallel(double firstVectorX,
double firstVectorY,
double firstVectorZ,
double secondVectorX,
double secondVectorY,
double secondVectorZ,
double angleEpsilon)
Tests if the two given vectors are parallel given a tolerance on the angle between the two vector
axes in the range ]0; pi/2[.
|
static boolean |
areVector3DsParallel(us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly firstVector,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly secondVector,
double angleEpsilon)
Tests if the two given vectors are parallel given a tolerance on the angle between the two vector
axes in the range ]0; pi/2[.
|
static us.ihmc.euclid.tuple2D.Point2D |
averagePoint2Ds(java.util.Collection<? extends us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly> points)
Computes the average 2D point from a given collection of 2D points.
|
static us.ihmc.euclid.tuple3D.Point3D |
averagePoint3Ds(java.util.Collection<? extends us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly> points)
Computes the average 3D point from a given collection of 3D points.
|
static us.ihmc.euclid.tuple3D.Point3D |
averagePoint3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly a,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly b)
Returns the average of two 3D points.
|
static void |
axisAngleFromFirstToSecondVector3D(double firstVectorX,
double firstVectorY,
double firstVectorZ,
double secondVectorX,
double secondVectorY,
double secondVectorZ,
us.ihmc.euclid.axisAngle.interfaces.AxisAngleBasics rotationToPack)
Computes the complete minimum rotation from
firstVector to the secondVector and
packs it into an AxisAngle . |
static void |
axisAngleFromFirstToSecondVector3D(us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly firstVector,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly secondVector,
us.ihmc.euclid.axisAngle.interfaces.AxisAngleBasics rotationToPack)
Computes the complete minimum rotation from
firstVector to the secondVector and
packs it into an AxisAngle . |
static us.ihmc.euclid.axisAngle.AxisAngle |
axisAngleFromZUpToVector3D(us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly vector)
Computes the complete minimum rotation from
zUp = (0, 0, 1) to the given vector
and packs it into an AxisAngle . |
static void |
axisAngleFromZUpToVector3D(us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly vector,
us.ihmc.euclid.axisAngle.interfaces.AxisAngleBasics rotationToPack)
Computes the complete minimum rotation from
zUp = (0, 0, 1) to the given vector
and packs it into an AxisAngle . |
static double |
closestPoint3DsBetweenTwoLine3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine1,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine2,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection2,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics closestPointOnLine1ToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics closestPointOnLine2ToPack)
Given two 3D infinitely long lines, this methods computes two points P ∈ line1 and Q ∈ lin2
such that the distance || P - Q || is the minimum distance between the two 3D lines.
|
static double |
closestPoint3DsBetweenTwoLineSegment3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart2,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd2,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics closestPointOnLineSegment1ToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics closestPointOnLineSegment2ToPack)
Given two 3D line segments with finite length, this methods computes two points P ∈
lineSegment1 and Q ∈ lineSegment2 such that the distance || P - Q || is the minimum distance
between the two 3D line segments.
|
static double |
distanceBetweenPoint2Ds(double firstPointX,
double firstPointY,
double secondPointX,
double secondPointY)
Calculates the distance between two points.
|
static double |
distanceBetweenPoint2Ds(double firstPointX,
double firstPointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPoint)
Calculates the distance between two points.
|
static double |
distanceBetweenPoint3Ds(double firstPointX,
double firstPointY,
double firstPointZ,
double secondPointX,
double secondPointY,
double secondPointZ)
Calculates the distance between two points.
|
static double |
distanceBetweenPoint3Ds(double firstPointX,
double firstPointY,
double firstPointZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPoint)
Calculates the distance between two points.
|
static double |
distanceBetweenTwoLine3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine1,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine2,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection2)
This methods computes the minimum distance between the two infinitely long 3D lines.
|
static double |
distanceBetweenTwoLineSegment3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart2,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd2)
This methods computes the minimum distance between the two 3D line segments with finite length.
|
static double |
distanceFromPoint2DToLine2D(double pointX,
double pointY,
double pointOnLineX,
double pointOnLineY,
double lineDirectionX,
double lineDirectionY)
Returns the minimum distance between a 2D point and an infinitely long 2D line defined by a point
and a direction.
|
static double |
distanceFromPoint2DToLine2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Returns the minimum distance between a 2D point and an infinitely long 2D line defined by two
points.
|
static double |
distanceFromPoint2DToLine2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Returns the minimum distance between a 2D point and an infinitely long 2D line defined by a point
and a direction.
|
static double |
distanceFromPoint2DToLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Returns the minimum distance between a 2D point and an infinitely long 2D line defined by two
points.
|
static double |
distanceFromPoint2DToLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Returns the minimum distance between a 2D point and an infinitely long 2D line defined by a point
and a direction.
|
static double |
distanceFromPoint2DToLineSegment2D(double pointX,
double pointY,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentEndX,
double lineSegmentEndY)
Returns the minimum distance between a point and a given line segment.
|
static double |
distanceFromPoint2DToLineSegment2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Returns the minimum distance between a point and a given line segment.
|
static double |
distanceFromPoint2DToLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Returns the minimum distance between a point and a given line segment.
|
static double |
distanceFromPoint2DToRay2D(double pointX,
double pointY,
double rayOriginX,
double rayOriginY,
double rayDirectionX,
double rayDirectionY)
Returns the minimum distance between a 2D point and a 2D ray defined by its origin and a
direction.
|
static double |
distanceFromPoint2DToRay2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection)
Returns the minimum distance between a 2D point and a 2D ray defined by its origin and a
direction.
|
static double |
distanceFromPoint2DToRay2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection)
Returns the minimum distance between a 2D point and a 2D ray defined by its origin and a
direction.
|
static double |
distanceFromPoint3DToLine3D(double pointX,
double pointY,
double pointZ,
double pointOnLineX,
double pointOnLineY,
double pointOnLineZ,
double lineDirectionX,
double lineDirectionY,
double lineDirectionZ)
Computes the minimum distance between a 3D point and an infinitely long 3D line defined by a
point and a direction.
|
static double |
distanceFromPoint3DToLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine)
Computes the minimum distance between a 3D point and an infinitely long 3D line defined by two
points.
|
static double |
distanceFromPoint3DToLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection)
Computes the minimum distance between a 3D point and an infinitely long 3D line defined by a
point and a direction.
|
static double |
distanceFromPoint3DToLineSegment3D(double pointX,
double pointY,
double pointZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Returns the minimum distance between a point and a given line segment.
|
static double |
distanceFromPoint3DToLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Returns the minimum distance between a point and a given line segment.
|
static double |
distanceFromPoint3DToPlane3D(double pointX,
double pointY,
double pointZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
Computes the minimum distance between a given point and a plane.
|
static double |
distanceFromPoint3DToPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
Computes the minimum distance between a given point and a plane.
|
static double |
distanceSquaredBetweenPoint2Ds(double firstPointX,
double firstPointY,
double secondPointX,
double secondPointY)
Calculates the square value of the distance between two points.
|
static double |
distanceSquaredBetweenPoint2Ds(double firstPointX,
double firstPointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPoint)
Calculates the square value of the distance between two points.
|
static double |
distanceSquaredBetweenPoint3Ds(double firstPointX,
double firstPointY,
double firstPointZ,
double secondPointX,
double secondPointY,
double secondPointZ)
Calculates the square value of the distance between two points.
|
static double |
distanceSquaredBetweenPoint3Ds(double firstPointX,
double firstPointY,
double firstPointZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPoint)
Calculates the square value of the distance between two points.
|
static double |
distanceSquaredFromPoint2DToLineSegment2D(double pointX,
double pointY,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentEndX,
double lineSegmentEndY)
Returns the square of the minimum distance between a point and a given line segment.
|
static double |
distanceSquaredFromPoint2DToLineSegment2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Returns the square of the minimum distance between a point and a given line segment.
|
static double |
distanceSquaredFromPoint3DToLineSegment3D(double pointX,
double pointY,
double pointZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Returns the square of the minimum distance between a point and a given line segment.
|
static double |
distanceSquaredFromPoint3DToLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Returns the square of the minimum distance between a point and a given line segment.
|
static boolean |
doesLineSegment3DIntersectPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Test if a given line segment intersects a given plane.
|
static boolean |
doLine2DAndLineSegment2DIntersect(double pointOnLineX,
double pointOnLineY,
double lineDirectionX,
double lineDirectionY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Tests if an intersection exists between an infinitely long 2D line (defined by a 2D point and a
2D direction) and a 2D line segment (defined by its two 2D endpoints).
|
static boolean |
doLine2DAndLineSegment2DIntersect(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Tests if an intersection exists between an infinitely long 2D line (defined by a 2D point and a
2D direction) and a 2D line segment (defined by its two 2D endpoints).
|
static boolean |
doLineSegment2DsIntersect(double lineSegmentStart1x,
double lineSegmentStart1y,
double lineSegmentEnd1x,
double lineSegmentEnd1y,
double lineSegmentStart2x,
double lineSegmentStart2y,
double lineSegmentEnd2x,
double lineSegmentEnd2y)
Test if two line segments intersect each other.
|
static boolean |
doLineSegment2DsIntersect(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart2,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd2)
Test if two line segments intersect each other.
|
static boolean |
doRay2DAndLineSegment2DIntersect(double rayOriginX,
double rayOriginY,
double rayDirectionX,
double rayDirectionY,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentEndX,
double lineSegmentEndY)
Tests if an intersection exists between a 2D ray and a 2D line segment.
|
static boolean |
doRay2DAndLineSegment2DIntersect(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Tests if an intersection exists between a 2D ray and a 2D line segment.
|
static double |
dotProduct(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly start1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly end1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly start2,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly end2)
Computes the dot product between two vectors each defined by two points:
vector1 = end1 - start1
vector2 = end2 - start2
|
static double |
dotProduct(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly start1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly end1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly start2,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly end2)
Computes the dot product between two vectors each defined by two points:
vector1 = end1 - start1
vector2 = end2 - start2
|
static int |
intersectionBetweenLine2DAndBoundingBox2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMin,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMax,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an axis-aligned
bounding box.
|
static int |
intersectionBetweenLine2DAndBoundingBox2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMin,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMax,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an axis-aligned
bounding box.
|
static boolean |
intersectionBetweenLine2DAndLineSegment2D(double pointOnLineX,
double pointOnLineY,
double lineDirectionX,
double lineDirectionY,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentEndX,
double lineSegmentEndY,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Computes the intersection between an infinitely long 2D line (defined by a 2D point and a 2D
direction) and a 2D line segment (defined by its two 2D endpoints).
|
static us.ihmc.euclid.tuple2D.Point2D |
intersectionBetweenLine2DAndLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Computes the intersection between an infinitely long 2D line (defined by a 2D point and a 2D
direction) and a 2D line segment (defined by its two 2D endpoints).
|
static boolean |
intersectionBetweenLine2DAndLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Computes the intersection between an infinitely long 2D line (defined by a 2D point and a 2D
direction) and a 2D line segment (defined by its two 2D endpoints).
|
static int |
intersectionBetweenLine3DAndBoundingBox3D(double boundingBoxMinX,
double boundingBoxMinY,
double boundingBoxMinZ,
double boundingBoxMaxX,
double boundingBoxMaxY,
double boundingBoxMaxZ,
double pointOnLineX,
double pointOnLineY,
double pointOnLineZ,
double lineDirectionX,
double lineDirectionY,
double lineDirectionZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an axis-aligned
bounding box.
|
static int |
intersectionBetweenLine3DAndBoundingBox3D(double boundingBoxMinX,
double boundingBoxMinY,
double boundingBoxMinZ,
double boundingBoxMaxX,
double boundingBoxMaxY,
double boundingBoxMaxZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an axis-aligned
bounding box.
|
static int |
intersectionBetweenLine3DAndBoundingBox3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMin,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMax,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an axis-aligned
bounding box.
|
static int |
intersectionBetweenLine3DAndBoundingBox3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMin,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMax,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an axis-aligned
bounding box.
|
static int |
intersectionBetweenLine3DAndCylinder3D(double cylinderBottomZ,
double cylinderTopZ,
double cylinderRadius,
double pointOnLineX,
double pointOnLineY,
double pointOnLineZ,
double lineDirectionX,
double lineDirectionY,
double lineDirectionZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and a cylinder.
|
static int |
intersectionBetweenLine3DAndCylinder3D(double cylinderBottomZ,
double cylinderTopZ,
double cylinderRadius,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and a cylinder.
|
static int |
intersectionBetweenLine3DAndCylinder3D(double cylinderBottomZ,
double cylinderTopZ,
double cylinderRadius,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and a cylinder.
|
static int |
intersectionBetweenLine3DAndEllipsoid3D(double radiusX,
double radiusY,
double radiusZ,
double pointOnLineX,
double pointOnLineY,
double pointOnLineZ,
double lineDirectionX,
double lineDirectionY,
double lineDirectionZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an ellipsoid.
|
static int |
intersectionBetweenLine3DAndEllipsoid3D(double radiusX,
double radiusY,
double radiusZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an ellipsoid.
|
static int |
intersectionBetweenLine3DAndEllipsoid3D(double radiusX,
double radiusY,
double radiusZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line and an ellipsoid.
|
static us.ihmc.euclid.tuple3D.Point3D |
intersectionBetweenLine3DAndPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection)
Computes the coordinates of the intersection between a plane and an infinitely long line.
|
static boolean |
intersectionBetweenLine3DAndPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics intersectionToPack)
Computes the coordinates of the intersection between a plane and an infinitely long line.
|
static int |
intersectionBetweenLineSegment2DAndBoundingBox2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMin,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMax,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line segment and an axis-aligned
bounding box.
|
static int |
intersectionBetweenLineSegment3DAndBoundingBox3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMin,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMax,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line segment and an axis-aligned
bounding box.
|
static int |
intersectionBetweenLineSegment3DAndCylinder3D(double cylinderBottomZ,
double cylinderTopZ,
double cylinderRadius,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line segment and a cylinder.
|
static int |
intersectionBetweenLineSegment3DAndEllipsoid3D(double radiusX,
double radiusY,
double radiusZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a line segment and an ellipsoid.
|
static us.ihmc.euclid.tuple3D.Point3D |
intersectionBetweenLineSegment3DAndPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Computes the coordinates of the intersection between a plane and a finite length line segment.
|
static int |
intersectionBetweenRay2DAndBoundingBox2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMin,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMax,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a ray and an axis-aligned bounding
box.
|
static boolean |
intersectionBetweenRay2DAndLineSegment2D(double rayOriginX,
double rayOriginY,
double rayDirectionX,
double rayDirectionY,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentEndX,
double lineSegmentEndY,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Computes the intersection between a 2D ray and a 2D line segment.
|
static us.ihmc.euclid.tuple2D.Point2D |
intersectionBetweenRay2DAndLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Computes the intersection between a 2D and a 2D line segment.
|
static boolean |
intersectionBetweenRay2DAndLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Computes the intersection between a 2D ray and a 2D line segment.
|
static int |
intersectionBetweenRay3DAndBoundingBox3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMin,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMax,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly rayOrigin,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly rayDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a ray and an axis-aligned bounding
box.
|
static int |
intersectionBetweenRay3DAndCylinder3D(double cylinderBottomZ,
double cylinderTopZ,
double cylinderRadius,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly rayOrigin,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly rayDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a ray and a cylinder.
|
static int |
intersectionBetweenRay3DAndEllipsoid3D(double radiusX,
double radiusY,
double radiusZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly rayOrigin,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly rayDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Computes the coordinates of the possible intersections between a ray and a ellipsoid.
|
static boolean |
intersectionBetweenTwoLine2Ds(double pointOnLine1x,
double pointOnLine1y,
double lineDirection1x,
double lineDirection1y,
double pointOnLine2x,
double pointOnLine2y,
double lineDirection2x,
double lineDirection2y,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Computes the intersection between two infinitely long 2D lines each defined by a 2D point and a
2D direction.
|
static us.ihmc.euclid.tuple2D.Point2D |
intersectionBetweenTwoLine2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine2,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine2)
Computes the intersection between two infinitely long 2D lines each defined by two 2D points.
|
static us.ihmc.euclid.tuple2D.Point2D |
intersectionBetweenTwoLine2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine2,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection2)
Computes the intersection between two infinitely long 2D lines each defined by a 2D point and a
2D direction.
|
static boolean |
intersectionBetweenTwoLine2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine2,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection2,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Computes the intersection between two infinitely long 2D lines each defined by a 2D point and a
2D direction.
|
static boolean |
intersectionBetweenTwoLineSegment2Ds(double lineSegmentStart1x,
double lineSegmentStart1y,
double lineSegmentEnd1x,
double lineSegmentEnd1y,
double lineSegmentStart2x,
double lineSegmentStart2y,
double lineSegmentEnd2x,
double lineSegmentEnd2y,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Computes the intersection between two 2D line segments each defined by their two 2D endpoints.
|
static us.ihmc.euclid.tuple2D.Point2D |
intersectionBetweenTwoLineSegment2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart2,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd2)
Computes the intersection between two 2D line segments each defined by their two 2D endpoints.
|
static boolean |
intersectionBetweenTwoLineSegment2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart2,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd2,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Computes the intersection between two 2D line segments each defined by their two 2D endpoints.
|
static boolean |
intersectionBetweenTwoPlane3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane1,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane2,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal2,
double angleThreshold,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics pointOnIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Vector3DBasics intersectionDirectionToPack)
This methods calculates the line of intersection between two planes each defined by a point and a
normal.
|
static boolean |
intersectionBetweenTwoPlane3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane1,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal1,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane2,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal2,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics pointOnIntersectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Vector3DBasics intersectionDirectionToPack)
This methods calculates the line of intersection between two planes each defined by a point and a
normal.
|
static boolean |
isFormingTriangle(double lengthSideA,
double lengthSideB,
double lengthSideC)
This methods verifies that the given set of three lengths represents a triangle.
|
static boolean |
isPoint2DInFrontOfRay2D(double pointX,
double pointY,
double rayOriginX,
double rayOriginY,
double rayDirectionX,
double rayDirectionY)
Determines if the query is exactly on or on the right side of the infinitely long line that goes
through the ray origin and which direction is perpendicular to the ray and directed towards the
left side.
|
static boolean |
isPoint2DInFrontOfRay2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection)
Determines if the query is exactly on or on the right side of the infinitely long line that goes
through the ray origin and which direction is perpendicular to the ray and directed towards the
left side.
|
static boolean |
isPoint2DInsideTriangleABC(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly a,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly b,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly c)
Returns
true only if the point is inside the triangle defined by the vertices a, b, and
c. |
static boolean |
isPoint2DOnLeftSideOfLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Returns a boolean value, stating whether a 2D point is on the left side of an infinitely long
line defined by two points.
|
static boolean |
isPoint2DOnLine2D(double pointX,
double pointY,
double pointOnLineX,
double pointOnLineY,
double lineDirectionX,
double lineDirectionY)
Tests if the point 2D is located on the infinitely long line 2D.
|
static boolean |
isPoint2DOnLine2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Tests if the point 2D is located on the infinitely long line 2D.
|
static boolean |
isPoint2DOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Tests if the point 2D is located on the infinitely long line 2D.
|
static boolean |
isPoint2DOnLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Tests if the point 2D is located on the infinitely long line 2D.
|
static boolean |
isPoint2DOnRightSideOfLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Returns a boolean value, stating whether a 2D point is on the right side of an infinitely long
line defined by two points.
|
static boolean |
isPoint2DOnSideOfLine2D(double pointX,
double pointY,
double pointOnLineX,
double pointOnLineY,
double lineDirectionX,
double lineDirectionY,
boolean testLeftSide)
Returns a boolean value, stating whether a 2D point is on the left or right side of an infinitely
long line.
|
static boolean |
isPoint2DOnSideOfLine2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine,
boolean testLeftSide)
Returns a boolean value, stating whether a 2D point is on the left or right side of an infinitely
long line defined by two points.
|
static boolean |
isPoint2DOnSideOfLine2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection,
boolean testLeftSide)
Returns a boolean value, stating whether a 2D point is on the left or right side of an infinitely
long line.
|
static boolean |
isPoint2DOnSideOfLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine,
boolean testLeftSide)
Returns a boolean value, stating whether a 2D point is on the left or right side of an infinitely
long line defined by two points.
|
static boolean |
isPoint2DOnSideOfLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection,
boolean testLeftSide)
Returns a boolean value, stating whether a 2D point is on the left or right side of an infinitely
long line.
|
static us.ihmc.euclid.tuple3D.Vector3D |
normal3DFromThreePoint3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly thirdPointOnPlane)
Computes the normal of a plane that is defined by three points.
|
static boolean |
normal3DFromThreePoint3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly thirdPointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DBasics normalToPack)
Computes the normal of a plane that is defined by three points.
|
static boolean |
orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
double pointOnLineX,
double pointOnLineY,
double lineDirectionX,
double lineDirectionY,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Computes the orthogonal projection of a 2D point on an infinitely long 2D line defined by a 2D
point and a 2D direction.
|
static us.ihmc.euclid.tuple2D.Point2D |
orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Computes the orthogonal projection of a 2D point on an infinitely long 2D line defined by a 2D
line segment.
|
static boolean |
orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Computes the orthogonal projection of a 2D point on an infinitely long 2D line defined by a 2D
line segment.
|
static us.ihmc.euclid.tuple2D.Point2D |
orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Computes the orthogonal projection of a 2D point on an infinitely long 2D line defined by a 2D
point and a 2D direction.
|
static boolean |
orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Computes the orthogonal projection of a 2D point on an infinitely long 2D line defined by a 2D
point and a 2D direction.
|
static boolean |
orthogonalProjectionOnLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject,
double pointOnLineX,
double pointOnLineY,
double pointOnLineZ,
double lineDirectionX,
double lineDirectionY,
double lineDirectionZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Computes the orthogonal projection of a 3D point on an infinitely long 3D line defined by a 3D
point and a 3D direction.
|
static us.ihmc.euclid.tuple3D.Point3D |
orthogonalProjectionOnLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection)
Computes the orthogonal projection of a 3D point on an infinitely long 3D line defined by a 3D
point and a 3D direction.
|
static boolean |
orthogonalProjectionOnLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Computes the orthogonal projection of a 3D point on an infinitely long 3D line defined by a 3D
point and a 3D direction.
|
static boolean |
orthogonalProjectionOnLineSegment2D(double pointToProjectX,
double pointToProjectY,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentEndX,
double lineSegmentEndY,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Computes the orthogonal projection of a 2D point on a given 2D line segment defined by its two 2D
endpoints.
|
static boolean |
orthogonalProjectionOnLineSegment2D(double pointToProjectX,
double pointToProjectY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Computes the orthogonal projection of a 2D point on a given 2D line segment defined by its two 2D
endpoints.
|
static boolean |
orthogonalProjectionOnLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentEndX,
double lineSegmentEndY,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Computes the orthogonal projection of a 2D point on a given 2D line segment defined by its two 2D
endpoints.
|
static us.ihmc.euclid.tuple2D.Point2D |
orthogonalProjectionOnLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Computes the orthogonal projection of a 2D point on a given 2D line segment defined by its two 2D
endpoints.
|
static boolean |
orthogonalProjectionOnLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Computes the orthogonal projection of a 2D point on a given 2D line segment defined by its two 2D
endpoints.
|
static boolean |
orthogonalProjectionOnLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentStartZ,
double lineSegmentEndX,
double lineSegmentEndY,
double lineSegmentEndZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Computes the orthogonal projection of a 3D point on a given 3D line segment defined by its two 3D
endpoints.
|
static us.ihmc.euclid.tuple3D.Point3D |
orthogonalProjectionOnLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Computes the orthogonal projection of a 3D point on a given 3D line segment defined by its two 3D
endpoints.
|
static boolean |
orthogonalProjectionOnLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Computes the orthogonal projection of a 3D point on a given 3D line segment defined by its two 3D
endpoints.
|
static boolean |
orthogonalProjectionOnPlane3D(double x,
double y,
double z,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Computes the orthogonal projection of a 3D point on a given 3D plane defined by a 3D point and 3D
normal.
|
static us.ihmc.euclid.tuple3D.Point3D |
orthogonalProjectionOnPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
Computes the orthogonal projection of a 3D point on a given 3D plane defined by a 3D point and 3D
normal.
|
static boolean |
orthogonalProjectionOnPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Computes the orthogonal projection of a 3D point on a given 3D plane defined by a 3D point and 3D
normal.
|
static double |
percentageAlongLineSegment2D(double pointX,
double pointY,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentEndX,
double lineSegmentEndY)
Computes a percentage along the line segment representing the location of the given point once
projected onto the line segment.
|
static double |
percentageAlongLineSegment2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Computes a percentage along the line segment representing the location of the projection onto the
line segment of the given point.
|
static double |
percentageAlongLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Computes a percentage along the line segment representing the location of the projection onto the
line segment of the given point.
|
static double |
percentageAlongLineSegment3D(double pointX,
double pointY,
double pointZ,
double lineSegmentStartX,
double lineSegmentStartY,
double lineSegmentStartZ,
double lineSegmentEndX,
double lineSegmentEndY,
double lineSegmentEndZ)
Computes a percentage along the line segment representing the location of the given point once
projected onto the line segment.
|
static double |
percentageAlongLineSegment3D(double pointX,
double pointY,
double pointZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Computes a percentage along the line segment representing the location of the projection onto the
line segment of the given point.
|
static double |
percentageAlongLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Computes a percentage along the line segment representing the location of the projection onto the
line segment of the given point.
|
static double |
percentageOfIntersectionBetweenLineSegment2DAndLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Computes the intersection between a 2D line segment and an infinitely long 2D line and returns a
percentage
alpha along the line segment such that the intersection coordinates can be
computed as follows: intersection = (1.0 - alpha) * lineSegmentStart + alpha * lineSegmentEnd |
static double |
percentageOfIntersectionBetweenTwoLine2Ds(double pointOnLine1x,
double pointOnLine1y,
double lineDirection1x,
double lineDirection1y,
double pointOnLine2x,
double pointOnLine2y,
double lineDirection2x,
double lineDirection2y)
Computes the intersection between two infinitely long 2D lines each defined by a 2D point and a
2D direction and returns a percentage
alpha along the first line such that the
intersection coordinates can be computed as follows: intersection = pointOnLine1 + alpha * lineDirection1 |
static double |
percentageOfIntersectionBetweenTwoLine2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine2,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection2)
Computes the intersection between two infinitely long 2D lines each defined by a 2D point and a
2D direction and returns a percentage
alpha along the first line such that the
intersection coordinates can be computed as follows: intersection = pointOnLine1 + alpha * lineDirection1 |
static boolean |
perpendicularBisector2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics bisectorStartToPack,
us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics bisectorDirectionToPack)
Computes the perpendicular bisector of line segment defined by its two endpoints.
|
static java.util.List<us.ihmc.euclid.tuple2D.Point2D> |
perpendicularBisectorSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
double bisectorSegmentHalfLength)
Computes the endpoints of the perpendicular bisector segment to a line segment defined by its
endpoints, such that:
each endpoint of the perpendicular bisector is at a distance of
bisectorSegmentHalfLength from the line segment. |
static boolean |
perpendicularBisectorSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd,
double bisectorSegmentHalfLength,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics bisectorSegmentStartToPack,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics bisectorSegmentEndToPack)
Computes the endpoints of the perpendicular bisector segment to a line segment defined by its
endpoints, such that:
each endpoint of the perpendicular bisector is at a distance of
bisectorSegmentHalfLength from the line segment. |
static us.ihmc.euclid.tuple2D.Vector2D |
perpendicularVector2D(us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly vector)
Computes the vector perpendicular to the given
vector such that:
vector.dot(perpendicularVector) == 0.0 . |
static void |
perpendicularVector2D(us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly vector,
us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics perpendicularVectorToPack)
Computes the vector perpendicular to the given
vector such that:
vector.dot(perpendicularVector) == 0.0 . |
static us.ihmc.euclid.tuple3D.Vector3D |
perpendicularVector3DFromLine3DToPoint3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics orthogonalProjectionToPack)
Computes the perpendicular defined by an infinitely long 3D line (defined by two 3D points) and a
3D point.
|
static boolean |
perpendicularVector3DFromLine3DToPoint3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics orthogonalProjectionToPack,
us.ihmc.euclid.tuple3D.interfaces.Vector3DBasics perpendicularVectorToPack)
Computes the perpendicular defined by an infinitely long 3D line (defined by two 3D points) and a
3D point.
|
static double |
pythagorasGetCathetus(double hypotenuseC,
double cathetusA)
Get a unknown cathetus (90-deg triangle one of the two shorter triangle sides, neighbouring the
90-degree angle) by Pythagoras law.
|
static double |
pythagorasGetHypotenuse(double cathetusA,
double cathetusB)
Get the hypotenuse c (90-degree triangle longest triangle length, opposite to the 90-degree
angle) by Pythagoras law, a^2+b^2=c^2
|
static double |
radiusOfArc(double chordLength,
double chordAngle)
Returns the radius of an arc with the specified chord length and angle.
|
static double |
signedDistanceFromPoint2DToLine2D(double pointX,
double pointY,
double pointOnLineX,
double pointOnLineY,
double lineDirectionX,
double lineDirectionY)
Returns the minimum signed distance between a 2D point and an infinitely long 2D line defined by
a point and a direction.
|
static double |
signedDistanceFromPoint2DToLine2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Returns the minimum signed distance between a 2D point and an infinitely long 2D line defined by
a point and a direction.
|
static double |
signedDistanceFromPoint2DToLine2D(double pointX,
double pointY,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Returns the minimum signed distance between a 2D point and an infinitely long 2D line defined by
a point and a direction.
|
static double |
signedDistanceFromPoint2DToLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Returns the minimum signed distance between a 2D point and an infinitely long 2D line defined by
a point and a direction.
|
static double |
signedDistanceFromPoint2DToLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine,
us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Returns the minimum signed distance between a 2D point and an infinitely long 2D line defined by
a point and a direction.
|
static double |
signedDistanceFromPoint3DToPlane3D(double pointX,
double pointY,
double pointZ,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
Computes the minimum signed distance between a given point and a plane.
|
static double |
signedDistanceFromPoint3DToPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
Computes the minimum signed distance between a given point and a plane.
|
static void |
topVertex3DOfIsoscelesTriangle3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly baseVertexA,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly baseVertexC,
us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly trianglePlaneNormal,
double ccwAngleAboutNormalAtTopVertex,
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics topVertexBToPack)
Assuming an isosceles triangle defined by three vertices A, B, and C, with |AB| == |BC|, this
methods computes the missing vertex B given the vertices A and C, the normal of the triangle, the
angle ABC that is equal to the angle at B from the the leg BA to the leg BC.
|
static double |
triangleArea(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly a,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly b,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly c)
Compute the area of a triangle defined by its three vertices: a, b, and c.
|
static us.ihmc.euclid.tuple2D.Point2D |
triangleBisector2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly A,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly B,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly C)
Given a triangle defined by three points (A,B,C), this methods the point X ∈ AC such that the
line (B, X) is the angle bisector of B.
|
static boolean |
triangleBisector2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly A,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly B,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly C,
us.ihmc.euclid.tuple2D.interfaces.Point2DBasics XToPack)
Given a triangle defined by three points (A,B,C), this methods the point X ∈ AC such that the
line (B, X) is the angle bisector of B.
|
static double |
unknownTriangleAngleByLawOfCosine(double lengthNeighbourSideA,
double lengthNeighbourSideB,
double lengthOppositeSideC)
Calculate an unknown angle of a fully defined 2D Triangle by the law of Cosine.
|
static double |
unknownTriangleSideLengthByLawOfCosine(double lengthSideA,
double lengthSideB,
double angleBetweenAAndB)
Calculate an unknown side length of a fully defined 2D Triangle by the law of Cosine.
|
public static final double ONE_MILLIONTH
public static final double ONE_TEN_MILLIONTH
public static final double ONE_TRILLIONTH
public static final double IS_POINT_ON_LINE_EPS
public static final double HALF_PI
public static double angleFromFirstToSecondVector2D(double firstVectorX, double firstVectorY, double secondVectorX, double secondVectorY)
firstVectorX
- x-component of the first vector. Not modified.firstVectorY
- y-component of the first vector. Not modified.secondVectorX
- x-component of the second vector. Not modified.secondVectorY
- y-component of the second vector. Not modified.public static double angleFromXForwardToVector2D(us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly vector)
xForward = (1.0, 0.0)
to the given 2D vector. The
computed angle is in the range [-pi; pi].vector
- the vector to compute the angle of. Not modified.public static double angleFromXForwardToVector2D(double vectorX, double vectorY)
xForward = (1.0, 0.0)
to the given 2D vector. The
computed angle is in the range [-pi; pi].vectorX
- x-component of the vector to compute the angle of.vectorY
- y-component of the vector to compute the angle of.public static double angleFromFirstToSecondVector3D(double firstVectorX, double firstVectorY, double firstVectorZ, double secondVectorX, double secondVectorY, double secondVectorZ)
firstVectorX
- x-component of first the vector.firstVectorY
- y-component of first the vector.firstVectorZ
- z-component of first the vector.secondVectorX
- x-component of second the vector.secondVectorY
- y-component of second the vector.secondVectorZ
- z-component of second the vector.public static boolean areLine2DsCollinear(double pointOnLine1x, double pointOnLine1y, double lineDirection1x, double lineDirection1y, double pointOnLine2x, double pointOnLine2y, double lineDirection2x, double lineDirection2y, double angleEpsilon, double distanceEpsilon)
true
if the two lines are collinear, whether they
are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method
fails and returns false
.
pointOnLine1x
- x-coordinate of a point located on the first line.pointOnLine1y
- y-coordinate of a point located on the first line.lineDirection1x
- x-component of the first line direction.lineDirection1y
- y-component of the first line direction.pointOnLine2x
- x-coordinate of a point located on the second line.pointOnLine2y
- y-coordinate of a point located on the second line.lineDirection2x
- x-component of the second line direction.lineDirection2y
- y-component of the second line direction.angleEpsilon
- tolerance on the angle in radians.distanceEpsilon
- tolerance on the distance to determine if pointOnLine2
belongs to
the first line segment.true
if the two line segments are collinear, false
otherwise.public static boolean areLine2DsCollinear(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine2, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine2, double angleEpsilon, double distanceEpsilon)
true
if the two lines are collinear, whether they
are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method
fails and returns false
.
firstPointOnLine1
- a first point located on the first line. Not modified.secondPointOnLine1
- a second point located on the first line. Not modified.firstPointOnLine2
- a first point located on the second line. Not modified.secondPointOnLine2
- a second point located on the second line. Not modified.angleEpsilon
- tolerance on the angle in radians.distanceEpsilon
- tolerance on the distance to determine if firstPointOnLine2
belongs to the first line segment.true
if the two line segments are collinear, false
otherwise.public static boolean areLine2DsCollinear(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine2, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine2, double angleEpsilon, double distanceEpsilon)
true
if the two lines are collinear, whether they
are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method
fails and returns false
.
pointOnLine1
- point located on the first line. Not modified.lineDirection1
- the first line direction. Not modified.firstPointOnLine2
- a first point located on the second line. Not modified.secondPointOnLine2
- a second point located on the second line. Not modified.angleEpsilon
- tolerance on the angle in radians.distanceEpsilon
- tolerance on the distance to determine if firstPointOnLine2
belongs to the first line segment.true
if the two line segments are collinear, false
otherwise.public static boolean areLine2DsCollinear(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine2, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection2, double angleEpsilon, double distanceEpsilon)
true
if the two lines are collinear, whether they
are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method
fails and returns false
.
pointOnLine1
- point located on the first line. Not modified.lineDirection1
- the first line direction. Not modified.pointOnLine2
- point located on the second line. Not modified.lineDirection2
- the second line direction. Not modified.angleEpsilon
- tolerance on the angle in radians.distanceEpsilon
- tolerance on the distance to determine if pointOnLine2
belongs to
the first line segment.true
if the two line segments are collinear, false
otherwise.public static boolean areLine3DsCollinear(double pointOnLine1x, double pointOnLine1y, double pointOnLine1z, double lineDirection1x, double lineDirection1y, double lineDirection1z, double pointOnLine2x, double pointOnLine2y, double pointOnLine2z, double lineDirection2x, double lineDirection2y, double lineDirection2z, double angleEpsilon, double distanceEpsilon)
true
if the two lines are collinear, whether they
are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method
fails and returns false
.
pointOnLine1x
- x-coordinate of a point located on the first line.pointOnLine1y
- y-coordinate of a point located on the first line.pointOnLine1z
- z-coordinate of a point located on the first line.lineDirection1x
- x-component of the first line direction.lineDirection1y
- y-component of the first line direction.lineDirection1z
- z-component of the first line direction.pointOnLine2x
- x-coordinate of a point located on the second line.pointOnLine2y
- y-coordinate of a point located on the second line.pointOnLine2z
- z-coordinate of a point located on the second line.lineDirection2x
- x-component of the second line direction.lineDirection2y
- y-component of the second line direction.lineDirection2z
- z-component of the second line direction.angleEpsilon
- tolerance on the angle in radians.distanceEpsilon
- tolerance on the distance to determine if pointOnLine2
belongs to
the first line segment.true
if the two line segments are collinear, false
otherwise.public static boolean areLine3DsCollinear(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine2, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine2, double angleEpsilon, double distanceEpsilon)
true
if the two lines are collinear, whether they
are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method
fails and returns false
.
firstPointOnLine1
- a first point located on the first line. Not modified.secondPointOnLine1
- a second point located on the first line. Not modified.firstPointOnLine2
- a first point located on the second line. Not modified.secondPointOnLine2
- a second point located on the second line. Not modified.angleEpsilon
- tolerance on the angle in radians.distanceEpsilon
- tolerance on the distance to determine if firstPointOnLine2
belongs to the first line segment.true
if the two line segments are collinear, false
otherwise.public static boolean areLine3DsCollinear(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine1, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine2, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection2, double angleEpsilon, double distanceEpsilon)
true
if the two lines are collinear, whether they
are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method
fails and returns false
.
pointOnLine1
- point located on the first line. Not modified.lineDirection1
- the first line direction. Not modified.pointOnLine2
- point located on the second line. Not modified.lineDirection2
- the second line direction. Not modified.angleEpsilon
- tolerance on the angle in radians.distanceEpsilon
- tolerance on the distance to determine if pointOnLine2
belongs to
the first line segment.true
if the two line segments are collinear, false
otherwise.public static boolean arePlane3DsCoincident(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane1, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane2, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal2, double angleEpsilon, double distanceEpsilon)
planeNormal1
and planeNormal2
are parallel given the tolerance
angleEpsilon
.
pointOnPlane2
from the first plane is less than
distanceEpsilon
.
Edge cases:
ONE_TEN_MILLIONTH
, this method fails and
returns false
.
pointOnPlane1
- a point on the first plane. Not modified.planeNormal1
- the normal of the first plane. Not modified.pointOnPlane2
- a point on the second plane. Not modified.planeNormal2
- the normal of the second plane. Not modified.angleEpsilon
- tolerance on the angle in radians to determine if the plane normals are
parallel.distanceEpsilon
- tolerance on the distance to determine if pointOnPlane2
belongs to
the first plane.true
if the two planes are coincident, false
otherwise.public static boolean areVector2DsParallel(double firstVectorX, double firstVectorY, double secondVectorX, double secondVectorY, double angleEpsilon)
true
if the two vectors are
parallel, whether they are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method fails and
returns false
.
firstVectorX
- x-component of the first vector. Not modified.firstVectorY
- y-component of the first vector. Not modified.secondVectorX
- x-component of the second vector. Not modified.secondVectorY
- y-component of the second vector. Not modified.angleEpsilon
- tolerance on the angle in radians.true
if the two vectors are parallel, false
otherwise.public static boolean areVector2DsParallel(us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly firstVector, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly secondVector, double angleEpsilon)
true
if the two vectors are
parallel, whether they are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method fails and
returns false
.
firstVector
- the first vector. Not modified.secondVector
- the second vector. Not modified.angleEpsilon
- tolerance on the angle in radians.true
if the two vectors are parallel, false
otherwise.public static boolean areVector3DsParallel(double firstVectorX, double firstVectorY, double firstVectorZ, double secondVectorX, double secondVectorY, double secondVectorZ, double angleEpsilon)
true
if the two vectors are
parallel, whether they are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method fails and
returns false
.
firstVectorX
- x-component of the first vector. Not modified.firstVectorY
- y-component of the first vector. Not modified.firstVectorZ
- z-component of the first vector. Not modified.secondVectorX
- x-component of the second vector. Not modified.secondVectorY
- y-component of the second vector. Not modified.secondVectorZ
- z-component of the second vector. Not modified.angleEpsilon
- tolerance on the angle in radians.true
if the two vectors are parallel, false
otherwise.public static boolean areVector3DsParallel(us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly firstVector, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly secondVector, double angleEpsilon)
true
if the two vectors are
parallel, whether they are pointing in the same direction or in opposite directions.
Edge cases:
ONE_TEN_MILLIONTH
, this method fails and
returns false
.
firstVector
- the first vector. Not modified.secondVector
- the second vector. Not modified.angleEpsilon
- tolerance on the angle in radians.true
if the two vectors are parallel, false
otherwise.public static us.ihmc.euclid.tuple2D.Point2D averagePoint2Ds(java.util.Collection<? extends us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly> points)
WARNING: This method generates garbage.
points
- the collection of 2D points to compute the average from. Not modified.public static us.ihmc.euclid.tuple3D.Point3D averagePoint3Ds(java.util.Collection<? extends us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly> points)
WARNING: This method generates garbage.
points
- the collection of 3D points to compute the average from. Not modified.public static us.ihmc.euclid.tuple3D.Point3D averagePoint3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly a, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly b)
WARNING: This method generates garbage.
a
- the first 3D point. Not modified.b
- the second 3D point. Not modified.public static void axisAngleFromFirstToSecondVector3D(double firstVectorX, double firstVectorY, double firstVectorZ, double secondVectorX, double secondVectorY, double secondVectorZ, us.ihmc.euclid.axisAngle.interfaces.AxisAngleBasics rotationToPack)
firstVector
to the secondVector
and
packs it into an AxisAngle
. The rotation axis if perpendicular to both vectors. The
rotation angle is computed as the angle from the firstVector
to the secondVector
:
rotationAngle = firstVector.angle(secondVector)
.
Note: the vectors do not need to be unit length.
Edge cases:
0.0
and the rotation axis is
set to: (1, 0, 0).
Math.PI
and the rotation axis is set to: (1, 0, 0).
ONE_TEN_MILLIONTH
: the rotation angle is
equal to 0.0
and the rotation axis is set to: (1, 0, 0).
Note: The calculation becomes less accurate as the two vectors are more parallel.
firstVectorX
- x-component of the first vector.firstVectorY
- y-component of the first vector.firstVectorZ
- z-component of the first vector.secondVectorX
- x-component of the second vector that is rotated with respect to the first
vector.secondVectorY
- y-component of the second vector that is rotated with respect to the first
vector.secondVectorZ
- z-component of the second vector that is rotated with respect to the first
vector.rotationToPack
- the minimum rotation from firstVector
to the secondVector
.
Modified.public static void axisAngleFromFirstToSecondVector3D(us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly firstVector, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly secondVector, us.ihmc.euclid.axisAngle.interfaces.AxisAngleBasics rotationToPack)
firstVector
to the secondVector
and
packs it into an AxisAngle
. The rotation axis if perpendicular to both vectors. The
rotation angle is computed as the angle from the firstVector
to the secondVector
:
rotationAngle = firstVector.angle(secondVector)
.
Note: the vectors do not need to be unit length.
Edge cases:
0.0
and the rotation axis is
set to: (1, 0, 0).
Math.PI
and the rotation axis is set to: (1, 0, 0).
1.0E-7
: the rotation angle is equal to
0.0
and the rotation axis is set to: (1, 0, 0).
Note: The calculation becomes less accurate as the two vectors are more parallel.
firstVector
- the first vector. Not modified.secondVector
- the second vector that is rotated with respect to the first vector. Not
modified.rotationToPack
- the minimum rotation from firstVector
to the secondVector
.
Modified.public static us.ihmc.euclid.axisAngle.AxisAngle axisAngleFromZUpToVector3D(us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly vector)
zUp = (0, 0, 1)
to the given vector
and packs it into an AxisAngle
. The rotation axis if perpendicular to both vectors. The
rotation angle is computed as the angle from the zUp
to the vector
: rotationAngle = zUp.angle(vector)
.
Note: the vector does not need to be unit length.
Edge cases:
zUp
: the rotation angle is equal to 0.0
and the
rotation axis is set to: (1, 0, 0).
zUp
: the rotation angle is
equal to Math.PI
and the rotation axis is set to: (1, 0, 0).
1.0E-7
: the rotation angle is equal to
0.0
and the rotation axis is set to: (1, 0, 0).
Note: The calculation becomes less accurate as the two vectors are more parallel.
WARNING: This method generates garbage.
vector
- the 3D vector that is rotated with respect to zUp
. Not modified.zUp
to the given vector
.public static void axisAngleFromZUpToVector3D(us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly vector, us.ihmc.euclid.axisAngle.interfaces.AxisAngleBasics rotationToPack)
zUp = (0, 0, 1)
to the given vector
and packs it into an AxisAngle
. The rotation axis if perpendicular to both vectors. The
rotation angle is computed as the angle from the zUp
to the vector
: rotationAngle = zUp.angle(vector)
.
Note: the vector does not need to be unit length.
Edge cases:
zUp
: the rotation angle is equal to 0.0
and the
rotation axis is set to: (1, 0, 0).
zUp
: the rotation angle is
equal to Math.PI
and the rotation axis is set to: (1, 0, 0).
1.0E-7
: the rotation angle is equal to
0.0
and the rotation axis is set to: (1, 0, 0).
Note: The calculation becomes less accurate as the two vectors are more parallel.
vector
- the vector that is rotated with respect to zUp
. Not modified.rotationToPack
- the minimum rotation from zUp
to the given vector
.
Modified.public static double closestPoint3DsBetweenTwoLine3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine1, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine2, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection2, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics closestPointOnLine1ToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics closestPointOnLine2ToPack)
pointOnLine1
- a 3D point on the first line. Not modified.lineDirection1
- the 3D direction of the first line. Not modified.pointOnLine2
- a 3D point on the second line. Not modified.lineDirection2
- the 3D direction of the second line. Not modified.closestPointOnLine1ToPack
- the 3D coordinates of the point P are packed in this 3D point.
Modified. Can be null
.closestPointOnLine2ToPack
- the 3D coordinates of the point Q are packed in this 3D point.
Modified. Can be null
.public static double closestPoint3DsBetweenTwoLineSegment3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart2, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd2, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics closestPointOnLineSegment1ToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics closestPointOnLineSegment2ToPack)
lineSegmentStart1
- the first endpoint of the first line segment. Not modified.lineSegmentEnd1
- the second endpoint of the first line segment. Not modified.lineSegmentStart2
- the first endpoint of the second line segment. Not modified.lineSegmentEnd2
- the second endpoint of the second line segment. Not modified.closestPointOnLineSegment1ToPack
- the 3D coordinates of the point P are packed in this 3D
point. Modified. Can be null
.closestPointOnLineSegment2ToPack
- the 3D coordinates of the point Q are packed in this 3D
point. Modified. Can be null
.public static double triangleArea(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly a, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly b, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly c)
a
- first vertex of the triangle. Not modified.b
- second vertex of the triangle. Not modified.c
- third vertex of the triangle. Not modified.public static double distanceBetweenPoint2Ds(double firstPointX, double firstPointY, double secondPointX, double secondPointY)
firstPointX
- the x-coordinate of the first point.firstPointY
- the y-coordinate of the first point.secondPointX
- the x-coordinate of the second point.secondPointY
- the y-coordinate of the second point.public static double distanceBetweenPoint2Ds(double firstPointX, double firstPointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPoint)
firstPointX
- the x-coordinate of the first point.firstPointY
- the y-coordinate of the first point.secondPoint
- the coordinates of the second point. Not modified.public static double distanceSquaredBetweenPoint2Ds(double firstPointX, double firstPointY, double secondPointX, double secondPointY)
firstPointX
- the x-coordinate of the first point.firstPointY
- the y-coordinate of the first point.secondPointX
- the x-coordinate of the second point.secondPointY
- the y-coordinate of the second point.public static double distanceSquaredBetweenPoint2Ds(double firstPointX, double firstPointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPoint)
firstPointX
- the x-coordinate of the first point.firstPointY
- the y-coordinate of the first point.secondPoint
- the coordinates of the second point. Not modified.public static double distanceBetweenPoint3Ds(double firstPointX, double firstPointY, double firstPointZ, double secondPointX, double secondPointY, double secondPointZ)
firstPointX
- the x-coordinate of the first point.firstPointY
- the y-coordinate of the first point.firstPointZ
- the z-coordinate of the first point.secondPointX
- the x-coordinate of the second point.secondPointY
- the y-coordinate of the second point.secondPointZ
- the z-coordinate of the second point.public static double distanceBetweenPoint3Ds(double firstPointX, double firstPointY, double firstPointZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPoint)
firstPointX
- the x-coordinate of the first point.firstPointY
- the y-coordinate of the first point.firstPointZ
- the z-coordinate of the first point.secondPoint
- the coordinates of the second point. Not modified.public static double distanceSquaredBetweenPoint3Ds(double firstPointX, double firstPointY, double firstPointZ, double secondPointX, double secondPointY, double secondPointZ)
firstPointX
- the x-coordinate of the first point.firstPointY
- the y-coordinate of the first point.firstPointZ
- the z-coordinate of the first point.secondPointX
- the x-coordinate of the second point.secondPointY
- the y-coordinate of the second point.secondPointZ
- the z-coordinate of the second point.public static double distanceSquaredBetweenPoint3Ds(double firstPointX, double firstPointY, double firstPointZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPoint)
firstPointX
- the x-coordinate of the first point.firstPointY
- the y-coordinate of the first point.firstPointZ
- the z-coordinate of the first point.secondPoint
- the coordinates of the second point. Not modified.public static double distanceBetweenTwoLine3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine1, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine2, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection2)
pointOnLine1
- a 3D point on the first line. Not modified.lineDirection1
- the 3D direction of the first line. Not modified.pointOnLine2
- a 3D point on the second line. Not modified.lineDirection2
- the 3D direction of the second line. Not modified.public static double distanceBetweenTwoLineSegment3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart2, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd2)
lineSegmentStart1
- the first endpoint of the first line segment. Not modified.lineSegmentEnd1
- the second endpoint of the first line segment. Not modified.lineSegmentStart2
- the first endpoint of the second line segment. Not modified.lineSegmentEnd2
- the second endpoint of the second line segment. Not modified.public static double distanceFromPoint2DToLine2D(double pointX, double pointY, double pointOnLineX, double pointOnLineY, double lineDirectionX, double lineDirectionY)
Edge cases:
lineDirection.length() <
1.0E-12, this method returns the
distance between pointOnLine
and the given point
.
pointX
- x-coordinate of the query.pointY
- y-coordinate of the query.pointOnLineX
- x-coordinate of a point located on the line.pointOnLineY
- y-coordinate of a point located on the line.lineDirectionX
- x-component of the line direction.lineDirectionY
- y-component of the line direction.public static double distanceFromPoint2DToLine2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Edge cases:
firstPointOnLine.distance(secondPointOnLine) <
1.0E-12, this
method returns the distance between firstPointOnLine
and the given point
.
pointX
- x-coordinate of the query.pointY
- y-coordinate of the query.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.public static double distanceFromPoint2DToLine2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Edge cases:
lineDirection.length() <
1.0E-12, this method returns the
distance between pointOnLine
and the given point
.
pointX
- x-coordinate of the query.pointY
- y-coordinate of the query.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.public static double distanceFromPoint2DToLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Edge cases:
firstPointOnLine.distance(secondPointOnLine) <
1.0E-12, this
method returns the distance between firstPointOnLine
and the given point
.
point
- 2D point to compute the distance from the line. Not modified.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.public static double distanceFromPoint2DToLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Edge cases:
lineDirection.length() <
1.0E-12, this method returns the
distance between pointOnLine
and the given point
.
point
- 2D point to compute the distance from the line. Not modified.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.public static double distanceFromPoint2DToLineSegment2D(double pointX, double pointY, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentEndX, double lineSegmentEndY)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
pointX
- x coordinate of point to be tested.pointY
- y coordinate of point to be tested.lineSegmentStartX
- the x-coordinate of the line segment first endpoint.lineSegmentStartY
- the y-coordinate of the line segment first endpoint.lineSegmentEndX
- the x-coordinate of the line segment second endpoint.lineSegmentEndY
- the y-coordinate of the line segment second endpoint.public static double distanceFromPoint2DToLineSegment2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
pointX
- x coordinate of point to be tested.pointY
- y coordinate of point to be tested.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.public static double distanceFromPoint2DToLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
point
- 2D point to compute the distance from the line segment. Not modified.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.public static double distanceFromPoint2DToRay2D(double pointX, double pointY, double rayOriginX, double rayOriginY, double rayDirectionX, double rayDirectionY)
When the query is located in front of the ray, this is equivalent to calculating the distance from the query to the line that is collinear with the ray. When the query is located behind the ray's origin, this is equivalent to calculating the distance between the query and the origin of the ray.
Edge cases:
rayDirection.length() <
1.0E-12, this method returns the distance
between rayOrigin
and the given point
.
pointX
- x-coordinate of the query.pointY
- y-coordinate of the query.rayOriginX
- x-coordinate of the ray origin.rayOriginY
- y-coordinate of the ray origin.rayDirectionX
- x-component of the ray direction.rayDirectionY
- y-component of the ray direction.public static double distanceFromPoint2DToRay2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection)
When the query is located in front of the ray, this is equivalent to calculating the distance from the query to the line that is collinear with the ray. When the query is located behind the ray's origin, this is equivalent to calculating the distance between the query and the origin of the ray.
Edge cases:
rayDirection.length() <
1.0E-12, this method returns the distance
between rayOrigin
and the given point
.
pointX
- x-coordinate of the query.pointY
- y-coordinate of the query.rayOrigin
- a point located on the line. Not modified.rayDirection
- the direction of the line. Not modified.public static double distanceFromPoint2DToRay2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection)
When the query is located in front of the ray, this is equivalent to calculating the distance from the query to the line that is collinear with the ray. When the query is located behind the ray's origin, this is equivalent to calculating the distance between the query and the origin of the ray.
Edge cases:
rayDirection.length() <
1.0E-12, this method returns the distance
between rayOrigin
and the given point
.
point
- the coordinates of the query.rayOrigin
- a point located on the line. Not modified.rayDirection
- the direction of the line. Not modified.public static double distanceFromPoint3DToLine3D(double pointX, double pointY, double pointZ, double pointOnLineX, double pointOnLineY, double pointOnLineZ, double lineDirectionX, double lineDirectionY, double lineDirectionZ)
Edge cases:
lineDirection.length() <
1.0E-12, this method returns the
distance between pointOnLine
and the given point
.
pointX
- x-coordinate of the 3D point to compute the distance from the line. Not modified.pointY
- y-coordinate of the 3D point to compute the distance from the line. Not modified.pointZ
- z-coordinate of the 3D point to compute the distance from the line. Not modified.pointOnLineX
- x-coordinate of a point located on the line.pointOnLineY
- y-coordinate of a point located on the line.pointOnLineZ
- z-coordinate of a point located on the line.lineDirectionX
- x-component of the line direction.lineDirectionY
- y-component of the line direction.lineDirectionZ
- z-component of the line direction.public static double distanceFromPoint3DToLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine)
Edge cases:
firstPointOnLine.distance(secondPointOnLine) <
1.0E-12, this
method returns the distance between firstPointOnLine
and the given point
.
point
- 3D point to compute the distance from the line. Not modified.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.public static double distanceFromPoint3DToLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection)
Edge cases:
lineDirection.length() <
1.0E-12, this method returns the
distance between pointOnLine
and the given point
.
point
- 3D point to compute the distance from the line. Not modified.pointOnLine
- point located on the line. Not modified.lineDirection
- direction of the line. Not modified.public static double distanceFromPoint3DToLineSegment3D(double pointX, double pointY, double pointZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
pointX
- x-coordinate of point to be tested.pointY
- y-coordinate of point to be tested.pointZ
- z-coordinate of point to be tested.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.public static double distanceFromPoint3DToLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
point
- 3D point to compute the distance from the line segment. Not modified.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.public static double distanceFromPoint3DToPlane3D(double pointX, double pointY, double pointZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
pointX
- the x-coordinate of the query. Not modified.pointY
- the y-coordinate of the query. Not modified.pointZ
- the z-coordinate of the query. Not modified.pointOnPlane
- a point located on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.public static double distanceFromPoint3DToPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
point
- the 3D query. Not modified.pointOnPlane
- a point located on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.public static double signedDistanceFromPoint3DToPlane3D(double pointX, double pointY, double pointZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
The returned value is negative when the query is located below the plane, positive otherwise.
pointX
- the x-coordinate of the query. Not modified.pointY
- the y-coordinate of the query. Not modified.pointZ
- the z-coordinate of the query. Not modified.pointOnPlane
- a point located on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.public static double signedDistanceFromPoint3DToPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
The returned value is negative when the query is located below the plane, positive otherwise.
point
- the query. Not modified.pointOnPlane
- a point located on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.public static double distanceSquaredFromPoint2DToLineSegment2D(double pointX, double pointY, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentEndX, double lineSegmentEndY)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
pointX
- x coordinate of point to be tested.pointY
- y coordinate of point to be tested.lineSegmentStartX
- the x-coordinate of the line segment first endpoint.lineSegmentStartY
- the y-coordinate of the line segment first endpoint.lineSegmentEndX
- the x-coordinate of the line segment second endpoint.lineSegmentEndY
- the y-coordinate of the line segment second endpoint.public static double distanceSquaredFromPoint2DToLineSegment2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
pointX
- x coordinate of point to be tested.pointY
- y coordinate of point to be tested.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.public static double distanceSquaredFromPoint3DToLineSegment3D(double pointX, double pointY, double pointZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
pointX
- x-coordinate of point to be tested.pointY
- y-coordinate of point to be tested.pointZ
- z-coordinate of point to be tested.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.public static double distanceSquaredFromPoint3DToLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this
method returns the distance between lineSegmentStart
and the given point
.
point
- 3D point to compute the distance from the line segment. Not modified.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.public static boolean doesLineSegment3DIntersectPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Edge cases:
false
whether the endpoints
are on the plane or not.
pointOnPlane
- a point located on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.true
if an intersection line segment - plane exists, false
otherwise.public static boolean doLine2DAndLineSegment2DIntersect(double pointOnLineX, double pointOnLineY, double lineDirectionX, double lineDirectionY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
true
and the endpoint is the intersection.
pointOnLineX
- the x-coordinate of a point located on the line.pointOnLineY
- the y-coordinate of a point located on the line.lineDirectionX
- the x-component of the line direction.lineDirectionY
- the y-component of the line direction.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.true
if the line intersects the line segment, false
otherwise.public static boolean doLine2DAndLineSegment2DIntersect(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
true
and the endpoint is the intersection.
pointOnLine
- a point located on the line. Not modified.lineDirection
- the line direction. Not modified.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.true
if the line intersects the line segment, false
otherwise.public static boolean doLineSegment2DsIntersect(double lineSegmentStart1x, double lineSegmentStart1y, double lineSegmentEnd1x, double lineSegmentEnd1y, double lineSegmentStart2x, double lineSegmentStart2y, double lineSegmentEnd2x, double lineSegmentEnd2y)
Edge cases:
true
only if the two
line segments overlap or have at least one common endpoint.
lineSegmentStart1x
- x-coordinate of the first endpoint of the first line segment.lineSegmentStart1y
- y-coordinate of the first endpoint of the first line segment.lineSegmentEnd1x
- x-coordinate of the second endpoint of the first line segment.lineSegmentEnd1y
- y-coordinate of the second endpoint of the first line segment.lineSegmentStart2x
- x-coordinate of the first endpoint of the second line segment.lineSegmentStart2y
- y-coordinate of the first endpoint of the second line segment.lineSegmentEnd2x
- x-coordinate of the second endpoint of the second line segment.lineSegmentEnd2y
- y-coordinate of the second endpoint of the second line segment.true
if the two line segments intersect, false
otherwise.public static boolean doLineSegment2DsIntersect(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart2, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd2)
Edge cases:
true
only if the two
line segments overlap or have at least one common endpoint.
lineSegmentStart1
- first endpoint of the first line segment. Not modified.lineSegmentEnd1
- second endpoint of the first line segment. Not modified.lineSegmentStart2
- first endpoint of the second line segment. Not modified.lineSegmentEnd2
- second endpoint of the second line segment. Not modified.true
if the two line segments intersect, false
otherwise.public static boolean doRay2DAndLineSegment2DIntersect(double rayOriginX, double rayOriginY, double rayDirectionX, double rayDirectionY, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentEndX, double lineSegmentEndY)
Edge cases:
true
and the endpoint is the intersection.
rayOriginX
- the x-coordinate of a point located on the ray. Not modified.rayOriginY
- the y-coordinate of a point located on the ray. Not modified.rayDirectionX
- the x-component of the direction of the ray. Not modified.rayDirectionY
- the y-component of the direction of the ray. Not modified.lineSegmentStartX
- the x-coordinate of the first endpoint of the line segment.lineSegmentStartY
- the y-coordinate of the first endpoint of the line segment.lineSegmentEndX
- the x-coordinate of the second endpoint of the line segment.lineSegmentEndY
- the y-coordinate of the second endpoint of the line segment.true
if the ray and line segment intersect, false
otherwise.public static boolean doRay2DAndLineSegment2DIntersect(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
true
and the endpoint is the intersection.
rayOrigin
- a point located on the ray. Not modified.rayDirection
- the direction of the ray. Not modified.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.true
if the ray and line segment intersect, false
otherwise.public static double dotProduct(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly start1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly end1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly start2, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly end2)
vector1 = end1 - start1
vector2 = end2 - start2
start1
- the origin of the first vector. Not modified.end1
- the end of the first vector. Not modified.start2
- the origin of the second vector. Not modified.end2
- the end of the second vector. Not modified.public static double dotProduct(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly start1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly end1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly start2, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly end2)
vector1 = end1 - start1
vector2 = end2 - start2
start1
- the origin of the first vector. Not modified.end1
- the end of the first vector. Not modified.start2
- the origin of the second vector. Not modified.end2
- the end of the second vector. Not modified.public static int intersectionBetweenLine2DAndBoundingBox2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMin, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMax, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
Intersections between the line and the bounding box are not restricted to exist between the two given points defining the line.
In the case the line and the bounding box do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
boundingBoxMin
- the minimum coordinate of the bounding box. Not modified.boundingBoxMax
- the maximum coordinate of the bounding box. Not modified.firstPointOnLine
- a first point located on the infinitely long line. Not modified.secondPointOnLine
- a second point located on the infinitely long line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static int intersectionBetweenLine2DAndBoundingBox2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMin, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMax, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
In the case the line and the bounding box do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
boundingBoxMin
- the minimum coordinate of the bounding box. Not modified.boundingBoxMax
- the maximum coordinate of the bounding box. Not modified.pointOnLine
- a point located on the infinitely long line. Not modified.lineDirection
- the direction of the line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static boolean intersectionBetweenLine2DAndLineSegment2D(double pointOnLineX, double pointOnLineY, double lineDirectionX, double lineDirectionY, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentEndX, double lineSegmentEndY, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Edge cases:
lineSegmentStart
.
true
and the endpoint is the intersection.
false
and
intersectionToPack
is set to Double.NaN
.
pointOnLineX
- x-coordinate of a point located on the line.pointOnLineY
- y-coordinate of a point located on the line.lineDirectionX
- x-component of the line direction.lineDirectionY
- y-component of the line direction.lineSegmentStartX
- x-coordinate of the first endpoint of the line segment.lineSegmentStartY
- y-coordinate of the first endpoint of the line segment.lineSegmentEndX
- x-coordinate of the second endpoint of the line segment.lineSegmentEndY
- y-coordinate of the second endpoint of the line segment.intersectionToPack
- the 2D point in which the result is stored. Can be null
.
Modified.true
if the line intersects the line segment, false
otherwise.public static us.ihmc.euclid.tuple2D.Point2D intersectionBetweenLine2DAndLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
null
.
lineSegmentStart
.
WARNING: This method generates garbage.
pointOnLine
- a point located on the line. Not modified.lineDirection
- the line direction. Not modified.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.null
otherwise.public static boolean intersectionBetweenLine2DAndLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Edge cases:
lineSegmentStart
.
true
and the endpoint is the intersection.
false
and
intersectionToPack
is set to Double.NaN
.
pointOnLine
- a point located on the line. Not modified.lineDirection
- the line direction. Not modified.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.intersectionToPack
- the 2D point in which the result is stored. Can be null
.
Modified.true
if the line intersects the line segment, false
otherwise.public static int intersectionBetweenLine3DAndBoundingBox3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMin, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMax, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Intersections between the line and the bounding box are not restricted to exist between the two given points defining the line.
In the case the line and the bounding box do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
boundingBoxMin
- the minimum coordinate of the bounding box. Not modified.boundingBoxMax
- the maximum coordinate of the bounding box. Not modified.firstPointOnLine
- a first point located on the infinitely long line. Not modified.secondPointOnLine
- a second point located on the infinitely long line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static int intersectionBetweenLine3DAndBoundingBox3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMin, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMax, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
In the case the line and the bounding box do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
boundingBoxMin
- the minimum coordinate of the bounding box. Not modified.boundingBoxMax
- the maximum coordinate of the bounding box. Not modified.pointOnLine
- a point located on the infinitely long line. Not modified.lineDirection
- the direction of the line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static int intersectionBetweenLine3DAndBoundingBox3D(double boundingBoxMinX, double boundingBoxMinY, double boundingBoxMinZ, double boundingBoxMaxX, double boundingBoxMaxY, double boundingBoxMaxZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
In the case the line and the bounding box do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
boundingBoxMinX
- the minimum x-coordinate of the bounding box.boundingBoxMinY
- the minimum y-coordinate of the bounding box.boundingBoxMinZ
- the minimum z-coordinate of the bounding box.boundingBoxMaxX
- the maximum x-coordinate of the bounding box.boundingBoxMaxY
- the maximum y-coordinate of the bounding box.boundingBoxMaxZ
- the maximum z-coordinate of the bounding box.pointOnLine
- a point located on the infinitely long line. Not modified.lineDirection
- the direction of the line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static int intersectionBetweenLine3DAndBoundingBox3D(double boundingBoxMinX, double boundingBoxMinY, double boundingBoxMinZ, double boundingBoxMaxX, double boundingBoxMaxY, double boundingBoxMaxZ, double pointOnLineX, double pointOnLineY, double pointOnLineZ, double lineDirectionX, double lineDirectionY, double lineDirectionZ, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
In the case the line and the bounding box do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
boundingBoxMinX
- the minimum x-coordinate of the bounding box.boundingBoxMinY
- the minimum y-coordinate of the bounding box.boundingBoxMinZ
- the minimum z-coordinate of the bounding box.boundingBoxMaxX
- the maximum x-coordinate of the bounding box.boundingBoxMaxY
- the maximum y-coordinate of the bounding box.boundingBoxMaxZ
- the maximum z-coordinate of the bounding box.pointOnLineX
- the x-coordinate of a point located on the infinitely long line.pointOnLineY
- the y-coordinate of a point located on the infinitely long line.pointOnLineZ
- the z-coordinate of a point located on the infinitely long line.lineDirectionX
- the x-component of the direction of the line.lineDirectionY
- the y-component of the direction of the line.lineDirectionZ
- the z-component of the direction of the line.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static int intersectionBetweenLine3DAndCylinder3D(double cylinderBottomZ, double cylinderTopZ, double cylinderRadius, double pointOnLineX, double pointOnLineY, double pointOnLineZ, double lineDirectionX, double lineDirectionY, double lineDirectionZ, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The cylinder pose is as follows:
cylinderBottomZ
).
cylinderTopZ
).
In the case the line and the cylinder do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set Double.NaN
.
Edge cases:
cylinderBottomZ == cylinderTopZ
or cylinderRadius == 0
, this method
fails and return 0
.
cylinderBottomZ
- the z-coordinate of the cylinder's bottom face.cylinderTopZ
- the z-coordinate of the cylinder's top face.cylinderRadius
- radius of the cylinder.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.pointOnLineX
- the x-coordinate of a point located on the infinitely long line.pointOnLineY
- the y-coordinate of a point located on the infinitely long line.pointOnLineZ
- the z-coordinate of a point located on the infinitely long line.lineDirectionX
- the x-component of the direction of the line.lineDirectionY
- the y-component of the direction of the line.lineDirectionZ
- the z-component of the direction of the line.java.lang.IllegalArgumentException
- if either cylinderBottomZ > cylinderTopZ
or
cylinderRadius < 0
.public static int intersectionBetweenLine3DAndCylinder3D(double cylinderBottomZ, double cylinderTopZ, double cylinderRadius, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The cylinder pose is as follows:
cylinderBottomZ
).
cylinderTopZ
).
In the case the line and the cylinder do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set Double.NaN
.
Edge cases:
cylinderBottomZ == cylinderTopZ
or cylinderRadius == 0
, this method
fails and return 0
.
cylinderBottomZ
- the z-coordinate of the cylinder's bottom face.cylinderTopZ
- the z-coordinate of the cylinder's top face.cylinderRadius
- radius of the cylinder.firstPointOnLine
- a first point located on the infinitely long line. Not modified.secondPointOnLine
- a second point located on the infinitely long line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either cylinderBottomZ > cylinderTopZ
or
cylinderRadius < 0
.public static int intersectionBetweenLine3DAndCylinder3D(double cylinderBottomZ, double cylinderTopZ, double cylinderRadius, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The cylinder pose is as follows:
cylinderBottomZ
).
cylinderTopZ
).
In the case the line and the cylinder do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set Double.NaN
.
Edge cases:
cylinderBottomZ == cylinderTopZ
or cylinderRadius == 0
, this method
fails and return 0
.
cylinderBottomZ
- the z-coordinate of the cylinder's bottom face.cylinderTopZ
- the z-coordinate of the cylinder's top face.cylinderRadius
- radius of the cylinder.pointOnLine
- a point located on the infinitely long line. Not modified.lineDirection
- the direction of the line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either cylinderBottomZ > cylinderTopZ
or
cylinderRadius < 0
.public static int intersectionBetweenLine3DAndEllipsoid3D(double radiusX, double radiusY, double radiusZ, double pointOnLineX, double pointOnLineY, double pointOnLineZ, double lineDirectionX, double lineDirectionY, double lineDirectionZ, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The ellipsoid is center at (0, 0, 0).
In the case the line and the ellipsoid do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
Edge cases:
radiusX
, radiusY
, or radiusZ
is equal to 0
, this
method fails and return 0
.
radiusX
- radius of the ellipsoid along the x-axis.radiusY
- radius of the ellipsoid along the y-axis.radiusZ
- radius of the ellipsoid along the z-axis.pointOnLineX
- the x-coordinate of a point located on the infinitely long line.pointOnLineY
- the y-coordinate of a point located on the infinitely long line.pointOnLineZ
- the z-coordinate of a point located on the infinitely long line.lineDirectionX
- the x-component of the direction of the line.lineDirectionY
- the y-component of the direction of the line.lineDirectionZ
- the z-component of the direction of the line.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either radiusX
, radiusY
, or radiusZ
is negative.public static int intersectionBetweenLine3DAndEllipsoid3D(double radiusX, double radiusY, double radiusZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The ellipsoid is center at (0, 0, 0).
In the case the line and the ellipsoid do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
Edge cases:
radiusX
, radiusY
, or radiusZ
is equal to 0
, this
method fails and return 0
.
radiusX
- radius of the ellipsoid along the x-axis.radiusY
- radius of the ellipsoid along the y-axis.radiusZ
- radius of the ellipsoid along the z-axis.firstPointOnLine
- a first point located on the infinitely long line. Not modified.secondPointOnLine
- a second point located on the infinitely long line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either radiusX
, radiusY
, or radiusZ
is negative.public static int intersectionBetweenLine3DAndEllipsoid3D(double radiusX, double radiusY, double radiusZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The ellipsoid is center at (0, 0, 0).
In the case the line and the ellipsoid do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
Edge cases:
radiusX
, radiusY
, or radiusZ
is equal to 0
, this
method fails and return 0
.
radiusX
- radius of the ellipsoid along the x-axis.radiusY
- radius of the ellipsoid along the y-axis.radiusZ
- radius of the ellipsoid along the z-axis.pointOnLine
- a point located on the infinitely long line. Not modified.lineDirection
- the direction of the line. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either radiusX
, radiusY
, or radiusZ
is negative.public static us.ihmc.euclid.tuple3D.Point3D intersectionBetweenLine3DAndPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection)
WARNING: This method generates garbage.
Edge cases:
null
.
pointOnPlane
- a point located on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.null
if the line is parallel to the
plane.public static boolean intersectionBetweenLine3DAndPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics intersectionToPack)
Edge cases:
false
.
pointOnPlane
- a point located on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.intersectionToPack
- point in which the coordinates of the intersection are stored.true
if the method succeeds, false
otherwise.public static int intersectionBetweenLineSegment2DAndBoundingBox2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMin, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMax, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
Intersection(s) between the line segment and the bounding box can only exist between the endpoints of the line segment.
In the case the line segment and the bounding box do not intersect, this method returns 0
and firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
In the case only one intersection exists between the line segment and the bounding box,
firstIntersectionToPack
will contain the coordinate of the intersection and
secondIntersectionToPack
will be set to contain only Double.NaN
.
boundingBoxMin
- the minimum coordinate of the bounding box. Not modified.boundingBoxMax
- the maximum coordinate of the bounding box. Not modified.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static int intersectionBetweenLineSegment3DAndBoundingBox3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMin, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMax, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Intersection(s) between the line segment and the bounding box can only exist between the endpoints of the line segment.
In the case the line segment and the bounding box do not intersect, this method returns 0
and firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
In the case only one intersection exists between the line segment and the bounding box,
firstIntersectionToPack
will contain the coordinate of the intersection and
secondIntersectionToPack
will be set to contain only Double.NaN
.
boundingBoxMin
- the minimum coordinate of the bounding box. Not modified.boundingBoxMax
- the maximum coordinate of the bounding box. Not modified.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static int intersectionBetweenLineSegment3DAndCylinder3D(double cylinderBottomZ, double cylinderTopZ, double cylinderRadius, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The cylinder pose is as follows:
cylinderBottomZ
).
cylinderTopZ
).
In the case the line segment and the cylinder do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set Double.NaN
.
Edge cases:
cylinderBottomZ == cylinderTopZ
or cylinderRadius == 0
, this method
fails and return 0
.
cylinderBottomZ
- the z-coordinate of the cylinder's bottom face.cylinderTopZ
- the z-coordinate of the cylinder's top face.cylinderRadius
- radius of the cylinder.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either cylinderBottomZ > cylinderTopZ
or
cylinderRadius < 0
.public static int intersectionBetweenLineSegment3DAndEllipsoid3D(double radiusX, double radiusY, double radiusZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The ellipsoid is center at (0, 0, 0).
In the case the line segment and the ellipsoid do not intersect, this method returns 0
and firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
Edge cases:
radiusX
, radiusY
, or radiusZ
is equal to 0
, this
method fails and return 0
.
radiusX
- radius of the ellipsoid along the x-axis.radiusY
- radius of the ellipsoid along the y-axis.radiusZ
- radius of the ellipsoid along the z-axis.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either radiusX
, radiusY
, or radiusZ
is negative.public static us.ihmc.euclid.tuple3D.Point3D intersectionBetweenLineSegment3DAndPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
This method returns null
for the following cases:
lineSegmentStart == lineSegmentEnd
),
intersectionBetweenLine3DAndPlane3D(Point3DReadOnly, Vector3DReadOnly, Point3DReadOnly, Vector3DReadOnly)
to perform the actual computation.
WARNING: This method generates garbage.
pointOnPlane
- a point located on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.lineSegmentStart
- first endpoint of the line segment. Not modified.lineSegmentEnd
- second endpoint of the line segment. Not modified.null
if there is no intersection.public static int intersectionBetweenRay2DAndBoundingBox2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMin, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly boundingBoxMax, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics firstIntersectionToPack, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics secondIntersectionToPack)
Intersection(s) between the ray and the bounding box cannot exist before the origin of the ray.
In the case the ray and the bounding box do not intersect, this method returns0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
In the case only one intersection exists between the ray and the bounding box,
firstIntersectionToPack
will contain the coordinate of the intersection and
secondIntersectionToPack
will be set to contain only Double.NaN
.
boundingBoxMin
- the minimum coordinate of the bounding box. Not modified.boundingBoxMax
- the maximum coordinate of the bounding box. Not modified.rayOrigin
- the coordinate of the ray origin. Not modified.rayDirection
- the direction of the ray. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static boolean intersectionBetweenRay2DAndLineSegment2D(double rayOriginX, double rayOriginY, double rayDirectionX, double rayDirectionY, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentEndX, double lineSegmentEndY, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Edge cases:
lineSegmentStart
.
true
and the endpoint is the intersection.
false
and
intersectionToPack
is set to Double.NaN
.
rayOriginX
- the x-coordinate of a point located on the ray. Not modified.rayOriginY
- the y-coordinate of a point located on the ray. Not modified.rayDirectionX
- the x-component of the direction of the ray. Not modified.rayDirectionY
- the y-component of the direction of the ray. Not modified.lineSegmentStartX
- x-coordinate of the first endpoint of the line segment.lineSegmentStartY
- y-coordinate of the first endpoint of the line segment.lineSegmentEndX
- x-coordinate of the second endpoint of the line segment.lineSegmentEndY
- y-coordinate of the second endpoint of the line segment.intersectionToPack
- the 2D point in which the result is stored. Can be null
.
Modified.true
if the ray intersects the line segment, false
otherwise.public static us.ihmc.euclid.tuple2D.Point2D intersectionBetweenRay2DAndLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
null
.
lineSegmentStart
.
WARNING: This method generates garbage.
rayOrigin
- a point located on the ray. Not modified.rayDirection
- the direction of the ray. Not modified.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.null
otherwise.public static boolean intersectionBetweenRay2DAndLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Edge cases:
lineSegmentStart
.
true
and the endpoint is the intersection.
false
and
intersectionToPack
is set to Double.NaN
.
rayOrigin
- a point located on the ray. Not modified.rayDirection
- the direction of the ray. Not modified.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.intersectionToPack
- the 2D point in which the result is stored. Can be null
.
Modified.true
if the ray intersects the line segment, false
otherwise.public static int intersectionBetweenRay3DAndBoundingBox3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMin, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly boundingBoxMax, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly rayOrigin, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly rayDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
Intersection(s) between the ray and the bounding box cannot exist before the origin of the ray.
In the case the ray and the bounding box do not intersect, this method returns0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
In the case only one intersection exists between the ray and the bounding box,
firstIntersectionToPack
will contain the coordinate of the intersection and
secondIntersectionToPack
will be set to contain only Double.NaN
.
boundingBoxMin
- the minimum coordinate of the bounding box. Not modified.boundingBoxMax
- the maximum coordinate of the bounding box. Not modified.rayOrigin
- the coordinate of the ray origin. Not modified.rayDirection
- the direction of the ray. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.BoundingBoxException
- if any of the minimum coordinates of the bounding box is strictly
greater than the maximum coordinate of the bounding box on the same axis.public static int intersectionBetweenRay3DAndCylinder3D(double cylinderBottomZ, double cylinderTopZ, double cylinderRadius, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly rayOrigin, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly rayDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The cylinder pose is as follows:
cylinderBottomZ
).
cylinderTopZ
).
In the case the ray and the cylinder do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set Double.NaN
.
Edge cases:
cylinderBottomZ == cylinderTopZ
or cylinderRadius == 0
, this method
fails and return 0
.
cylinderBottomZ
- the z-coordinate of the cylinder's bottom face.cylinderTopZ
- the z-coordinate of the cylinder's top face.cylinderRadius
- radius of the cylinder.rayOrigin
- the coordinate of the ray origin. Not modified.rayDirection
- the direction of the ray. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either cylinderBottomZ > cylinderTopZ
or
cylinderRadius < 0
.public static int intersectionBetweenRay3DAndEllipsoid3D(double radiusX, double radiusY, double radiusZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly rayOrigin, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly rayDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics firstIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics secondIntersectionToPack)
The ellipsoid is center at (0, 0, 0).
In the case the ray and the ellipsoid do not intersect, this method returns 0
and
firstIntersectionToPack
and secondIntersectionToPack
are set to
Double.NaN
.
Edge cases:
radiusX
, radiusY
, or radiusZ
is equal to 0
, this
method fails and return 0
.
radiusX
- radius of the ellipsoid along the x-axis.radiusY
- radius of the ellipsoid along the y-axis.radiusZ
- radius of the ellipsoid along the z-axis.rayOrigin
- the coordinate of the ray origin. Not modified.rayDirection
- the direction of the ray. Not modified.firstIntersectionToPack
- the coordinate of the first intersection. Can be null
.
Modified.secondIntersectionToPack
- the coordinate of the second intersection. Can be null
.
Modified.java.lang.IllegalArgumentException
- if either radiusX
, radiusY
, or radiusZ
is negative.public static boolean intersectionBetweenTwoLine2Ds(double pointOnLine1x, double pointOnLine1y, double lineDirection1x, double lineDirection1y, double pointOnLine2x, double pointOnLine2y, double lineDirection2x, double lineDirection2y, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Edge cases:
pointOnLine1
.
false
and
intersectionToPack
is set to Double.NaN
.
pointOnLine1x
- x-coordinate of a point located on the first line.pointOnLine1y
- y-coordinate of a point located on the first line.lineDirection1x
- x-component of the first line direction.lineDirection1y
- y-component of the first line direction.pointOnLine2x
- x-coordinate of a point located on the second line.pointOnLine2y
- y-coordinate of a point located on the second line.lineDirection2x
- x-component of the second line direction.lineDirection2y
- y-component of the second line direction.intersectionToPack
- 2D point in which the result is stored. Modified.true
if the two lines intersect, false
otherwise.public static us.ihmc.euclid.tuple2D.Point2D intersectionBetweenTwoLine2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine2, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine2)
Edge cases:
pointOnLine1
.
WARNING: This method generates garbage.
firstPointOnLine1
- a first point located on the first line. Not modified.secondPointOnLine1
- a second point located on the first line. Not modified.firstPointOnLine2
- a first point located on the second line. Not modified.secondPointOnLine2
- a second point located on the second line. Not modified.null
otherwise.public static us.ihmc.euclid.tuple2D.Point2D intersectionBetweenTwoLine2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine2, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection2)
Edge cases:
null
.
pointOnLine1
.
WARNING: This method generates garbage.
pointOnLine1
- point located on the first line. Not modified.lineDirection1
- the first line direction. Not modified.pointOnLine2
- point located on the second line. Not modified.lineDirection2
- the second line direction. Not modified.null
otherwise.public static boolean intersectionBetweenTwoLine2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine2, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection2, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Edge cases:
pointOnLine1
.
false
and
intersectionToPack
is set to Double.NaN
.
pointOnLine1
- point located on the first line. Not modified.lineDirection1
- the first line direction. Not modified.pointOnLine2
- point located on the second line. Not modified.lineDirection2
- the second line direction. Not modified.intersectionToPack
- 2D point in which the result is stored. Modified.true
if the two lines intersect, false
otherwise.public static boolean intersectionBetweenTwoLineSegment2Ds(double lineSegmentStart1x, double lineSegmentStart1y, double lineSegmentEnd1x, double lineSegmentEnd1y, double lineSegmentStart2x, double lineSegmentStart2y, double lineSegmentEnd2x, double lineSegmentEnd2y, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Edge cases:
true
only if the two
line segments overlap or have at least one common endpoint.
true
.
false
and
intersectionToPack
is set to Double.NaN
.
lineSegmentStart1x
- x-coordinate of the first endpoint of the first line segment.lineSegmentStart1y
- y-coordinate of the first endpoint of the first line segment.lineSegmentEnd1x
- x-coordinate of the second endpoint of the first line segment.lineSegmentEnd1y
- y-coordinate of the second endpoint of the first line segment.lineSegmentStart2x
- x-coordinate of the first endpoint of the second line segment.lineSegmentStart2y
- y-coordinate of the first endpoint of the second line segment.lineSegmentEnd2x
- x-coordinate of the second endpoint of the second line segment.lineSegmentEnd2y
- y-coordinate of the second endpoint of the second line segment.intersectionToPack
- the 2D point in which the result is stored. Can be null
.
Modified.true
if the two line segments intersect, false
otherwise.public static us.ihmc.euclid.tuple2D.Point2D intersectionBetweenTwoLineSegment2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart2, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd2)
Edge cases:
null
.
null
.
WARNING: This method generates garbage.
lineSegmentStart1
- the first endpoint of the first line segment. Not modified.lineSegmentEnd1
- the second endpoint of the first line segment. Not modified.lineSegmentStart2
- the first endpoint of the second line segment. Not modified.lineSegmentEnd2
- the second endpoint of the second line segment. Not modified.null
otherwise.public static boolean intersectionBetweenTwoLineSegment2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart2, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd2, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics intersectionToPack)
Edge cases:
true
only if the two
line segments overlap or have at least one common endpoint.
true
.
false
and
intersectionToPack
is set to Double.NaN
.
lineSegmentStart1
- the first endpoint of the first line segment. Not modified.lineSegmentEnd1
- the second endpoint of the first line segment. Not modified.lineSegmentStart2
- the first endpoint of the second line segment. Not modified.lineSegmentEnd2
- the second endpoint of the second line segment. Not modified.intersectionToPack
- the 2D point in which the result is stored. Modified.true
if the two line segments intersect, false
otherwise.public static boolean intersectionBetweenTwoPlane3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane1, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane2, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal2, double angleThreshold, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics pointOnIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Vector3DBasics intersectionDirectionToPack)
Edge cases:
ONE_TRILLIONTH
, this methods
fails and returns false
.
angleThreshold
, this methods fails and
returns false
.
false
and
pointOnIntersectionToPack
and intersectionDirectionToPack
are set to
Double.NaN
.
pointOnPlane1
- a point on the first plane. Not modified.planeNormal1
- the normal of the first plane. Not modified.pointOnPlane2
- a point on the second plane. Not modified.planeNormal2
- the normal of the second plane. Not modified.angleThreshold
- the minimum angle between the two planes required to do the calculation.pointOnIntersectionToPack
- a 3D point that is set such that it belongs to the line of
intersection between the two planes. Modified.intersectionDirectionToPack
- a 3D vector that is set to the direction of the line of
intersection between the two planes. Modified.true
if the intersection was calculated properly, false
otherwise.public static boolean intersectionBetweenTwoPlane3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane1, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal1, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane2, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal2, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics pointOnIntersectionToPack, us.ihmc.euclid.tuple3D.interfaces.Vector3DBasics intersectionDirectionToPack)
Edge cases:
ONE_TRILLIONTH
, this methods
fails and returns false
.
ONE_MILLIONTH
, this methods
fails and returns false
.
false
and
pointOnIntersectionToPack
and intersectionDirectionToPack
are set to
Double.NaN
.
pointOnPlane1
- a point on the first plane. Not modified.planeNormal1
- the normal of the first plane. Not modified.pointOnPlane2
- a point on the second plane. Not modified.planeNormal2
- the normal of the second plane. Not modified.pointOnIntersectionToPack
- a 3D point that is set such that it belongs to the line of
intersection between the two planes. Modified.intersectionDirectionToPack
- a 3D vector that is set to the direction of the line of
intersection between the two planes. Modified.true
if the intersection was calculated properly, false
otherwise.public static boolean isFormingTriangle(double lengthSideA, double lengthSideB, double lengthSideC)
lengthSideA
- the length of the side A.lengthSideB
- the length of the side B.lengthSideC
- the length of the side C.true
if the lengths represents the three sides of a triangle, false
otherwise.java.lang.RuntimeException
- if any of the three lengths is negative.public static boolean isPoint2DInFrontOfRay2D(double pointX, double pointY, double rayOriginX, double rayOriginY, double rayDirectionX, double rayDirectionY)
pointX
- the x-coordinate of the query.pointY
- the y-coordinate of the query.rayOriginX
- the x-coordinate of the ray's origin.rayOriginY
- the y-coordinate of the ray's origin.rayDirectionX
- the x-component of the ray's direction.rayDirectionY
- the y-component of the ray's direction.true
if the query is located in front of the ray.public static boolean isPoint2DInFrontOfRay2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly rayOrigin, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly rayDirection)
point
- the query. Not modified.rayOrigin
- the ray's origin. Not modified.rayDirection
- the ray's direction. Not modified.true
if the query is located in front of the ray.public static boolean isPoint2DInsideTriangleABC(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly a, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly b, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly c)
true
only if the point is inside the triangle defined by the vertices a, b, and
c. The triangle can be clockwise or counter-clockwise ordered.point
- the point to check if lying inside the triangle. Not modified.a
- first vertex of the triangle. Not modified.b
- second vertex of the triangle. Not modified.c
- third vertex of the triangle. Not modified.true
if the query is exactly inside the triangle. false
if the query
point is outside triangle or exactly on an edge of the triangle.public static boolean isPoint2DOnLine2D(double pointX, double pointY, double pointOnLineX, double pointOnLineY, double lineDirectionX, double lineDirectionY)
The test is performed by computing the distance between the point and the line, if that distance
is below IS_POINT_ON_LINE_EPS
this method returns true
.
pointX
- the x-coordinate of the query.pointY
- the y-coordinate of the query.pointOnLineX
- the x-coordinate of a point located on the line.pointOnLineY
- the y-coordinate of a point located on the line.lineDirectionX
- the x-component of the direction of the line.lineDirectionY
- the y-component of the direction of the line.true
if the query is considered to be lying on the line, false
otherwise.public static boolean isPoint2DOnLine2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
The test is performed by computing the distance between the point and the line, if that distance
is below IS_POINT_ON_LINE_EPS
this method returns true
.
pointX
- the x-coordinate of the query.pointY
- the y-coordinate of the query.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.true
if the query is considered to be lying on the line, false
otherwise.public static boolean isPoint2DOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
The test is performed by computing the distance between the point and the line, if that distance
is below IS_POINT_ON_LINE_EPS
this method returns true
.
point
- the coordinates of the query. Not modified.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.true
if the query is considered to be lying on the line, false
otherwise.public static boolean isPoint2DOnLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
The test is performed by computing the distance between the point and the line, if that distance
is below IS_POINT_ON_LINE_EPS
this method returns true
.
point
- the coordinates of the query. Not modified.lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.true
if the query is considered to be lying on the line, false
otherwise.public static boolean isPoint2DOnLeftSideOfLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
lineStart
and
lineEnd
.
For instance, given the lineStart
coordinates x = 0, and y = 0, and the lineEnd
coordinates x = 1, y = 0, a point located on the left side of this line has a negative y
coordinate.
false
if the point is on the line.point
- the query point. Not modified.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.true
if the point is on the left side of the line, false
if the point is
on the right side or exactly on the line.public static boolean isPoint2DOnRightSideOfLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
lineStart
and
lineEnd
.
For instance, given the lineStart
coordinates x = 0, and y = 0, and the lineEnd
coordinates x = 1, y = 0, a point located on the right side of this line has a positive y
coordinate.
false
if the point is on the line.point
- the query point. Not modified.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.true
if the point is on the right side of the line, false
if the point is
on the left side or exactly on the line.public static boolean isPoint2DOnSideOfLine2D(double pointX, double pointY, double pointOnLineX, double pointOnLineY, double lineDirectionX, double lineDirectionY, boolean testLeftSide)
For instance, given the lineDirection
components x = 0, and y = 1, and the
pointOnLine
coordinates x = 0, and y = 0, a point located on:
false
if the point is on the line.pointX
- the x-coordinate of the query point.pointY
- the y-coordinate of the query point.pointOnLineX
- the x-coordinate of a point positioned on the infinite line.pointOnLineY
- the y-coordinate of a point positioned on the infinite line.lineDirectionX
- the x-component of the direction of the infinite line.lineDirectionY
- the y-component of the direction of the infinite line.testLeftSide
- the query of the side, when equal to true
this will test for the left
side, false
this will test for the right side.true
if the point is on the query side of the line, false
if the point is
on the opposite side or exactly on the line.public static boolean isPoint2DOnSideOfLine2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine, boolean testLeftSide)
lineStart
and lineEnd
.
For instance, given the lineStart
coordinates x = 0, and y = 0, and the lineEnd
coordinates x = 1, y = 0, a point located on:
false
if the point is on the line.pointX
- the x-coordinate of the query point.pointY
- the y-coordinate of the query point.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.testLeftSide
- the query of the side, when equal to true
this will test for the left
side, false
this will test for the right side.true
if the point is on the query side of the line, false
if the point is
on the opposite side or exactly on the line.public static boolean isPoint2DOnSideOfLine2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection, boolean testLeftSide)
For instance, given the lineDirection
components x = 0, and y = 1, and the
pointOnLine
coordinates x = 0, and y = 0, a point located on:
false
if the point is on the line.pointX
- the x-coordinate of the query point.pointY
- the y-coordinate of the query point.pointOnLine
- a point positioned on the infinite line. Not modified.lineDirection
- the direction of the infinite line. Not modified.testLeftSide
- the query of the side, when equal to true
this will test for the left
side, false
this will test for the right side.true
if the point is on the query side of the line, false
if the point is
on the opposite side or exactly on the line.public static boolean isPoint2DOnSideOfLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine, boolean testLeftSide)
lineStart
and lineEnd
.
For instance, given the lineStart
coordinates x = 0, and y = 0, and the lineEnd
coordinates x = 1, y = 0, a point located on:
false
if the point is on the line.point
- the query point. Not modified.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.testLeftSide
- the query of the side, when equal to true
this will test for the left
side, false
this will test for the right side.true
if the point is on the query side of the line, false
if the point is
on the opposite side or exactly on the line.public static boolean isPoint2DOnSideOfLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection, boolean testLeftSide)
For instance, given the lineDirection
components x = 0, and y = 1, and the
pointOnLine
coordinates x = 0, and y = 0, a point located on:
false
if the point is on the line.point
- the query point. Not modified.pointOnLine
- a point positioned on the infinite line. Not modified.lineDirection
- the direction of the infinite line. Not modified.testLeftSide
- the query of the side, when equal to true
this will test for the left
side, false
this will test for the right side.true
if the point is on the query side of the line, false
if the point is
on the opposite side or exactly on the line.public static us.ihmc.euclid.tuple3D.Vector3D normal3DFromThreePoint3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly thirdPointOnPlane)
Edge cases:
null
if the three points are on a line.
null
if two or three points are equal.
WARNING: This method generates garbage.
firstPointOnPlane
- first point on the plane. Not modified.secondPointOnPlane
- second point on the plane. Not modified.thirdPointOnPlane
- third point on the plane. Not modified.null
when the normal could not be determined.public static boolean normal3DFromThreePoint3Ds(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly thirdPointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DBasics normalToPack)
Edge cases:
false
if the three points are on a line.
false
if two or three points are equal.
firstPointOnPlane
- first point on the plane. Not modified.secondPointOnPlane
- second point on the plane. Not modified.thirdPointOnPlane
- third point on the plane. Not modified.normalToPack
- the vector in which the result is stored. Modified.public static boolean orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, double pointOnLineX, double pointOnLineY, double lineDirectionX, double lineDirectionY, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Edge cases:
lineDirection.lengthSquared() <
1.0E-12, this method fails and returns
false
.
pointToProject
- the point to compute the projection of. Not modified.pointOnLineX
- x-coordinate of a point located on the line.pointOnLineY
- y-coordinate of a point located on the line.lineDirectionX
- x-component of the direction of the line.lineDirectionY
- y-component of the direction of the line.projectionToPack
- point in which the projection of the point onto the line is stored.
Modified.public static us.ihmc.euclid.tuple2D.Point2D orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
Edge cases:
firstPointOnLine.distanceSquared(secondPointOnLine) <
1.0E-12, this
method fails and returns null
.
WARNING: This method generates garbage.
pointToProject
- the point to compute the projection of. Not modified.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.null
if the method failed.public static boolean orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Edge cases:
firstPointOnLine.distanceSquared(secondPointOnLine) <
1.0E-12, this
method fails and returns false
.
pointToProject
- the point to compute the projection of. Not modified.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.projectionToPack
- point in which the projection of the point onto the line is stored.
Modified.public static us.ihmc.euclid.tuple2D.Point2D orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
Edge cases:
lineDirection.lengthSquared() <
1.0E-12, this method fails and returns
null
.
WARNING: This method generates garbage.
pointToProject
- the point to compute the projection of. Not modified.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.null
if the method failed.public static boolean orthogonalProjectionOnLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Edge cases:
lineDirection.lengthSquared() <
1.0E-12, this method fails and returns
false
.
pointToProject
- the point to compute the projection of. Not modified.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.projectionToPack
- point in which the projection of the point onto the line is stored.
Modified.public static boolean orthogonalProjectionOnLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject, double pointOnLineX, double pointOnLineY, double pointOnLineZ, double lineDirectionX, double lineDirectionY, double lineDirectionZ, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Edge cases:
lineDirection.lengthSquared() <
1.0E-12, this method fails and returns
false
.
pointToProject
- the point to compute the projection of. Not modified.pointOnLineX
- x-coordinate of a point located on the line.pointOnLineY
- y-coordinate of a point located on the line.pointOnLineZ
- z-coordinate of a point located on the line.lineDirectionX
- x-component of the direction of the line.lineDirectionY
- y-component of the direction of the line.lineDirectionZ
- z-component of the direction of the line.projectionToPack
- point in which the projection of the point onto the line is stored.
Modified.public static us.ihmc.euclid.tuple3D.Point3D orthogonalProjectionOnLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection)
Edge cases:
lineDirection.lengthSquared() <
1.0E-12, this method fails and returns
null
.
WARNING: This method generates garbage.
pointToProject
- the point to compute the projection of. Not modified.pointOnLine
- point located on the line. Not modified.lineDirection
- direction of the line. Not modified.null
if the method failed.public static boolean orthogonalProjectionOnLine3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnLine, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly lineDirection, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Edge cases:
lineDirection.lengthSquared() <
1.0E-12, this method fails and returns
false
.
pointToProject
- the point to compute the projection of. Not modified.pointOnLine
- point located on the line. Not modified.lineDirection
- direction of the line. Not modified.projectionToPack
- point in which the projection of the point onto the line is stored.
Modified.public static boolean orthogonalProjectionOnLineSegment2D(double pointToProjectX, double pointToProjectY, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentEndX, double lineSegmentEndY, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns lineSegmentStart
.
pointToProjectX
- the x-coordinate of the point to compute the projection of.pointToProjectY
- the y-coordinate of the point to compute the projection of.lineSegmentStartX
- the x-coordinate of the line segment first endpoint.lineSegmentStartY
- the y-coordinate of the line segment first endpoint.lineSegmentEndX
- the x-coordinate of the line segment second endpoint.lineSegmentEndY
- the y-coordinate of the line segment second endpoint.projectionToPack
- point in which the projection of the point onto the line segment is
stored. Modified.public static boolean orthogonalProjectionOnLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentEndX, double lineSegmentEndY, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns lineSegmentStart
.
pointToProject
- the point to compute the projection of. Not modified.lineSegmentStartX
- the x-coordinate of the line segment first endpoint.lineSegmentStartY
- the y-coordinate of the line segment first endpoint.lineSegmentEndX
- the x-coordinate of the line segment second endpoint.lineSegmentEndY
- the y-coordinate of the line segment second endpoint.projectionToPack
- point in which the projection of the point onto the line segment is
stored. Modified.public static us.ihmc.euclid.tuple2D.Point2D orthogonalProjectionOnLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns lineSegmentStart
.
WARNING: This method generates garbage.
pointToProject
- the point to compute the projection of. Not modified.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.null
if the method failed.public static boolean orthogonalProjectionOnLineSegment2D(double pointToProjectX, double pointToProjectY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns lineSegmentStart
.
pointToProjectX
- the x-coordinate of the point to compute the projection of.pointToProjectY
- the y-coordinate of the point to compute the projection of.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.projectionToPack
- point in which the projection of the point onto the line segment is
stored. Modified.public static boolean orthogonalProjectionOnLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointToProject, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics projectionToPack)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns lineSegmentStart
.
pointToProject
- the point to compute the projection of. Not modified.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.projectionToPack
- point in which the projection of the point onto the line segment is
stored. Modified.public static boolean orthogonalProjectionOnLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentStartZ, double lineSegmentEndX, double lineSegmentEndY, double lineSegmentEndZ, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns lineSegmentStart
.
pointToProject
- the point to compute the projection of. Not modified.lineSegmentStartX
- the x-coordinate of the line segment first endpoint.lineSegmentStartY
- the y-coordinate of the line segment first endpoint.lineSegmentStartZ
- the z-coordinate of the line segment first endpoint.lineSegmentEndX
- the x-coordinate of the line segment second endpoint.lineSegmentEndY
- the y-coordinate of the line segment second endpoint.lineSegmentEndZ
- the z-coordinate of the line segment second endpoint.projectionToPack
- point in which the projection of the point onto the line segment is
stored. Modified.public static us.ihmc.euclid.tuple3D.Point3D orthogonalProjectionOnLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns lineSegmentStart
.
WARNING: This method generates garbage.
pointToProject
- the point to compute the projection of. Not modified.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.null
if the method failed.public static boolean orthogonalProjectionOnLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns lineSegmentStart
.
pointToProject
- the point to compute the projection of. Not modified.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.projectionToPack
- point in which the projection of the point onto the line segment is
stored. Modified.public static us.ihmc.euclid.tuple3D.Point3D orthogonalProjectionOnPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal)
Edge cases:
ONE_TRILLIONTH
, this
method fails and returns false
.
pointToProject
- the point to compute the projection of. Not modified.pointOnPlane
- a point on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.null
if the method failed.public static boolean orthogonalProjectionOnPlane3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointToProject, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Edge cases:
ONE_TRILLIONTH
, this
method fails and returns false
.
pointToProject
- the point to compute the projection of. Not modified.pointOnPlane
- a point on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.projectionToPack
- point in which the projection of the point onto the plane is stored.
Modified.public static boolean orthogonalProjectionOnPlane3D(double x, double y, double z, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly pointOnPlane, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly planeNormal, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics projectionToPack)
Edge cases:
ONE_TRILLIONTH
, this
method fails and returns false
.
x
- the x-coordinate of the point to compute the projection of. Not modified.y
- the y-coordinate of the point to compute the projection of. Not modified.z
- the z-coordinate of the point to compute the projection of. Not modified.pointOnPlane
- a point on the plane. Not modified.planeNormal
- the normal of the plane. Not modified.projectionToPack
- point in which the projection of the point onto the plane is stored.
Modified.public static double percentageOfIntersectionBetweenTwoLine2Ds(double pointOnLine1x, double pointOnLine1y, double lineDirection1x, double lineDirection1y, double pointOnLine2x, double pointOnLine2y, double lineDirection2x, double lineDirection2y)
alpha
along the first line such that the
intersection coordinates can be computed as follows: intersection = pointOnLine1 + alpha * lineDirection1
Edge cases:
Double.NaN
.
pointOnLine1
, the returned value 0.0
.
pointOnLine1x
- x-coordinate of a point located on the first line.pointOnLine1y
- y-coordinate of a point located on the first line.lineDirection1x
- x-component of the first line direction.lineDirection1y
- y-component of the first line direction.pointOnLine2x
- x-coordinate of a point located on the second line.pointOnLine2y
- y-coordinate of a point located on the second line.lineDirection2x
- x-component of the second line direction.lineDirection2y
- y-component of the second line direction.alpha
the percentage along the first line of the intersection location. This
method returns Double.NaN
if the lines do not intersect.public static double percentageOfIntersectionBetweenTwoLine2Ds(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine1, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection1, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine2, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection2)
alpha
along the first line such that the
intersection coordinates can be computed as follows: intersection = pointOnLine1 + alpha * lineDirection1
Edge cases:
Double.NaN
.
pointOnLine1
, the returned value 0.0
.
pointOnLine1
- a point located on the first line. Not modified.lineDirection1
- the first line direction. Not modified.pointOnLine2
- a point located on the second line. Not modified.lineDirection2
- the second line direction. Not modified.alpha
the percentage along the first line of the intersection location. This
method returns Double.NaN
if the lines do not intersect.public static double percentageOfIntersectionBetweenLineSegment2DAndLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
alpha
along the line segment such that the intersection coordinates can be
computed as follows: intersection = (1.0 - alpha) * lineSegmentStart + alpha * lineSegmentEnd
Edge cases:
Double.NaN
.
Double.NaN
.
lineSegmentStart
, the returned value 0.0
.
lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.pointOnLine
- a point located on the line. Not modified.lineDirection
- the line direction. Not modified.alpha
the percentage along the line segment of the intersection location. This
method returns Double.NaN
if the line segment and the line do not intersect.public static double percentageAlongLineSegment2D(double pointX, double pointY, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentEndX, double lineSegmentEndY)
0.0
representing lineSegmentStart
, and 1.0
representing lineSegmentEnd
.
For example, if the returned percentage is 0.5
, it means that the projection of the given
point is located at the middle of the line segment. The coordinates of the projection of the
point can be computed from the percentage
as follows:
Point2d projection = new Point2d();
projection.interpolate(lineSegmentStart, lineSegmentEnd, percentage);
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
returns 0.0
.
pointX
- the x-coordinate of the query point.pointY
- the y-coordinate of the query point.lineSegmentStartX
- the x-coordinate of the line segment first endpoint.lineSegmentStartY
- the y-coordinate of the line segment first endpoint.lineSegmentEndX
- the x-coordinate of the line segment second endpoint.lineSegmentEndY
- the y-coordinate of the line segment second endpoint.public static double percentageAlongLineSegment2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
0.0
representing lineSegmentStart
, and 1.0
representing lineSegmentEnd
.
For example, if the returned percentage is 0.5
, it means that the projection of the given
point is located at the middle of the line segment. The coordinates of the projection of the
point can be computed from the percentage
as follows:
Point2d projection = new Point2d();
projection.interpolate(lineSegmentStart, lineSegmentEnd, percentage);
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
fails and returns 0.0
.
pointX
- the x-coordinate of the query point.pointY
- the y-coordinate of the query point.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.public static double percentageAlongLineSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd)
0.0
representing lineSegmentStart
, and 1.0
representing lineSegmentEnd
.
For example, if the returned percentage is 0.5
, it means that the projection of the given
point is located at the middle of the line segment. The coordinates of the projection of the
point can be computed from the percentage
as follows:
Point2d projection = new Point2d();
projection.interpolate(lineSegmentStart, lineSegmentEnd, percentage);
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
fails and returns 0.0
.
point
- the query. Not modified.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.public static double percentageAlongLineSegment3D(double pointX, double pointY, double pointZ, double lineSegmentStartX, double lineSegmentStartY, double lineSegmentStartZ, double lineSegmentEndX, double lineSegmentEndY, double lineSegmentEndZ)
0.0
representing lineSegmentStart
, and 1.0
representing lineSegmentEnd
.
For example, if the returned percentage is 0.5
, it means that the projection of the given
point is located at the middle of the line segment. The coordinates of the projection of the
point can be computed from the percentage
as follows:
Point3DReadOnly projection = new Point3D();
projection.interpolate(lineSegmentStart, lineSegmentEnd, percentage);
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
fails and returns 0.0
.
pointX
- the x-coordinate of the query point.pointY
- the y-coordinate of the query point.pointZ
- the z-coordinate of the query point.lineSegmentStartX
- the x-coordinate of the line segment first endpoint.lineSegmentStartY
- the y-coordinate of the line segment first endpoint.lineSegmentStartZ
- the z-coordinate of the line segment first endpoint.lineSegmentEndX
- the x-coordinate of the line segment second endpoint.lineSegmentEndY
- the y-coordinate of the line segment second endpoint.lineSegmentEndZ
- the z-coordinate of the line segment second endpoint.public static double percentageAlongLineSegment3D(double pointX, double pointY, double pointZ, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
0.0
representing lineSegmentStart
, and 1.0
representing lineSegmentEnd
.
For example, if the returned percentage is 0.5
, it means that the projection of the given
point is located at the middle of the line segment. The coordinates of the projection of the
point can be computed from the percentage
as follows:
Point3DReadOnly projection = new Point3D();
projection.interpolate(lineSegmentStart, lineSegmentEnd, percentage);
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
fails and returns 0.0
.
pointX
- the x-coordinate of the query point.pointY
- the y-coordinate of the query point.pointZ
- the z-coordinate of the query point.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.public static double percentageAlongLineSegment3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentStart, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly lineSegmentEnd)
0.0
representing lineSegmentStart
, and 1.0
representing lineSegmentEnd
.
For example, if the returned percentage is 0.5
, it means that the projection of the given
point is located at the middle of the line segment. The coordinates of the projection of the
point can be computed from the percentage
as follows:
Point3DReadOnly projection = new Point3D();
projection.interpolate(lineSegmentStart, lineSegmentEnd, percentage);
Edge cases:
lineSegmentStart.distanceSquared(lineSegmentEnd) <
1.0E-12, this method
fails and returns 0.0
.
point
- the query. Not modified.lineSegmentStart
- the line segment first endpoint. Not modified.lineSegmentEnd
- the line segment second endpoint. Not modified.public static boolean perpendicularBisector2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics bisectorStartToPack, us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics bisectorDirectionToPack)
Edge cases:
lineSegmentStart.distance(lineSegmentEnd) <
1.0E-12, the method fails
and returns false
.
lineSegmentStart
- the first endpoint of the line segment. Not modified.lineSegmentEnd
- the second endpoint of the line segment. Not modified.bisectorStartToPack
- a 2D point in which the origin of the bisector is stored. Modified.bisectorDirectionToPack
- a 2D vector in which the direction of the bisector is stored.
Modified.public static java.util.List<us.ihmc.euclid.tuple2D.Point2D> perpendicularBisectorSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, double bisectorSegmentHalfLength)
bisectorSegmentHalfLength
from the line segment.
Edge cases:
lineSegmentStart.distance(lineSegmentEnd) <
1.0E-12, the method fails
and returns null
.
WARNING: This method generates garbage.
lineSegmentStart
- the first endpoint of the line segment from which the perpendicular
bisector is to be computed. Not modified.lineSegmentEnd
- the second endpoint of the line segment from which the perpendicular
bisector is to be computed. Not modified.bisectorSegmentHalfLength
- distance from the line segment each endpoint of the
perpendicular bisector segment will be positioned.public static boolean perpendicularBisectorSegment2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentStart, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly lineSegmentEnd, double bisectorSegmentHalfLength, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics bisectorSegmentStartToPack, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics bisectorSegmentEndToPack)
bisectorSegmentHalfLength
from the line segment.
Edge cases:
lineSegmentStart.distance(lineSegmentEnd) <
1.0E-12, the method fails
and returns false.
lineSegmentStart
- the first endpoint of the line segment from which the perpendicular
bisector is to be computed. Not modified.lineSegmentEnd
- the second endpoint of the line segment from which the perpendicular
bisector is to be computed. Not modified.bisectorSegmentHalfLength
- distance from the line segment each endpoint of the
perpendicular bisector segment will be positioned.bisectorSegmentStartToPack
- the first endpoint of the perpendicular bisector segment to be
computed. Modified.bisectorSegmentEndToPack
- the second endpoint of the perpendicular bisector segment to be
computed. Modified.public static us.ihmc.euclid.tuple2D.Vector2D perpendicularVector2D(us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly vector)
vector
such that:
vector.dot(perpendicularVector) == 0.0
.
vector.angle(perpendicularVector) == Math.PI / 2.0
.
WARNING: This method generates garbage.
vector
- the vector to compute the perpendicular of. Not modified.public static void perpendicularVector2D(us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly vector, us.ihmc.euclid.tuple2D.interfaces.Vector2DBasics perpendicularVectorToPack)
vector
such that:
vector.dot(perpendicularVector) == 0.0
.
vector.angle(perpendicularVector) == Math.PI / 2.0
.
vector
- the vector to compute the perpendicular of. Not modified.perpendicularVectorToPack
- a 2D vector in which the perpendicular vector is stored.
Modified.public static us.ihmc.euclid.tuple3D.Vector3D perpendicularVector3DFromLine3DToPoint3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics orthogonalProjectionToPack)
point
on line is first computed. The
perpendicular vector is computed as follows:
perpendicularVector = point - orthogonalProjection
, resulting in a vector going from the
computed projection to the given point
with a length equal to the distance between the
point and the line.
Edge cases:
null
.
WARNING: This method generates garbage.
point
- the 3D point towards which the perpendicular vector should be pointing at. Not
modified.firstPointOnLine
- a first point on the line. Not modified.secondPointOnLine
- a second point on the line. Not modified.orthogonalProjectionToPack
- a 3D point in which the projection of point
onto the
line is stored. Modified. Can be null
.point
, or null
when the method fails.public static boolean perpendicularVector3DFromLine3DToPoint3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly point, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly firstPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly secondPointOnLine, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics orthogonalProjectionToPack, us.ihmc.euclid.tuple3D.interfaces.Vector3DBasics perpendicularVectorToPack)
point
on line is first computed. The
perpendicular vector is computed as follows:
perpendicularVector = point - orthogonalProjection
, resulting in a vector going from the
computed projection to the given point
with a length equal to the distance between the
point and the line.
Edge cases:
false
.
point
- the 3D point towards which the perpendicular vector should be pointing at. Not
modified.firstPointOnLine
- a first point on the line. Not modified.secondPointOnLine
- a second point on the line. Not modified.orthogonalProjectionToPack
- a 3D point in which the projection of point
onto the
line is stored. Modified. Can be null
.perpendicularVectorToPack
- a 3D vector in which the vector perpendicular to the line and
pointing to the point
is stored. Modified. Can NOT be null
.true
if the method succeeded, false
otherwise.public static double pythagorasGetCathetus(double hypotenuseC, double cathetusA)
Given a right triangle with the three sides A, B, and C, where A and B are the catheti and C the
hypotenuse, this method calculates the length of the cathetus B given the lengths of A and C:
|B|2 = |C|2 - |A|2.
Useful link.
hypotenuseC
- the length of the hypotenuse C.cathetusA
- the length of the cathetus A.java.lang.RuntimeException
- if the length of the cathetus A is negative or greater than the
hypotenuse C.public static double pythagorasGetHypotenuse(double cathetusA, double cathetusB)
Given a right triangle with the three sides A, B, and C, where A and B are the catheti and C the
hypotenuse, this method calculates the length of the hypotenuse C given the lengths of A and B:
|C|2 = |A|2 + |B|2.
Useful link.
cathetusA
- the length of the cathetus A.cathetusB
- the length of the cathetus B.java.lang.RuntimeException
- if any of the two lengths is negative.public static double radiusOfArc(double chordLength, double chordAngle)
chordLength
- the length of the chord.chordAngle
- angle covered by the chord.Double.NaN
if chordAngle % Math.PI == 0.0
.public static double signedDistanceFromPoint2DToLine2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
The calculated distance is negative if the query is located on the right side of the line.
Edge cases:
firstPointOnLine.distance(secondPointOnLine) <
1.0E-12, this
method returns the distance between firstPointOnLine
and the given point
.
pointX
- x-coordinate of the query.pointY
- y-coordinate of the query.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.public static double signedDistanceFromPoint2DToLine2D(double pointX, double pointY, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
The calculated distance is negative if the query is located on the right side of the line.
Edge cases:
lineDirection.length() <
1.0E-12, this method returns the
distance between pointOnLine
and the given point
.
pointX
- x-coordinate of the query.pointY
- y-coordinate of the query.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.public static double signedDistanceFromPoint2DToLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly firstPointOnLine, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly secondPointOnLine)
The calculated distance is negative if the query is located on the right side of the line.
Edge cases:
firstPointOnLine.distance(secondPointOnLine) <
1.0E-12, this
method returns the distance between firstPointOnLine
and the given point
.
point
- the coordinates of the query. Not modified.firstPointOnLine
- a first point located on the line. Not modified.secondPointOnLine
- a second point located on the line. Not modified.public static double signedDistanceFromPoint2DToLine2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly point, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly pointOnLine, us.ihmc.euclid.tuple2D.interfaces.Vector2DReadOnly lineDirection)
The calculated distance is negative if the query is located on the right side of the line.
Edge cases:
lineDirection.length() <
1.0E-12, this method returns the
distance between pointOnLine
and the given point
.
point
- the coordinates of the query. Not modified.pointOnLine
- a point located on the line. Not modified.lineDirection
- the direction of the line. Not modified.public static double signedDistanceFromPoint2DToLine2D(double pointX, double pointY, double pointOnLineX, double pointOnLineY, double lineDirectionX, double lineDirectionY)
The calculated distance is negative if the query is located on the right side of the line.
Edge cases:
lineDirection.length() <
1.0E-12, this method returns the
distance between pointOnLine
and the given point
.
pointX
- x-coordinate of the query.pointY
- y-coordinate of the query.pointOnLineX
- x-coordinate of a point located on the line.pointOnLineY
- y-coordinate of a point located on the line.lineDirectionX
- x-component of the line direction.lineDirectionY
- y-component of the line direction.public static void topVertex3DOfIsoscelesTriangle3D(us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly baseVertexA, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly baseVertexC, us.ihmc.euclid.tuple3D.interfaces.Vector3DReadOnly trianglePlaneNormal, double ccwAngleAboutNormalAtTopVertex, us.ihmc.euclid.tuple3D.interfaces.Point3DBasics topVertexBToPack)
baseVertexA
- the first base vertex of the isosceles triangle ABC. Not modified.baseVertexC
- the second base vertex of the isosceles triangle ABC. Not modified.trianglePlaneNormal
- the normal of the plane on which is lying. Not modified.ccwAngleAboutNormalAtTopVertex
- the angle at B from the the leg BA to the leg BC.topVertexBToPack
- the missing vertex B. Modified.public static us.ihmc.euclid.tuple2D.Point2D triangleBisector2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly A, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly B, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly C)
Edge cases:
ONE_TRILLIONTH
, this method fails and
returns null
.
WARNING: This method generates garbage.
A
- the first vertex of the triangle. Not modified.B
- the second vertex of the triangle, this is the first endpoint of the bisector. Not
modified.C
- the third vertex of the triangle. Not modified.null
if the method failed.public static boolean triangleBisector2D(us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly A, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly B, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly C, us.ihmc.euclid.tuple2D.interfaces.Point2DBasics XToPack)
Edge cases:
ONE_TRILLIONTH
, this method fails and
returns false
.
A
- the first vertex of the triangle. Not modified.B
- the second vertex of the triangle, this is the first endpoint of the bisector. Not
modified.C
- the third vertex of the triangle. Not modified.XToPack
- point in which the second endpoint of the bisector is stored. Modified.public static double unknownTriangleAngleByLawOfCosine(double lengthNeighbourSideA, double lengthNeighbourSideB, double lengthOppositeSideC)
Given a triangle with the three sides A, B, and C, this methods calculates the angle between A and B given the lengths of three sides.
lengthNeighbourSideA
- the length of the side A.lengthNeighbourSideB
- the length of the side B.lengthOppositeSideC
- the length of the side C.java.lang.RuntimeException
- if the lengths do not describe a triangle, see
isFormingTriangle(double, double, double)
.public static double unknownTriangleSideLengthByLawOfCosine(double lengthSideA, double lengthSideB, double angleBetweenAAndB)
Given a triangle with the three sides A, B, and C, this methods calculates the length of the side C, given:
lengthSideA
- the length of the side A.lengthSideB
- the length of the side B.angleBetweenAAndB
- the angle between the sides A and B.java.lang.RuntimeException
- if lengthSideA
and/or lengthSideB
are negative, if
angleBetweenAAndB
is greater than pi.