/** * Redefines this line with a new point and a new direction vector. * * @param pointOnLine new point on this line. Not modified. * @param lineDirection new direction of this line. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointOnLine} are not * expressed in the same reference frame. */ default void set(FramePoint2DReadOnly pointOnLine, Vector2DReadOnly lineDirection) { set(pointOnLine.getReferenceFrame(), pointOnLine, lineDirection); }
/** * Redefines this line such that it goes through the two given points in the given reference frame. * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. */ default void setIncludingFrame(FramePoint2DReadOnly firstPointOnLine, Point2DReadOnly secondPointOnLine) { setIncludingFrame(firstPointOnLine.getReferenceFrame(), firstPointOnLine, secondPointOnLine); }
/** * Changes the second endpoint of this line segment. * * @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 setSecondEndpoint(FramePoint2DReadOnly secondEndpoint) { setSecondEndpoint(secondEndpoint.getReferenceFrame(), secondEndpoint); }
/** * Redefines this line with a new point, a new direction vector, and a new reference frame. * <p> * After calling this method this line is in the XY-plane. * </p> * * @param pointOnLine new point on this line. Not modified. * @param lineDirection new direction of this line. Not modified. */ default void setIncludingFrame(FramePoint2DReadOnly pointOnLine, Vector2DReadOnly lineDirection) { setIncludingFrame(pointOnLine.getReferenceFrame(), pointOnLine, lineDirection); }
/** * Redefines this line with a new point, a new direction vector, and a new reference frame. * * @param pointOnLine new point on this line. Not modified. * @param lineDirection new direction of this line. Not modified. */ default void setIncludingFrame(FramePoint2DReadOnly pointOnLine, Vector2DReadOnly lineDirection) { setIncludingFrame(pointOnLine.getReferenceFrame(), pointOnLine, lineDirection); }
/** * Redefines this line such that it goes through the two given points. * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code secondPointOnLine} are not * expressed in the same reference frame. */ default void set(Point2DReadOnly firstPointOnLine, FramePoint2DReadOnly secondPointOnLine) { set(secondPointOnLine.getReferenceFrame(), firstPointOnLine, secondPointOnLine); }
/** * Redefines this line such that it goes through the two given points in the given reference frame. * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. */ default void setIncludingFrame(Point2DReadOnly firstPointOnLine, FramePoint2DReadOnly secondPointOnLine) { setIncludingFrame(secondPointOnLine.getReferenceFrame(), firstPointOnLine, secondPointOnLine); }
/** * Redefines this line such that it goes through the two given points. * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code firstPointOnLine} are not * expressed in the same reference frame. */ default void set(FramePoint2DReadOnly firstPointOnLine, Point2DReadOnly secondPointOnLine) { set(firstPointOnLine.getReferenceFrame(), firstPointOnLine, secondPointOnLine); }
/** * Changes the first endpoint of this line segment. * * @param firstEndpoint new 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 setFirstEndpoint(FramePoint2DReadOnly firstEndpoint) { setFirstEndpoint(firstEndpoint.getReferenceFrame(), firstEndpoint); }
/** * Redefines this line such that it goes through the two given points in the given reference frame. * <p> * After calling this method this line is in the XY-plane. * </p> * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. */ default void setIncludingFrame(FramePoint2DReadOnly firstPointOnLine, Point2DReadOnly secondPointOnLine) { setIncludingFrame(firstPointOnLine.getReferenceFrame(), firstPointOnLine, secondPointOnLine); }
/** * Redefines this line such that it goes through the two given points in the given reference frame. * <p> * After calling this method this line is in the XY-plane. * </p> * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. */ default void setIncludingFrame(Point2DReadOnly firstPointOnLine, FramePoint2DReadOnly secondPointOnLine) { setIncludingFrame(secondPointOnLine.getReferenceFrame(), firstPointOnLine, secondPointOnLine); }
/** * Redefines this line with a new point and a new direction vector. * <p> * After calling this method this line is in the XY-plane. * </p> * * @param pointOnLine new point on this line. Not modified. * @param lineDirection new direction of this line. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointOnLine} are not expressed * in the same reference frame. */ default void set(FramePoint2DReadOnly pointOnLine, Vector2DReadOnly lineDirection) { set(pointOnLine.getReferenceFrame(), pointOnLine, lineDirection); }
/** * Gets the reference frame of the first vertex or returns {@code null} if this supplier is * empty. */ @Override default ReferenceFrame getReferenceFrame() { return isEmpty() ? null : getVertex(0).getReferenceFrame(); }
/** * Redefines this line with a new point, a new direction vector, and a new reference frame. * <p> * After calling this method this line is in the XY-plane. * </p> * * @param pointOnLine new point on this line. Not modified. * @param lineDirection new direction of this line. Not modified. * @throws ReferenceFrameMismatchException if {@code pointOnLine} and {@code lineDirection} are not * expressed in the same reference frame */ default void setIncludingFrame(FramePoint2DReadOnly pointOnLine, FrameVector2DReadOnly lineDirection) { pointOnLine.checkReferenceFrameMatch(lineDirection); setIncludingFrame(pointOnLine.getReferenceFrame(), pointOnLine, lineDirection); }
/** * Redefines this line with a new point, a new direction vector, and a new reference frame. * * @param pointOnLine new point on this line. Not modified. * @param lineDirection new direction of this line. Not modified. * @throws ReferenceFrameMismatchException if {@code pointOnLine} and {@code lineDirection} are not * expressed in the same reference frame */ default void setIncludingFrame(FramePoint2DReadOnly pointOnLine, FrameVector2DReadOnly lineDirection) { pointOnLine.checkReferenceFrameMatch(lineDirection); setIncludingFrame(pointOnLine.getReferenceFrame(), pointOnLine, lineDirection); }
/** * Redefines this line such that it goes through the two given points in the given reference frame. * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. * @throws ReferenceFrameMismatchException if {@code firstPointOnLine} and {@code secondPointOnLine} * are not expressed in the same reference frame */ default void setIncludingFrame(FramePoint2DReadOnly firstPointOnLine, FramePoint2DReadOnly secondPointOnLine) { firstPointOnLine.checkReferenceFrameMatch(secondPointOnLine); setIncludingFrame(firstPointOnLine.getReferenceFrame(), firstPointOnLine, secondPointOnLine); }
/** * 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 firstEndpoint} and {@code secondEndpoint} are * not expressed in the same reference frame. */ default void setIncludingFrame(FramePoint2DReadOnly firstEndpoint, FramePoint2DReadOnly secondEndpoint) { firstEndpoint.checkReferenceFrameMatch(secondEndpoint); setIncludingFrame(firstEndpoint.getReferenceFrame(), firstEndpoint, secondEndpoint); }
/** * Redefines this line with a new point and a new direction vector. * * @param pointOnLine new point on this line. Not modified. * @param lineDirection new direction of this line. Not modified. * @throws ReferenceFrameMismatchException if {@code this}, {@code pointOnLine}, * {@code lineDirection} are not expressed in the same reference frame. */ default void set(FramePoint2DReadOnly pointOnLine, FrameVector2DReadOnly lineDirection) { pointOnLine.checkReferenceFrameMatch(lineDirection); set(pointOnLine.getReferenceFrame(), pointOnLine, lineDirection); }
/** * Redefines this line such that it goes through the two given points. * * @param firstPointOnLine first point on this line. Not modified. * @param secondPointOnLine second point on this line. Not modified. * @throws ReferenceFrameMismatchException if {@code this}, {@code firstPointOnLine}, * {@code secondPointOnLine} are not expressed in the same reference frame. */ default void set(FramePoint2DReadOnly firstPointOnLine, FramePoint2DReadOnly secondPointOnLine) { firstPointOnLine.checkReferenceFrameMatch(secondPointOnLine); set(firstPointOnLine.getReferenceFrame(), firstPointOnLine, secondPointOnLine); }
private static void assertEquals(FramePoint2DReadOnly pointA, CoPTrajectoryPoint pointB, double epsilon) { assertEquals(new FramePoint3D(pointA.getReferenceFrame(), pointA.getX(), pointA.getY(), 0.0), pointB, epsilon); }