/** * Gets the coordinates of two distinct points this line goes through. * * @param firstPointOnLineToPack the coordinates of a first point located on this line. Modified. * @param secondPointOnLineToPack the coordinates of a second point located on this line. Modified. * @throws ReferenceFrameMismatchException if {@code this}, {@code firstPointOnLineToPack}, and * {@code secondPointOnLineToPack} are not expressed in the same reference frame. */ default void getTwoPointsOnLine(FixedFramePoint3DBasics firstPointOnLineToPack, FixedFramePoint3DBasics secondPointOnLineToPack) { checkReferenceFrameMatch(firstPointOnLineToPack); checkReferenceFrameMatch(secondPointOnLineToPack); Line3DReadOnly.super.getTwoPointsOnLine(firstPointOnLineToPack, secondPointOnLineToPack); }
/** * Gets the point and direction defining this line by storing their components in the given * arguments {@code pointToPack} and {@code directionToPack}. * * @param pointToPack point in which the coordinates of this line's point are stored. Modified. * @param directionToPack vector in which the components of this line's direction are stored. * Modified. * @throws ReferenceFrameMismatchException if either argument is not expressed in the same reference * frame as this frame line 3D. */ default void get(FixedFramePoint3DBasics pointToPack, FixedFrameVector3DBasics directionToPack) { checkReferenceFrameMatch(pointToPack); checkReferenceFrameMatch(directionToPack); Line3DReadOnly.super.get(pointToPack, directionToPack); }
/** * Gets the coordinates of two distinct points this line goes through. * * @param firstPointOnLineToPack the coordinates of a first point located on this line. Modified. * @param secondPointOnLineToPack the coordinates of a second point located on this line. Modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code firstPointOnLineToPack} are * not expressed in the same reference frame. */ default void getTwoPointsOnLine(FixedFramePoint3DBasics firstPointOnLineToPack, Point3DBasics secondPointOnLineToPack) { checkReferenceFrameMatch(firstPointOnLineToPack); Line3DReadOnly.super.getTwoPointsOnLine(firstPointOnLineToPack, secondPointOnLineToPack); }
/** * Gets the coordinates of two distinct points this line goes through. * * @param firstPointOnLineToPack the coordinates of a first point located on this line. Modified. * @param secondPointOnLineToPack the coordinates of a second point located on this line. Modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code secondPointOnLineToPack} are * not expressed in the same reference frame. */ default void getTwoPointsOnLine(Point3DBasics firstPointOnLineToPack, FixedFramePoint3DBasics secondPointOnLineToPack) { checkReferenceFrameMatch(secondPointOnLineToPack); Line3DReadOnly.super.getTwoPointsOnLine(firstPointOnLineToPack, secondPointOnLineToPack); }
/** * This methods computes the minimum distance between this line and {@code otherLine}. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the other line to compute the distance from. Not modified. * @return the minimum distance between the two lines. * @throws ReferenceFrameMismatchException if {@code this} and {@code otherLine} are not expressed * in the same reference frame. */ default double distance(FrameLine3DReadOnly otherLine) { checkReferenceFrameMatch(otherLine); return Line3DReadOnly.super.distance(otherLine); }
/** * Compares {@code this} with {@code other} to determine if the two lines are collinear. * * @param other the line to compare to. Not modified. * @param epsilon the tolerance of the comparison. * @return {@code true} if the lines are collinear, {@code false} otherwise. * @throws ReferenceFrameMismatchException if {@code this} and {@code other} are not expressed in * the same reference frame. */ default boolean isCollinear(FrameLine3DReadOnly other, double epsilon) { checkReferenceFrameMatch(other); return Line3DReadOnly.super.isCollinear(other, epsilon); }
/** * Gets the point and direction defining this line by storing their components in the given * arguments {@code pointToPack} and {@code directionToPack}. * * @param pointToPack point in which the coordinates of this line's point are stored. Modified. * @param directionToPack vector in which the components of this line's direction are stored. * Modified. * @throws ReferenceFrameMismatchException if {@code directionToPack} is not expressed in the same * reference frame as this frame line 3D. */ default void get(Point3DBasics pointToPack, FixedFrameVector3DBasics directionToPack) { checkReferenceFrameMatch(directionToPack); Line3DReadOnly.super.get(pointToPack, directionToPack); }
/** * Gets the point and direction defining this line by storing their components in the given * arguments {@code pointToPack} and {@code directionToPack}. * * @param pointToPack point in which the coordinates of this line's point are stored. Modified. * @param directionToPack vector in which the components of this line's direction are stored. * Modified. * @throws ReferenceFrameMismatchException if {@code pointToPack} is not expressed in the same * reference frame as this frame line 3D. */ default void get(FixedFramePoint3DBasics pointToPack, Vector3DBasics directionToPack) { checkReferenceFrameMatch(pointToPack); Line3DReadOnly.super.get(pointToPack, directionToPack); }
/** * Compares {@code this} with {@code other} to determine if the two lines are collinear. * * @param other the line to compare to. Not modified. * @param angleEpsilon the tolerance of the comparison for angle. * @param distanceEpsilon the tolerance of the comparison for distance. * @return {@code true} if the lines are collinear, {@code false} otherwise. * @throws ReferenceFrameMismatchException if {@code this} and {@code other} are not expressed in * the same reference frame. */ default boolean isCollinear(FrameLine3DReadOnly other, double angleEpsilon, double distanceEpsilon) { checkReferenceFrameMatch(other); return Line3DReadOnly.super.isCollinear(other, angleEpsilon, distanceEpsilon); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. */ default double closestPointsWith(Line3DReadOnly otherLine, FixedFramePoint3DBasics closestPointOnThisLineToPack, Point3DBasics closestPointOnOtherLineToPack) { checkReferenceFrameMatch(closestPointOnThisLineToPack); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }
/** * Compares {@code this} to {@code other} to determine if the two lines are geometrically similar. * <p> * Two lines are considered geometrically equal is they are collinear, pointing toward the same or * opposite direction. * </p> * * @param other the line to compare to. Not modified. * @param epsilon the tolerance of the comparison. * @return {@code true} if the two lines represent the same geometry, {@code false} otherwise. * @throws ReferenceFrameMismatchException if {@code this} and {@code other} are not expressed in * the same reference frame. */ default boolean geometricallyEquals(FrameLine3DReadOnly other, double epsilon) { checkReferenceFrameMatch(other); return Line3DReadOnly.super.geometricallyEquals(other, epsilon); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. * @throws ReferenceFrameMismatchException if {@code this} and {@code otherLine} are not expressed * in the same reference frame. */ default double closestPointsWith(FrameLine3DReadOnly otherLine, Point3DBasics closestPointOnThisLineToPack, Point3DBasics closestPointOnOtherLineToPack) { checkReferenceFrameMatch(otherLine); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }
/** * Tests if the given is located on this line. * <p> * More precisely, the point is assumed to be on this line if it is located at a distance less than * {@code epsilon} from it. * </p> * * @param point the coordinates of the query. Not modified. * @param epsilon the tolerance used for this test. * @return {@code true} if the point is located on this line, {@code false} otherwise. * @throws ReferenceFrameMismatchException if {@code this} and {@code point} are not expressed in * the same reference frame. */ default boolean isPointOnLine(FramePoint3DReadOnly point, double epsilon) { checkReferenceFrameMatch(point); return Line3DReadOnly.super.isPointOnLine(point, epsilon); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. * @throws ReferenceFrameMismatchException if {@code this} and {@code closestPointOnOtherLineToPack} * are not expressed in the same reference frame. */ default double closestPointsWith(Line3DReadOnly otherLine, Point3DBasics closestPointOnThisLineToPack, FixedFramePoint3DBasics closestPointOnOtherLineToPack) { checkReferenceFrameMatch(closestPointOnOtherLineToPack); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }
/** * Computes the minimum distance the given 3D point and this line. * <p> * Edge cases: * <ul> * <li>if {@code direction.length() < }{@link EuclidGeometryTools#ONE_TRILLIONTH}, this method * returns the distance between {@code point} and the given {@code point}. * </ul> * </p> * * @param point 3D point to compute the distance from the line. Not modified. * @return the minimum distance between the 3D point and this 3D line. * @throws ReferenceFrameMismatchException if {@code this} and {@code point} are not expressed in * the same reference frame. */ default double distance(FramePoint3DReadOnly point) { checkReferenceFrameMatch(point); return Line3DReadOnly.super.distance(point); }
/** * Computes the orthogonal projection of the given 3D point on this 3D line. * <p> * Edge cases: * <ul> * <li>if the given line direction is too small, i.e. * {@code lineDirection.lengthSquared() < }{@value EuclidGeometryTools#ONE_TRILLIONTH}, this method fails and returns * {@code false}. * </ul> * </p> * * @param pointToProject the point to compute the projection of. Not modified. * @param projectionToPack point in which the projection of the point onto the line is stored. * Modified. * @return whether the method succeeded or not. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointToProject} are not * expressed in the same reference frame. */ default boolean orthogonalProjection(FramePoint3DReadOnly pointToProject, Point3DBasics projectionToPack) { checkReferenceFrameMatch(pointToProject); return Line3DReadOnly.super.orthogonalProjection(pointToProject, projectionToPack); }
/** * Calculates the coordinates of the point 'p' given the parameter 't' as follows:<br> * p = t * n + p<sub>0</sub><br> * where n is the unit-vector defining the direction of this line and p<sub>0</sub> is the point * defining this line which also corresponds to the point for which t=0. * <p> * Note that the absolute value of 't' is equal to the distance between the point 'p' and the point * p<sub>0</sub> defining this line. * </p> * * @param t the parameter used to calculate the point coordinates. * @param pointToPack the point in which the coordinates of 'p' are stored. Modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointToPack} are not expressed * in the same reference frame. */ default void pointOnLineGivenParameter(double t, FixedFramePoint3DBasics pointToPack) { checkReferenceFrameMatch(pointToPack); Line3DReadOnly.super.pointOnLineGivenParameter(t, pointToPack); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. * @throws ReferenceFrameMismatchException if {@code this} and {@code otherLine} are not expressed * in the same reference frame. */ default double closestPointsWith(FrameLine3DReadOnly otherLine, FramePoint3DBasics closestPointOnThisLineToPack, Point3DBasics closestPointOnOtherLineToPack) { checkReferenceFrameMatch(otherLine); closestPointOnThisLineToPack.setReferenceFrame(getReferenceFrame()); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. * @throws ReferenceFrameMismatchException if {@code this} and {@code otherLine} are not expressed * in the same reference frame. */ default double closestPointsWith(FrameLine3DReadOnly otherLine, Point3DBasics closestPointOnThisLineToPack, FramePoint3DBasics closestPointOnOtherLineToPack) { checkReferenceFrameMatch(otherLine); closestPointOnOtherLineToPack.setReferenceFrame(getReferenceFrame()); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. * @throws ReferenceFrameMismatchException if {@code this} and {@code otherLine} are not expressed * in the same reference frame. */ default double closestPointsWith(FrameLine3DReadOnly otherLine, FramePoint3DBasics closestPointOnThisLineToPack, FramePoint3DBasics closestPointOnOtherLineToPack) { checkReferenceFrameMatch(otherLine); closestPointOnThisLineToPack.setReferenceFrame(getReferenceFrame()); closestPointOnOtherLineToPack.setReferenceFrame(getReferenceFrame()); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }