/** * Sets this line segment to be same as the given line segment. * * @param other the other line segment to copy. Not modified. */ @Override public void set(LineSegment3D other) { LineSegment3DBasics.super.set(other); }
/** * Tests on a per-component basis on both endpoints if this line segment is equal to {@code other} * with the tolerance {@code epsilon}. * * @param other the query. Not modified. * @param epsilon the tolerance to use. * @return {@code true} if the two line segments are equal, {@code false} otherwise. */ @Override public boolean epsilonEquals(LineSegment3D other, double epsilon) { return LineSegment3DBasics.super.epsilonEquals(other, epsilon); }
/** * Compares {@code this} to {@code other} to determine if the two line segments are geometrically * similar. * <p> * The comparison is based on comparing the line segments' endpoints. Two line segments are * considered geometrically equal even if they are defined with opposite direction. * </p> * * @param other the line segment to compare to. Not modified. * @param epsilon the tolerance of the comparison. * @return {@code true} if the two line segments represent the same geometry, {@code false} * otherwise. */ @Override public boolean geometricallyEquals(LineSegment3D other, double epsilon) { return LineSegment3DBasics.super.geometricallyEquals(other, epsilon); }
/** * Redefines this line segment with new endpoints. * * @param firstEndpoint new endpoint of this line segment. Not modified * @param secondEndpoint new second endpoint of this line segment. Not modified. */ default void set(Point3DReadOnly firstEndpoint, Point3DReadOnly secondEndpoint) { setFirstEndpoint(firstEndpoint); setSecondEndpoint(secondEndpoint); }
/** * Swaps this line segment's endpoints. */ default void flipDirection() { double x = getFirstEndpointX(); double y = getFirstEndpointY(); double z = getFirstEndpointZ(); setFirstEndpoint(getSecondEndpoint()); setSecondEndpoint(x, y, z); }
/** * Transforms this line segment using the inverse of the given homogeneous transformation matrix. * * @param transform the transform to apply on the endpoints of this line segment. Not modified. */ @Override default void applyInverseTransform(Transform transform) { getFirstEndpoint().applyInverseTransform(transform); getSecondEndpoint().applyInverseTransform(transform); } }
/** * Translates this line segment by the given (x, y, z) contained in {@code translation}. * <p> * Note that the length and direction of this line segment remains unchanged. * </p> * * @param translation the translation to add to each endpoint of this line segment. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code translation} are not expressed * in the same reference frame. */ default void translate(FrameTuple3DReadOnly translation) { checkReferenceFrameMatch(translation); LineSegment3DBasics.super.translate(translation); } }
/** * Changes the second endpoint of this line segment. * * @param secondEndpointX x-coordinate of the new second endpoint. * @param secondEndpointY y-coordinate of the new second endpoint. * @param secondEndpointZ z-coordinate of the new second endpoint. */ default void setSecondEndpoint(double secondEndpointX, double secondEndpointY, double secondEndpointZ) { getSecondEndpoint().set(secondEndpointX, secondEndpointY, secondEndpointZ); }
/** * Changes the first endpoint of this line segment. * * @param firstEndpointX x-coordinate of the new first endpoint. * @param firstEndpointY y-coordinate of the new first endpoint. * @param firstEndpointZ z-coordinate of the new first endpoint. */ default void setFirstEndpoint(double firstEndpointX, double firstEndpointY, double firstEndpointZ) { getFirstEndpoint().set(firstEndpointX, firstEndpointY, firstEndpointZ); }
/** * Sets both endpoints of this line segment to zero. */ @Override default void setToZero() { getFirstEndpoint().setToZero(); getSecondEndpoint().setToZero(); }
/** * Redefines this line segments with new endpoints. * * @param firstEndpointX x-coordinate of the new first endpoint. * @param firstEndpointY y-coordinate of the new first endpoint. * @param firstEndpointZ z-coordinate of the new first endpoint. * @param secondEndpointX x-coordinate of the new second endpoint. * @param secondEndpointY y-coordinate of the new second endpoint. * @param secondEndpointZ z-coordinate of the new second endpoint. */ default void set(double firstEndpointX, double firstEndpointY, double firstEndpointZ, double secondEndpointX, double secondEndpointY, double secondEndpointZ) { setFirstEndpoint(firstEndpointX, firstEndpointY, firstEndpointZ); setSecondEndpoint(secondEndpointX, secondEndpointY, secondEndpointZ); }
/** * Translates this line segment by the given (x, y, z) contained in {@code translation}. * <p> * Note that the length and direction of this line segment remains unchanged. * </p> * * @param translation the translation to add to each endpoint of this line segment. Not modified. */ default void translate(Tuple3DReadOnly translation) { translate(translation.getX(), translation.getY(), translation.getZ()); }
/** * Changes the second endpoint of this line segment. * * @param secondEndpoint new second endpoint of this line segment. Not modified. */ default void setSecondEndpoint(Point3DReadOnly secondEndpoint) { getSecondEndpoint().set(secondEndpoint); }
/** * Changes the first endpoint of this line segment. * * @param firstEndpoint new endpoint of this line segment. Not modified. */ default void setFirstEndpoint(Point3DReadOnly firstEndpoint) { getFirstEndpoint().set(firstEndpoint); }
/** * Redefines this line segment with new endpoints. * * @param firstEndpoint new endpoint of this line segment. Not modified * @param secondEndpoint new second endpoint of this line segment. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code secondEndpoint} are not * expressed in the same reference frame. */ default void set(Point3DReadOnly firstEndpoint, FramePoint3DReadOnly secondEndpoint) { checkReferenceFrameMatch(secondEndpoint); LineSegment3DBasics.super.set(firstEndpoint, secondEndpoint); }
/** * Tests if this line segment contains {@link Double#NaN}. * * @return {@code true} if {@link #getFirstEndpoint()} and/or {@link #getSecondEndpoint()} contains * {@link Double#NaN}, {@code false} otherwise. */ @Override default boolean containsNaN() { return getFirstEndpoint().containsNaN() || getSecondEndpoint().containsNaN(); }
/** * Redefines this line segment with new endpoints. * * @param firstEndpoint new endpoint of this line segment. Not modified * @param secondEndpoint new second endpoint of this line segment. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code firstEndpoint} are not * expressed in the same reference frame. */ default void set(FramePoint3DReadOnly firstEndpoint, Point3DReadOnly secondEndpoint) { checkReferenceFrameMatch(firstEndpoint); LineSegment3DBasics.super.set(firstEndpoint, secondEndpoint); }
/** * Sets both endpoints of this line segment to {@link Double#NaN}. After calling this method, this * line segment becomes invalid. A new pair of valid endpoints will have to be set so this line * segment is again usable. */ @Override default void setToNaN() { getFirstEndpoint().setToNaN(); getSecondEndpoint().setToNaN(); }
/** * Redefines this line segment with a new first endpoint and a vector going from the first to the * second endpoint. * * @param firstEndpoint new first endpoint. Not modified. * @param fromFirstToSecondEndpoint vector going from the first to the second endpoint. Not * modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code fromFirstToSecondEndpoint} are * not expressed in the same reference frame. */ default void set(Point3DReadOnly firstEndpoint, FrameVector3DReadOnly fromFirstToSecondEndpoint) { checkReferenceFrameMatch(fromFirstToSecondEndpoint); LineSegment3DBasics.super.set(firstEndpoint, fromFirstToSecondEndpoint); }
/** * Transforms this line segment using the given homogeneous transformation matrix. * * @param transform the transform to apply on the endpoints of this line segment. Not modified. */ @Override default void applyTransform(Transform transform) { getFirstEndpoint().applyTransform(transform); getSecondEndpoint().applyTransform(transform); }