/** * Computes the orthogonal projection of the given 2D point on this 2D line. * <p> * Edge cases: * <ul> * <li>if the given line direction is too small, i.e. * {@code lineDirection.lengthSquared() < }{@value EuclidGeometryTools#ONE_TRILLIONTH}, this method * fails and returns {@code false}. * </ul> * </p> * * @param pointToProject the point to project on this line. Modified. * @return whether the method succeeded or not. */ default boolean orthogonalProjection(Point2DBasics pointToProject) { return orthogonalProjection(pointToProject, pointToProject); }
/** * Computes the orthogonal projection of the given 2D point on this 2D line. * <p> * Edge cases: * <ul> * <li>if the given line direction is too small, i.e. * {@code lineDirection.lengthSquared() < }{@value EuclidGeometryTools#ONE_TRILLIONTH}, this * method fails and returns {@code false}. * </ul> * </p> * * @param pointToProject the point to compute the projection of. Not modified. * @param projectionToPack point in which the projection of the point onto the line is stored. * Modified. * @return whether the method succeeded or not. * @throws ReferenceFrameMismatchException if {@code this} and {@code projectionToPack} are not * expressed in the same reference frame. */ default boolean orthogonalProjection(Point2DReadOnly pointToProject, FixedFramePoint2DBasics projectionToPack) { checkReferenceFrameMatch(projectionToPack); return Line2DReadOnly.super.orthogonalProjection(pointToProject, projectionToPack); }
/** * Computes the orthogonal projection of the given 2D point on this 2D line. * <p> * Edge cases: * <ul> * <li>if the given line direction is too small, i.e. * {@code lineDirection.lengthSquared() < }{@value EuclidGeometryTools#ONE_TRILLIONTH}, this * method fails and returns {@code false}. * </ul> * </p> * * @param pointToProject the point to project on this line. Modified. * @return whether the method succeeded or not. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointToProject} are not * expressed in the same reference frame. */ default boolean orthogonalProjection(FixedFramePoint2DBasics pointToProject) { checkReferenceFrameMatch(pointToProject); return Line2DReadOnly.super.orthogonalProjection(pointToProject); }
/** * Computes the orthogonal projection of the given 2D point on this 2D line. * <p> * Edge cases: * <ul> * <li>if the given line direction is too small, i.e. * {@code lineDirection.lengthSquared() < }{@value EuclidGeometryTools#ONE_TRILLIONTH}, this * method fails and returns {@code false}. * </ul> * </p> * * @param pointToProject the point to compute the projection of. Not modified. * @param projectionToPack point in which the projection of the point onto the line is stored. * Modified. * @return whether the method succeeded or not. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointToProject} are not * expressed in the same reference frame. */ default boolean orthogonalProjection(FramePoint2DReadOnly pointToProject, Point2DBasics projectionToPack) { checkReferenceFrameMatch(pointToProject); return Line2DReadOnly.super.orthogonalProjection(pointToProject, projectionToPack); }
/** * Computes the orthogonal projection of the given 2D point on this 2D line. * <p> * Edge cases: * <ul> * <li>if the given line direction is too small, i.e. * {@code lineDirection.lengthSquared() < }{@value EuclidGeometryTools#ONE_TRILLIONTH}, this * method fails and returns {@code false}. * </ul> * </p> * * @param pointToProject the point to compute the projection of. Not modified. * @param projectionToPack point in which the projection of the point onto the line is stored. * Modified. * @return whether the method succeeded or not. */ default boolean orthogonalProjection(Point2DReadOnly pointToProject, FramePoint2DBasics projectionToPack) { projectionToPack.setReferenceFrame(getReferenceFrame()); return Line2DReadOnly.super.orthogonalProjection(pointToProject, projectionToPack); }
/** * Computes the orthogonal projection of the given 2D point on this 2D line. * <p> * Edge cases: * <ul> * <li>if the given line direction is too small, i.e. * {@code lineDirection.lengthSquared() < }{@value EuclidGeometryTools#ONE_TRILLIONTH}, this * method fails and returns {@code false}. * </ul> * </p> * * @param pointToProject the point to compute the projection of. Not modified. * @param projectionToPack point in which the projection of the point onto the line is stored. * Modified. * @return whether the method succeeded or not. * @throws ReferenceFrameMismatchException if {@code this}, {@code pointToProject}, and * {@code projectionToPack} are not expressed in the same reference frame. */ default boolean orthogonalProjection(FramePoint2DReadOnly pointToProject, FixedFramePoint2DBasics projectionToPack) { checkReferenceFrameMatch(pointToProject); checkReferenceFrameMatch(projectionToPack); return Line2DReadOnly.super.orthogonalProjection(pointToProject, projectionToPack); }
/** * Computes the orthogonal projection of the given 2D point on this 2D line. * <p> * Edge cases: * <ul> * <li>if the given line direction is too small, i.e. * {@code lineDirection.lengthSquared() < }{@value EuclidGeometryTools#ONE_TRILLIONTH}, this * method fails and returns {@code false}. * </ul> * </p> * * @param pointToProject the point to compute the projection of. Not modified. * @param projectionToPack point in which the projection of the point onto the line is stored. * Modified. * @return whether the method succeeded or not. * @throws ReferenceFrameMismatchException if {@code this} and {@code pointToProject} are not * expressed in the same reference frame. */ default boolean orthogonalProjection(FramePoint2DReadOnly pointToProject, FramePoint2DBasics projectionToPack) { checkReferenceFrameMatch(pointToProject); projectionToPack.setReferenceFrame(getReferenceFrame()); return Line2DReadOnly.super.orthogonalProjection(pointToProject, projectionToPack); }