/** * Computes the orthogonal projection of a 2D point on this 2D convex polygon. * * @param pointToProject the point to project on this polygon. Modified. * @return whether the method succeeded or not. * @throws ReferenceFrameMismatchException if {@code pointToProject} and {@code this} are not * expressed in the same reference frame. * @see #orthogonalProjection(Point2DBasics) */ default boolean orthogonalProjection(FixedFramePoint2DBasics pointToProject) { checkReferenceFrameMatch(pointToProject); return ConvexPolygon2DReadOnly.super.orthogonalProjection(pointToProject); }
/** * Computes the orthogonal projection of a 2D point on this 2D convex polygon. * * @param pointToProject the coordinate of the point to compute the projection of. Not modified. * @return the coordinates of the projection, or {@code null} if the method failed. * @throws ReferenceFrameMismatchException if {@code pointToProject} and {@code this} are not * expressed in the same reference frame. * @see #orthogonalProjectionCopy(Point2DReadOnly) */ default FramePoint2DBasics orthogonalProjectionCopy(FramePoint2DReadOnly pointToProject) { checkReferenceFrameMatch(pointToProject); return orthogonalProjectionCopy((Point2DReadOnly) pointToProject); }
/** * Packs the endpoints of an edge of this polygon into {@code edgeToPack}. * * @param edgeIndex index of the vertex that starts the edge. * @param edgeToPack line segment used to store the edge endpoints. Modified. * @throws ReferenceFrameMismatchException if {@code edge} and {@code this} are not expressed in * the same reference frame. * @see #getEdge(int, LineSegment2DBasics) */ default void getEdge(int edgeIndex, FixedFrameLineSegment2DBasics edgeToPack) { checkReferenceFrameMatch(edgeToPack); ConvexPolygon2DReadOnly.super.getEdge(edgeIndex, edgeToPack); }
/** * Computes the coordinates of the closest point to the ray that belongs to this convex polygon. * * @param ray the ray to find the closest point to. Not modified. * @return the coordinates of the closest point if the method succeeds, {@code null} otherwise. * @throws ReferenceFrameMismatchException if {@code ray} and {@code this} are not expressed in * the same reference frame. * @see #getClosestPointWithRay(Line2DReadOnly) */ default FramePoint2DBasics getClosestPointWithRay(FrameLine2DReadOnly ray) { checkReferenceFrameMatch(ray); return getClosestPointWithRay((Line2DReadOnly) ray); }
/** * Calculates the minimum distance between the point and this polygon. * * @param point the coordinates of the query. Not modified. * @return the value of the distance between the point and this polygon. * @throws ReferenceFrameMismatchException if {@code point} and {@code this} are not expressed in * the same reference frame. * @see #distance(Point2DReadOnly) */ default double distance(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return ConvexPolygon2DReadOnly.super.distance(point); }
/** * Finds the index of the closest edge to the query. * * @param point the coordinates of the query. Not modified. * @return the index of the closest edge to the query. * @throws ReferenceFrameMismatchException if {@code point} and {@code this} are not expressed in * the same reference frame. * @see #getClosestEdgeIndex(Point2DReadOnly) */ default int getClosestEdgeIndex(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return ConvexPolygon2DReadOnly.super.getClosestEdgeIndex(point); }
/** * Finds the index of the closest vertex to the query. * * @param point the coordinates of the query. Not modified. * @return the index of the closest vertex to the query. * @throws ReferenceFrameMismatchException if {@code point} and {@code this} are not expressed in * the same reference frame. * @see #getClosestVertexIndex(Point2DReadOnly) */ default int getClosestVertexIndex(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return ConvexPolygon2DReadOnly.super.getClosestVertexIndex(point); }
/** * Finds the index of the closest vertex to the given line. * * @param line the query. Not modified. * @return the coordinates of the closest vertex or {@code null} if this method failed. * @throws ReferenceFrameMismatchException if {@code line} and {@code this} are not expressed in * the same reference frame. * @see #getClosestVertexCopy(Line2DReadOnly) */ default FramePoint2DBasics getClosestVertexCopy(FrameLine2DReadOnly line) { checkReferenceFrameMatch(line); return getClosestVertexCopy((Line2DReadOnly) line); }
/** * Finds the index of the closest edge to the query. * * @param point the coordinates of the query. Not modified. * @return the line segment representing the closest edge or {@code null} if this method failed. * @throws ReferenceFrameMismatchException if {@code point} and {@code this} are not expressed in * the same reference frame. * @see #getClosestEdgeCopy(Point2DReadOnly) */ default FrameLineSegment2DBasics getClosestEdgeCopy(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return getClosestEdgeCopy((Point2DReadOnly) point); }
/** * Finds the index of the closest vertex to the query. * * @param point the coordinates of the query. Not modified. * @return the coordinates of the closest vertex, or {@code null} if this method failed. * @throws ReferenceFrameMismatchException if {@code point} and {@code this} are not expressed in * the same reference frame. * @see #getClosestVertexCopy(Point2DReadOnly) */ default FramePoint2DBasics getClosestVertexCopy(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return getClosestVertexCopy((Point2DReadOnly) point); }
/** * Finds the index of the closest vertex to the given line. * * @param line the query. Not modified. * @return the index of the closest vertex to the query. * @throws ReferenceFrameMismatchException if {@code line} and {@code this} are not expressed in * the same reference frame. * @see #getClosestVertexIndex(Line2DReadOnly) */ default int getClosestVertexIndex(FrameLine2DReadOnly line) { checkReferenceFrameMatch(line); return ConvexPolygon2DReadOnly.super.getClosestVertexIndex(line); }
/** * Copies this polygon, translates the copy, and returns it. * * @param translation the translation to apply to the copy of this polygon. Not modified. * @return the copy of this polygon translated. * @throws ReferenceFrameMismatchException if {@code translation} and {@code this} are not * expressed in the same reference frame. * @see #translateCopy(Tuple2DReadOnly) */ default FrameConvexPolygon2DBasics translateCopy(FrameTuple2DReadOnly translation) { checkReferenceFrameMatch(translation); return translateCopy((Tuple2DReadOnly) translation); }
/** * Tests if the given point lies on an edge of this convex polygon. * * @param point the coordinates of the query. Not modified. * @return {@code true} if the point is considered to be on an edge of this polygon, * {@code false} otherwise. * @throws ReferenceFrameMismatchException if {@code point} and {@code this} are not expressed in * the same reference frame. * @see #pointIsOnPerimeter(Point2DReadOnly) */ default boolean pointIsOnPerimeter(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return ConvexPolygon2DReadOnly.super.pointIsOnPerimeter(point); }
/** * Finds the index of the closest edge to the query. * * @param point the coordinates of the query. Not modified. * @param closestEdgeToPack the line segment used to store the result. Not modified. * @return whether this method succeeded or not. * @throws ReferenceFrameMismatchException if {@code closestEdgetoPack} and {@code this} are not * expressed in the same reference frame. * @see #getClosestEdge(Point2DReadOnly, LineSegment2DBasics) */ default boolean getClosestEdge(Point2DReadOnly point, FixedFrameLineSegment2DBasics closestEdgeToPack) { checkReferenceFrameMatch(closestEdgeToPack); return ConvexPolygon2DReadOnly.super.getClosestEdge(point, closestEdgeToPack); }
/** * Finds the index of the closest vertex to the given line. * * @param line the query. Not modified. * @param vertexToPack point used to store the result. Modified. * @return whether this method succeeded or not. * @throws ReferenceFrameMismatchException if {@code vertexToPack} and {@code this} are not * expressed in the same reference frame. * @see #getClosestVertex(Line2DReadOnly, Point2DBasics) */ default boolean getClosestVertex(Line2DReadOnly line, FixedFramePoint2DBasics vertexToPack) { checkReferenceFrameMatch(vertexToPack); return ConvexPolygon2DReadOnly.super.getClosestVertex(line, vertexToPack); }
/** * Tests if the given point is inside this polygon or exactly on and edge/vertex of this polygon. * * @param point the query. Not modified. * @return {@code true} if the query is inside this polygon, {@code false} otherwise. * @throws ReferenceFrameMismatchException if {@code point} and {@code this} are not expressed in * the same reference frame. * @see #isPointInside(Point2DReadOnly) */ default boolean isPointInside(FramePoint2DReadOnly point) { checkReferenceFrameMatch(point); return ConvexPolygon2DReadOnly.super.isPointInside(point); }
/** * Computes the coordinates of the possible intersection(s) between a given line segment 2D and * this convex polygon 2D. * * @param lineSegment2D the line segment that may intersect this polygon. Not modified. * @return the intersections between the line segment and the polygon. * @throws ReferenceFrameMismatchException if {@code lineSegment2D} and {@code this} are not * expressed in the same reference frame. * @see #intersectionWith(LineSegment2DReadOnly) */ default FramePoint2DBasics[] intersectionWith(FrameLineSegment2DReadOnly lineSegment2D) { checkReferenceFrameMatch(lineSegment2D); return intersectionWith((LineSegment2DReadOnly) lineSegment2D); }
/** * Finds the index of the closest edge to the query. * * @param point the coordinates of the query. Not modified. * @param closestEdgeToPack the line segment used to store the result. Not modified. * @return whether this method succeeded or not. * @throws ReferenceFrameMismatchException if {@code point} and {@code this} are not expressed in * the same reference frame. * @see #getClosestEdge(Point2DReadOnly, LineSegment2DBasics) */ default boolean getClosestEdge(FramePoint2DReadOnly point, LineSegment2DBasics closestEdgeToPack) { checkReferenceFrameMatch(point); return ConvexPolygon2DReadOnly.super.getClosestEdge(point, closestEdgeToPack); }
/** * Adds a subset of this polygon's vertices into the given polygon. * * @param startIndexInclusive the index of the first vertex to add. * @param endIndexInclusive the index of the last vertex to add. * @param polygonToPack the polygon into which the vertices are to be added. * @throws ReferenceFrameMismatchException if {@code polygonToPack} and {@code this} are not * expressed in the same reference frame. * @see #getVerticesInClockwiseOrder(int, int, ConvexPolygon2DBasics) */ default void getVerticesInClockwiseOrder(int startIndexInclusive, int endIndexInclusive, FixedFrameConvexPolygon2DBasics polygonToPack) { checkReferenceFrameMatch(polygonToPack); ConvexPolygon2DReadOnly.super.getVerticesInClockwiseOrder(startIndexInclusive, endIndexInclusive, polygonToPack); }
/** * Finds the index of the closest vertex to the given line. * * @param line the query. Not modified. * @param vertexToPack point used to store the result. Modified. * @return whether this method succeeded or not. * @throws ReferenceFrameMismatchException if {@code line} and {@code this} are not expressed in * the same reference frame. * @see #getClosestVertex(Line2DReadOnly, Point2DBasics) */ default boolean getClosestVertex(FrameLine2DReadOnly line, Point2DBasics vertexToPack) { checkReferenceFrameMatch(line); return ConvexPolygon2DReadOnly.super.getClosestVertex(line, vertexToPack); }