/** * Sets this line to be the same as the given line. * * @param referenceFrame the reference frame in which the given line is expressed. * @param other the line to copy. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code other} are not expressed in * the same reference frame. */ default void set(FrameLine2DReadOnly other) { set(other.getReferenceFrame(), other); }
/** * Sets this line to be the same as the given line. * * @param other the other line to copy. Not modified. */ default void setIncludingFrame(FrameLine2DReadOnly other) { setIncludingFrame(other.getReferenceFrame(), other); }
/** * Sets this line to be the same as the given line. * <p> * After calling this method this line is in the XY-plane. * </p> * * @param frameLine2DReadOnly the line to copy. Not modified. */ default void setIncludingFrame(FrameLine2DReadOnly frameLine2DReadOnly) { setIncludingFrame(frameLine2DReadOnly.getReferenceFrame(), frameLine2DReadOnly); }
/** * Sets this line to be the same as the given line. * <p> * After calling this method this line is in the XY-plane. * </p> * * @param referenceFrame the reference frame in which the given line is expressed. * @param frameLine2DReadOnly the line to copy. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code frameLine2DReadOnly} are not * expressed in the same reference frame. */ default void set(FrameLine2DReadOnly frameLine2DReadOnly) { set(frameLine2DReadOnly.getReferenceFrame(), frameLine2DReadOnly); }
/** * 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. */ default void getTwoPointsOnLine(FramePoint2DBasics firstPointOnLineToPack, FramePoint2DBasics secondPointOnLineToPack) { firstPointOnLineToPack.setReferenceFrame(getReferenceFrame()); secondPointOnLineToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.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. */ default void get(FramePoint2DBasics pointToPack, FrameVector2DBasics directionToPack) { pointToPack.setReferenceFrame(getReferenceFrame()); directionToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.super.get(pointToPack, directionToPack); }
/** {@inheritDoc} */ @Override default FramePoint2DBasics intersectionWith(LineSegment2DReadOnly lineSegment) { Point2DBasics intersection = Line2DReadOnly.super.intersectionWith(lineSegment); if (intersection == null) return null; else return new FramePoint2D(getReferenceFrame(), intersection); }
/** * 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. */ default void getTwoPointsOnLine(FramePoint2DBasics firstPointOnLineToPack, Point2DBasics secondPointOnLineToPack) { firstPointOnLineToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.super.getTwoPointsOnLine(firstPointOnLineToPack, secondPointOnLineToPack); }
/** {@inheritDoc} */ @Override default FramePoint2DBasics intersectionWith(Line2DReadOnly secondLine) { Point2DBasics intersection = Line2DReadOnly.super.intersectionWith(secondLine); if (intersection == null) return null; else return new FramePoint2D(getReferenceFrame(), intersection); }
/** {@inheritDoc} */ @Override default FramePoint2DBasics orthogonalProjectionCopy(Point2DReadOnly pointToProject) { Point2DBasics projection = Line2DReadOnly.super.orthogonalProjectionCopy(pointToProject); if (projection == null) return null; else return new FramePoint2D(getReferenceFrame(), projection); }
/** {@inheritDoc} */ @Override default FrameVector2DBasics perpendicularVector() { return new FrameVector2D(getReferenceFrame(), Line2DReadOnly.super.perpendicularVector()); }
/** * Packs into {@code vectorToPack} the vector that is perpendicular to this line and pointing to * the left. * * @param vectorToPack the perpendicular vector to this line. Modified. */ default void perpendicularVector(FrameVector2DBasics vectorToPack) { vectorToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.super.perpendicularVector(vectorToPack); }
/** {@inheritDoc} */ @Override default FramePoint2DBasics pointOnLineGivenParameter(double t) { return new FramePoint2D(getReferenceFrame(), Line2DReadOnly.super.pointOnLineGivenParameter(t)); }
/** {@inheritDoc} */ @Override default FrameLine2DBasics perpendicularLineThroughPoint(Point2DReadOnly point) { return new FrameLine2D(getReferenceFrame(), Line2DReadOnly.super.perpendicularLineThroughPoint(point)); }
/** * 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. */ default void getTwoPointsOnLine(Point2DBasics firstPointOnLineToPack, FramePoint2DBasics secondPointOnLineToPack) { secondPointOnLineToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.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. */ default void get(FramePoint2DBasics pointToPack, Vector2DBasics directionToPack) { pointToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.super.get(pointToPack, directionToPack); }
/** * Modifies {@code perpendicularLineToPack} such that it is perpendicular to this line, with its * direction pointing to the left of this line, while going through the given point. * * @param point the point the line has to go through. Not modified. * @param perpendicularLineToPack the line perpendicular to {@code this} and going through * {@code point}. Modified. */ default void perpendicularLineThroughPoint(Point2DReadOnly point, FrameLine2DBasics perpendicularLineToPack) { perpendicularLineToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.super.perpendicularLineThroughPoint(point, perpendicularLineToPack); }
/** {@inheritDoc} */ @Override default FrameLine2DBasics interiorBisector(Line2DReadOnly secondLine) { return new FrameLine2D(getReferenceFrame(), Line2DReadOnly.super.interiorBisector(secondLine)); }
/** * 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. */ default void get(Point2DBasics pointToPack, FrameVector2DBasics directionToPack) { directionToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.super.get(pointToPack, directionToPack); }
/** * Modifies {@code perpendicularLineToPack} such that it is perpendicular to this line, with its * direction pointing to the left of this line, while going through the given point. * * @param point the point the line has to go through. Not modified. * @param perpendicularLineToPack the line perpendicular to {@code this} and going through * {@code point}. Modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code point} are not expressed in * the same reference frame. */ default void perpendicularLineThroughPoint(FramePoint2DReadOnly point, FrameLine2DBasics perpendicularLineToPack) { checkReferenceFrameMatch(point); perpendicularLineToPack.setReferenceFrame(getReferenceFrame()); Line2DReadOnly.super.perpendicularLineThroughPoint(point, perpendicularLineToPack); }