/** * Computes the vector going from the first to the second endpoint of this line segment. * * @param normalize whether the direction vector is to be normalized. * @param directionToPack vector in which the direction is stored. Modified. */ default void getDirection(boolean normalize, FrameVector3DBasics directionToPack) { directionToPack.setReferenceFrame(getReferenceFrame()); LineSegment3DReadOnly.super.getDirection(normalize, directionToPack); }
/** * 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. */ default void get(Point3DBasics pointToPack, FrameVector3DBasics directionToPack) { directionToPack.setReferenceFrame(getReferenceFrame()); Line3DReadOnly.super.get(pointToPack, directionToPack); }
/** * Converts and packs this orientation in a 3D rotation vector. * <p> * WARNING: a rotation vector is different from a yaw-pitch-roll or Euler angles representation. A * rotation vector is equivalent to the axis of an axis-angle that is multiplied by the angle of the * same axis-angle. * </p> * * @param rotationVectorToPack the rotation vector in which this orientation is to be stored. * Modified. */ default void getRotationVector(FrameVector3DBasics rotationVectorToPack) { rotationVectorToPack.setReferenceFrame(getReferenceFrame()); getRotationVector((Vector3DBasics) rotationVectorToPack); }
/** * 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. */ default void get(FramePoint3DBasics pointToPack, FrameVector3DBasics directionToPack) { pointToPack.setReferenceFrame(getReferenceFrame()); directionToPack.setReferenceFrame(getReferenceFrame()); Line3DReadOnly.super.get(pointToPack, directionToPack); }
/** * Computes the normal of a plane that is defined by three points. * <p> * Edge cases: * <ul> * <li>Fails and returns {@code false} if the three points are on a line. * <li>Fails and returns {@code false} if two or three points are equal. * </ul> * </p> * * @param firstPointOnPlane first point on the plane. Not modified. * @param secondPointOnPlane second point on the plane. Not modified. * @param thirdPointOnPlane third point on the plane. Not modified. * @param normalToPack the vector in which the result is stored. Modified. * @return whether the plane normal is properly determined. * @throws ReferenceFrameMismatchException if the read-only arguments are not all expressed in the * same reference frame. */ public static boolean normal3DFromThreePoint3Ds(FramePoint3DReadOnly firstPointOnPlane, FramePoint3DReadOnly secondPointOnPlane, FramePoint3DReadOnly thirdPointOnPlane, FrameVector3DBasics normalToPack) { firstPointOnPlane.checkReferenceFrameMatch(secondPointOnPlane); firstPointOnPlane.checkReferenceFrameMatch(thirdPointOnPlane); normalToPack.setReferenceFrame(firstPointOnPlane.getReferenceFrame()); return EuclidGeometryTools.normal3DFromThreePoint3Ds(firstPointOnPlane, secondPointOnPlane, thirdPointOnPlane, normalToPack); }
point.checkReferenceFrameMatch(secondPointOnLine); orthogonalProjectionToPack.setReferenceFrame(point.getReferenceFrame()); perpendicularVectorToPack.setReferenceFrame(point.getReferenceFrame()); return EuclidGeometryTools.perpendicularVector3DFromLine3DToPoint3D(point, firstPointOnLine, secondPointOnLine, orthogonalProjectionToPack, perpendicularVectorToPack);
pointOnIntersectionToPack.setReferenceFrame(planeNormal1.getReferenceFrame()); if (intersectionDirectionToPack != null) intersectionDirectionToPack.setReferenceFrame(planeNormal1.getReferenceFrame());
pointOnIntersectionToPack.setReferenceFrame(planeNormal1.getReferenceFrame()); if (intersectionDirectionToPack != null) intersectionDirectionToPack.setReferenceFrame(planeNormal1.getReferenceFrame());