/** * 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 either of the given arguments is not expressed in * the same reference frame as this frame line. */ default void getTwoPointsOnLine(FixedFramePoint2DBasics firstPointOnLineToPack, FixedFramePoint2DBasics secondPointOnLineToPack) { checkReferenceFrameMatch(firstPointOnLineToPack); checkReferenceFrameMatch(secondPointOnLineToPack); 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. * @throws ReferenceFrameMismatchException if either argument is not expressed in the same * reference frame as this frame line 2D. */ default void get(FixedFramePoint2DBasics pointToPack, FixedFrameVector2DBasics directionToPack) { checkReferenceFrameMatch(pointToPack); checkReferenceFrameMatch(directionToPack); 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}, {@code point}, and * {@code perpendicularLineToPack} are not expressed in the same reference frame. */ default void perpendicularLineThroughPoint(FramePoint2DReadOnly point, FixedFrameLine2DBasics perpendicularLineToPack) { checkReferenceFrameMatch(point); checkReferenceFrameMatch(perpendicularLineToPack); Line2DReadOnly.super.perpendicularLineThroughPoint(point, perpendicularLineToPack); }
public int cutPolygonWithLine(FrameLine2DReadOnly cuttingLine, FixedFrameConvexPolygon2DBasics polygonToCut, RobotSide sideOfLineToCut) { cuttingLine.checkReferenceFrameMatch(polygonToCut); return cutPolygonWithLine(cuttingLine, (ConvexPolygon2DBasics) polygonToCut, sideOfLineToCut); }
/** * 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. * @throws ReferenceFrameMismatchException if {@code this} and {@code vectorToPack} are not * expressed in the same reference frame. */ default void perpendicularVector(FixedFrameVector2DBasics vectorToPack) { checkReferenceFrameMatch(vectorToPack); Line2DReadOnly.super.perpendicularVector(vectorToPack); }
/** * Tests if this line and the other line are perpendicular. * * @param other the query. Not modified. * @return {@code true} if the two lines are perpendicular, {@code false} otherwise. * @throws ReferenceFrameMismatchException if {@code this} and {@code other} are not expressed in * the same reference frame. */ default boolean areLinesPerpendicular(FrameLine2DReadOnly other) { checkReferenceFrameMatch(other); return Line2DReadOnly.super.areLinesPerpendicular(other); }
/** * Computes the coordinates of the possible intersection(s) between this line and the given * convex polygon 2D. * * @param convexPolygon the convex polygon this line may intersect. Not modified. * @return the intersections between between the line and the polygon or {@code null} if the * method failed or if there is no intersections. * @see #intersectionWith(ConvexPolygon2DReadOnly) */ default FramePoint2DBasics[] intersectionWith(FrameConvexPolygon2DReadOnly convexPolygon) { checkReferenceFrameMatch(convexPolygon); return intersectionWith((ConvexPolygon2DReadOnly) convexPolygon); }
/** * 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(Point2DBasics firstPointOnLineToPack, FixedFramePoint2DBasics secondPointOnLineToPack) { checkReferenceFrameMatch(secondPointOnLineToPack); Line2DReadOnly.super.getTwoPointsOnLine(firstPointOnLineToPack, secondPointOnLineToPack); }
/** * 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(FrameLine2DReadOnly other, double epsilon) { checkReferenceFrameMatch(other); return Line2DReadOnly.super.isCollinear(other, epsilon); }
/** * 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(FixedFramePoint2DBasics firstPointOnLineToPack, Point2DBasics secondPointOnLineToPack) { checkReferenceFrameMatch(firstPointOnLineToPack); 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. * @throws ReferenceFrameMismatchException if {@code pointToPack} is not expressed in the same * reference frame as this frame line 2D. */ default void get(FixedFramePoint2DBasics pointToPack, Vector2DBasics directionToPack) { checkReferenceFrameMatch(pointToPack); Line2DReadOnly.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(FrameLine2DReadOnly other, double angleEpsilon, double distanceEpsilon) { checkReferenceFrameMatch(other); return Line2DReadOnly.super.isCollinear(other, angleEpsilon, distanceEpsilon); }
/** * 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, Line2DBasics perpendicularLineToPack) { checkReferenceFrameMatch(point); Line2DReadOnly.super.perpendicularLineThroughPoint(point, perpendicularLineToPack); }
/** * 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 perpendicularLineToPack} * are not expressed in the same reference frame. */ default void perpendicularLineThroughPoint(Point2DReadOnly point, FixedFrameLine2DBasics perpendicularLineToPack) { checkReferenceFrameMatch(perpendicularLineToPack); Line2DReadOnly.super.perpendicularLineThroughPoint(point, perpendicularLineToPack); }
/** * 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 2D. */ default void get(Point2DBasics pointToPack, FixedFrameVector2DBasics directionToPack) { checkReferenceFrameMatch(directionToPack); Line2DReadOnly.super.get(pointToPack, directionToPack); }
/** * Returns a boolean value, stating whether the query point is in front of this line or not. * <p> * The idea of 'front' refers to the side of the line toward which the x-axis is pointing. * </p> * * @param point the coordinates of the query. Not modified. * @return {@code true} if the point is in front of this line, {@code false} if the point is * behind the line. * @throws RuntimeException if the given point is located exactly on this line. * @throws ReferenceFrameMismatchException if {@code this} and {@code point} are not expressed in * the same reference frame. */ default boolean isPointInFrontOfLine(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return Line2DReadOnly.super.isPointInFrontOfLine(point); }
/** * 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 1.0e-8} from it. * </p> * * @param point the coordinates of the query. Not modified. * @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(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return Line2DReadOnly.super.isPointOnLine(point); }
/** * Returns a boolean value, stating whether the query point is in behind of this line or not. * <p> * The idea of 'behind' refers to the side of the line the x-axis is pointing away. * </p> * * @param point the coordinates of the query. Not modified. * @return {@code true} if the point is in behind of this line, {@code false} if the point is * front the line. * @throws RuntimeException if the given point is located exactly on this line. * @throws ReferenceFrameMismatchException if {@code this} and {@code point} are not expressed in * the same reference frame. */ default boolean isPointBehindLine(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return Line2DReadOnly.super.isPointBehindLine(point); }
/** * Calculates and returns a line that is perpendicular to this line, with its direction pointing * to the left of this line, while going through the given point. * <p> * WARNING: This method generates garbage. * </p> * * @param point the point the line has to go through. Not modified. * @return the line perpendicular to {@code this} and going through {@code point}. * @throws ReferenceFrameMismatchException if {@code this} and {@code point} are not expressed in * the same reference frame. */ default FrameLine2DBasics perpendicularLineThroughPoint(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return new FrameLine2D(getReferenceFrame(), Line2DReadOnly.super.perpendicularLineThroughPoint(point)); }
/** * 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); }