/** * Sets all the components of this tuple to {@link Double#NaN} and sets the current reference frame * to {@code referenceFrame}. * * @param referenceFrame the new reference frame to be associated with this tuple. */ default void setToNaN(ReferenceFrame referenceFrame) { setReferenceFrame(referenceFrame); setToNaN(); }
/** * Sets this tuple's components {@code x}, {@code y}, {@code z} in order from the given array * {@code tupleArray} and sets this tuple frame to {@code referenceFrame}. * * @param referenceFrame the new reference frame for this tuple. * @param tupleArray the array containing the new values for this tuple's components. Not modified. */ default void setIncludingFrame(ReferenceFrame referenceFrame, double[] tupleArray) { setReferenceFrame(referenceFrame); set(tupleArray); }
/** * Sets this frame tuple to {@code tuple3DReadOnly} and sets its current frame to * {@code referenceFrame}. * * @param referenceFrame the new reference frame for this frame tuple. * @param tuple3DReadOnly the tuple to copy the values from. Not modified. */ default void setIncludingFrame(ReferenceFrame referenceFrame, Tuple3DReadOnly tuple3DReadOnly) { setReferenceFrame(referenceFrame); set(tuple3DReadOnly); }
/** * Sets all the components of this frame tuple to zero and sets the current reference frame to * {@code referenceFrame}. * * @param referenceFrame the new reference frame to be associated with this tuple. */ default void setToZero(ReferenceFrame referenceFrame) { setReferenceFrame(referenceFrame); setToZero(); }
/** * Sets this frame tuple x and y components to {@code tuple2DReadOnly}'s x and y components, the * z-component to the given {@code z}, and sets the current frame to {@code referenceFrame}. * * @param referenceFrame the new reference frame for this frame tuple. * @param tuple2DReadOnly the tuple to copy the values from. Not modified. * @param z the new z-coordinate for this frame tuple. */ default void setIncludingFrame(ReferenceFrame referenceFrame, Tuple2DReadOnly tuple2DReadOnly, double z) { setReferenceFrame(referenceFrame); set(tuple2DReadOnly, z); }
/** * Sets this tuple's components {@code x}, {@code y}, {@code z} in order from the given array * {@code tupleArray} and sets this tuple frame to {@code referenceFrame}. * * @param referenceFrame the new reference frame for this tuple. * @param startIndex the first index to start reading from in the array. * @param tupleArray the array containing the new values for this tuple's components. Not modified. */ default void setIncludingFrame(ReferenceFrame referenceFrame, int startIndex, double[] tupleArray) { setReferenceFrame(referenceFrame); set(startIndex, tupleArray); }
/** * Sets this tuple's components {@code x}, {@code y}, {@code z} in order from the given column * vector starting to read from its first row index and sets this tuple frame to * {@code referenceFrame}. * * @param referenceFrame the new reference frame for this tuple. * @param matrix the column vector containing the new values for this tuple's components. Not * modified. */ default void setIncludingFrame(ReferenceFrame referenceFrame, DenseMatrix64F matrix) { setReferenceFrame(referenceFrame); set(matrix); }
/** * Sets this frame tuple's components to {@code x}, {@code y}, and {@code z} and sets its reference * frame to {@code referenceFrame}. * * @param referenceFrame the new reference frame for this frame tuple. * @param x the new value for the x-component of this tuple. * @param y the new value for the y-component of this tuple. * @param z the new value for the z-component of this tuple. */ default void setIncludingFrame(ReferenceFrame referenceFrame, double x, double y, double z) { setReferenceFrame(referenceFrame); set(x, y, z); }
/** * Sets this tuple's components {@code x}, {@code y}, {@code z} in order from the given column * vector starting to read from {@code startRow} and sets this tuple frame to * {@code referenceFrame}. * * @param referenceFrame the new reference frame for this tuple. * @param startRow the first row index to start reading in the dense-matrix. * @param matrix the column vector containing the new values for this tuple's components. Not * modified. */ default void setIncludingFrame(ReferenceFrame referenceFrame, int startRow, DenseMatrix64F matrix) { setReferenceFrame(referenceFrame); set(startRow, matrix); }
/** * Sets this tuple's components {@code x}, {@code y}, {@code z} in order from the given matrix * starting to read from {@code startRow} at the column index {@code column} and sets this tuple * frame to {@code referenceFrame}. * * @param referenceFrame the new reference frame for this tuple. * @param startRow the first row index to start reading in the dense-matrix. * @param column the column index to read in the dense-matrix. * @param matrix the column vector containing the new values for this tuple's components. Not * modified. */ default void setIncludingFrame(ReferenceFrame referenceFrame, int startRow, int column, DenseMatrix64F matrix) { setReferenceFrame(referenceFrame); set(startRow, column, matrix); }
/** * Sets this frame tuple to {@code other}. * * @param other the other frame tuple to copy the values and reference frame from. Not modified. */ default void setIncludingFrame(FrameTuple3DReadOnly other) { setReferenceFrame(other.getReferenceFrame()); set((Tuple3DReadOnly) other); }
/** * Packs a column of this matrix into a 3D frame tuple. * * @param column the index of the column to pack. * @param columnToPack the tuple in which the column of this matrix is stored. Modified. * @throws ArrayIndexOutOfBoundsException if {@code column} ∉ [0, 2]. */ default void getColumn(int column, FrameTuple3DBasics columnToPack) { columnToPack.setReferenceFrame(getReferenceFrame()); Matrix3DReadOnly.super.getColumn(column, columnToPack); }
/** * Packs a row of this matrix into a 3D frame tuple. * * @param row the index of the row to pack. * @param rowToPack the array in which the row of this matrix is stored. Modified. * @throws ArrayIndexOutOfBoundsException if {@code row} ∉ [0, 2]. */ default void getRow(int row, FrameTuple3DBasics rowToPack) { rowToPack.setReferenceFrame(getReferenceFrame()); Matrix3DReadOnly.super.getRow(row, rowToPack); }
/** * Sets this frame tuple x and y components to {@code tuple2DReadOnly}'s x and y components, the * z-component to the given {@code z}, and sets the current frame to * {@code frameTuple2DReadOnly.getReferenceFrame()}. * * @param frameTuple2DReadOnly the tuple to copy the values and reference frame from. Not modified. * @param z the new z-coordinate for this frame tuple. */ default void setIncludingFrame(FrameTuple2DReadOnly frameTuple2DReadOnly, double z) { setReferenceFrame(frameTuple2DReadOnly.getReferenceFrame()); set((Tuple2DReadOnly) frameTuple2DReadOnly, z); }
/** * Computes and packs the orientation described by this orientation as the Euler angles. * <p> * WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is * sometimes undefined. * </p> * * @param eulerAnglesToPack the tuple in which the Euler angles are stored. Modified. */ default void getEuler(FrameTuple3DBasics eulerAnglesToPack) { eulerAnglesToPack.setReferenceFrame(getReferenceFrame()); getEuler((Tuple3DBasics) eulerAnglesToPack); }
/** * Transforms the tuple {@code tupleOriginal} by this orientation and <b>adds</b> the result to * {@code tupleTransformed}. * <p> * If the given tuple is expressed in the local frame described by this orientation, then the tuple * is transformed such that it is, after this method is called, expressed in the base frame in which * this orientation is expressed. * </p> * * @param tupleOriginal the original value of the tuple to be transformed. Not modified. * @param tupleTransformed the result of the original tuple after transformation. Modified. */ default void addTransform(Tuple3DReadOnly tupleOriginal, FrameTuple3DBasics tupleTransformed) { tupleTransformed.setReferenceFrame(getReferenceFrame()); addTransform((Tuple3DReadOnly) tupleOriginal, (Tuple3DBasics) tupleTransformed); }
/** * Performs the inverse of the transform to the given tuple {@code tupleOriginal} by this * orientation and stores the result in {@code tupleTransformed}. * <p> * If the given tuple is expressed in the base frame in which this orientation is expressed, then * the tuple is transformed such that it is, after this method is called, expressed in the local * frame described by this orientation. * </p> * * @param tupleOriginal the tuple to transform. Not modified. * @param tupleTransformed the tuple to store the result. Modified. */ default void inverseTransform(Tuple3DReadOnly tupleOriginal, FrameTuple3DBasics tupleTransformed) { tupleTransformed.setReferenceFrame(getReferenceFrame()); inverseTransform((Tuple3DReadOnly) tupleOriginal, (Tuple3DBasics) tupleTransformed); }
/** * Transforms the given tuple {@code tupleOriginal} by this orientation and stores the result in * {@code tupleTransformed}. * <p> * If the given tuple is expressed in the local frame described by this orientation, then the tuple * is transformed such that it is, after this method is called, expressed in the base frame in which * this orientation is expressed. * </p> * * @param tupleOriginal the tuple to transform. Not modified. * @param tupleTransformed the tuple to store the result. Modified. */ default void transform(Tuple3DReadOnly tupleOriginal, FrameTuple3DBasics tupleTransformed) { tupleTransformed.setReferenceFrame(getReferenceFrame()); transform((Tuple3DReadOnly) tupleOriginal, (Tuple3DBasics) tupleTransformed); }
/** * Transforms the given tuple {@code tupleOriginal} by this orientation and stores the result in * {@code tupleTransformed}. * <p> * If the given tuple is expressed in the local frame described by this orientation, then the tuple * is transformed such that it is, after this method is called, expressed in the base frame in which * this orientation is expressed. * </p> * * @param tupleOriginal the tuple to transform. Not modified. * @param tupleTransformed the tuple to store the result. Modified. * @throws ReferenceFrameMismatchException if reference frame of {@code this} and * {@code tupleOriginal} do not match. */ default void transform(FrameTuple3DReadOnly tupleOriginal, FrameTuple3DBasics tupleTransformed) { checkReferenceFrameMatch(tupleOriginal); tupleTransformed.setReferenceFrame(getReferenceFrame()); transform((Tuple3DReadOnly) tupleOriginal, (Tuple3DBasics) tupleTransformed); }
/** * Performs the inverse of the transform to the given tuple {@code tupleOriginal} and stores the * result in {@code tupleTransformed}. * <p> * If the given tuple is expressed in the base frame in which this orientation is expressed, then * the tuple is transformed such that it is, after this method is called, expressed in the local * frame described by this orientation. * </p> * * @param tupleOriginal the tuple to transform. Not modified. * @param tupleTransformed the tuple to store the result. Modified. * @throws ReferenceFrameMismatchException if reference frame of {@code this} and * {@code tupleOriginal} do not match. */ default void inverseTransform(FrameTuple3DReadOnly tupleOriginal, FrameTuple3DBasics tupleTransformed) { checkReferenceFrameMatch(tupleOriginal); tupleTransformed.setReferenceFrame(getReferenceFrame()); inverseTransform((Tuple3DReadOnly) tupleOriginal, (Tuple3DBasics) tupleTransformed); }