/** * Sets this motion vector given an angular part and linear part. * * @param bodyFrame what we are specifying the motion of. * @param baseFrame with respect to what we are specifying the motion. * @param expressedInFrame in which reference frame the motion is expressed. * @param angularPart the vector holding the new values for the angular part. Not modified. * @param linearPart the vector holding the new values for the linear part. Not modified. * @throws ReferenceFrameMismatchException if any of the reference frames from the arguments do * not match the current frames of {@code this}. */ default void set(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, Vector3DReadOnly angularPart, Vector3DReadOnly linearPart) { checkReferenceFrameMatch(bodyFrame, baseFrame, expressedInFrame); set(angularPart, linearPart); }
/** * Sets this motion vector from a given motion measured at a different position. * <p> * Effectively, this motion is updated as follow: * * <pre> * ω<sub>this</sub> = ω<sub>new</sub> * ν<sub>this</sub> = ν<sub>new</sub> + P × ω<sub>new</sub> * </pre> * * where ω and ν represent the angular and linear parts respectively, and {@code P} is * the {@code observerPosition}. * </p> * * @param expressedInFrame the reference frame in which the given motion is expressed. * @param angularPart the angular part of the motion. Not modified. * @param linearPart the linear part of the motion measured at the observer position. Not * modified. * @param observerPosition the location at which the motion is measured. Not modified. * @throws ReferenceFrameMismatchException if {@code expressedInFrame} is not the same as * {@code this.getReferenceFrame()}. */ default void set(ReferenceFrame expressedInFrame, Vector3DReadOnly angularPart, Vector3DReadOnly linearPart, Point3DReadOnly observerPosition) { checkExpressedInFrameMatch(expressedInFrame); set(angularPart, linearPart, observerPosition); }
/** * Sets this motion vector given an angular part and linear part. * * @param bodyFrame what we are specifying the motion of. * @param baseFrame with respect to what we are specifying the motion. * @param angularPart the vector holding the new values for the angular part. Not modified. * @param linearPart the vector holding the new values for the linear part. Not modified. * @throws ReferenceFrameMismatchException if any of the reference frames from the arguments do * not match the current frames of {@code this}. */ default void set(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, FrameVector3DReadOnly angularPart, FrameVector3DReadOnly linearPart) { angularPart.checkReferenceFrameMatch(linearPart); set(bodyFrame, baseFrame, angularPart.getReferenceFrame(), angularPart, linearPart); }
/** * Sets this motion vector to {@code spatialVector}. * * @param bodyFrame what we are specifying the motion of. * @param baseFrame with respect to what we are specifying the motion. * @param spatialVector the spatial vector to copy values from. Not modified. * @throws ReferenceFrameMismatchException if any of the reference frames from the arguments do * not match the current frames of {@code this}. */ default void set(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, SpatialVectorReadOnly spatialVector) { set(bodyFrame, baseFrame, spatialVector.getReferenceFrame(), spatialVector.getAngularPart(), spatialVector.getLinearPart()); }
/** * Sets this motion vector from a given motion measured at a different position. * <p> * Effectively, this motion is updated as follow: * * <pre> * ω<sub>this</sub> = ω<sub>new</sub> * ν<sub>this</sub> = ν<sub>new</sub> + P × ω<sub>new</sub> * </pre> * * where ω and ν represent the angular and linear parts respectively, and {@code P} is * the {@code observerPosition}. * </p> * * @param angularPart the angular part of the motion. Not modified. * @param linearPart the linear part of the motion measured at the observer position. Not * modified. * @param observerPosition the location at which the motion is measured. Not modified. * @throws ReferenceFrameMismatchException if any of the arguments is not expressed in * {@code this.getReferenceFrame()}. */ default void set(FrameVector3DReadOnly angularPart, FrameVector3DReadOnly linearPart, FramePoint3DReadOnly observerPosition) { angularPart.checkReferenceFrameMatch(linearPart); angularPart.checkReferenceFrameMatch(observerPosition); set(angularPart.getReferenceFrame(), angularPart, linearPart, observerPosition); }
/** * Sets this motion vector to {@code other}. * * @param other the other vector to copy. Not modified. * @throws ReferenceFrameMismatchException if any of the reference frames in {@code other} do not * match {@code this}. */ default void set(SpatialMotionReadOnly other) { set(other.getBodyFrame(), other.getBaseFrame(), other.getReferenceFrame(), other.getAngularPart(), other.getLinearPart()); }