/** * 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. */ default void set(Point3DReadOnly pointOnLine, Vector3DReadOnly lineDirection) { setPoint(pointOnLine); setDirection(lineDirection); }
/** * Changes the point through which this line has to go. * * @param pointOnLine new point on this line. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointOnLine} are not * expressed in the same reference frame. */ default void setPoint(FramePoint2DReadOnly pointOnLine) { checkReferenceFrameMatch(pointOnLine); Line2DBasics.super.setPoint(pointOnLine); }
/** * 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. */ default void set(Point2DReadOnly pointOnLine, Vector2DReadOnly lineDirection) { setPoint(pointOnLine); setDirection(lineDirection); }
/** * Changes the point through which this line has to go. * * @param pointOnLine new point on this line. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointOnLine} are not * expressed in the same reference frame. */ default void setPoint(FramePoint3DReadOnly pointOnLine) { checkReferenceFrameMatch(pointOnLine); Line2DBasics.super.setPoint(pointOnLine); }
/** * Redefines this line with a new point and a new direction vector. * * @param pointOnLineX the new x-coordinate of the point on this line. * @param pointOnLineY the new y-coordinate of the point on this line. * @param lineDirectionX the new x-component of the direction of this line. * @param lineDirectionY the new y-component of the direction of this line. */ default void set(double pointOnLineX, double pointOnLineY, double lineDirectionX, double lineDirectionY) { setPoint(pointOnLineX, pointOnLineY); setDirection(lineDirectionX, lineDirectionY); }
/** * 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. */ default void set(Point2DReadOnly firstPointOnLine, Point2DReadOnly secondPointOnLine) { // checkDistinctPoints if (firstPointOnLine.equals(secondPointOnLine)) { throw new RuntimeException("Tried to create a line from two coincidal points."); } setPoint(firstPointOnLine); getDirection().sub(secondPointOnLine, firstPointOnLine); getDirection().normalize(); }
/** * 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. */ default void set(Point3DReadOnly firstPointOnLine, Point3DReadOnly secondPointOnLine) { // checkDistinctPoints if (firstPointOnLine.equals(secondPointOnLine)) { throw new RuntimeException("Tried to create a line from two coincidal points."); } setPoint(firstPointOnLine); getDirection().set(secondPointOnLine); getDirection().sub(firstPointOnLine.getX(), firstPointOnLine.getY()); getDirection().normalize(); }