public final void setX(double x) { tuple.setX(x); }
/** * Return translational part as Tuple3d * * @param translationToPack */ public final void getTranslation(Tuple3d translationToPack) { translationToPack.setX(mat03); translationToPack.setY(mat13); translationToPack.setZ(mat23); }
public final void set(double x, double y, double z) { tuple.setX(x); tuple.setY(y); tuple.setZ(z); }
public static void set(Tuple3d tuple, Direction direction, double value) { switch (direction) { case X : tuple.setX(value); break; case Y : tuple.setY(value); break; case Z : tuple.setZ(value); break; default : throw new IndexOutOfBoundsException(); } }
public void getTranslation(Tuple3d translationToPack) { translationToPack.setX(jointTranslation.getX()); translationToPack.setZ(jointTranslation.getZ()); }
/** * Set the x and y components of this frameTuple to tuple2d.x and tuple2d.y respectively, and sets the z component to zero. * @param tuple2d */ public void setXY(Tuple2d tuple2d) { this.tuple.setX(tuple2d.getX()); this.tuple.setY(tuple2d.getY()); this.tuple.setZ(0.0); }
public static void extractTuple3dFromEJMLVector(Tuple3d tuple3d, DenseMatrix64F ejmlVector, int[] indices) { tuple3d.setX(ejmlVector.get(indices[0], 0)); tuple3d.setY(ejmlVector.get(indices[1], 0)); tuple3d.setZ(ejmlVector.get(indices[2], 0)); }
public static void extractTuple3dFromEJMLVector(Tuple3d tuple3d, DenseMatrix64F ejmlVector, int startIndex) { tuple3d.setX(ejmlVector.get(startIndex + 0, 0)); tuple3d.setY(ejmlVector.get(startIndex + 1, 0)); tuple3d.setZ(ejmlVector.get(startIndex + 2, 0)); }
/** * Sets the value of this tuple to the sum of itself and tuple1. * @param tuple1 the other Tuple3d */ public final void add(double x, double y, double z) { tuple.setX(tuple.getX() + x); tuple.setY(tuple.getY() + y); tuple.setZ(tuple.getZ() + z); }
public final void scale(double scaleXFactor, double scaleYFactor, double scaleZFactor) { tuple.setX(tuple.getX() * scaleXFactor); tuple.setY(tuple.getY() * scaleYFactor); tuple.setZ(tuple.getZ() * scaleZFactor); }
public static void denseMatrixToVector3d(DenseMatrix64F denseMatrix, Tuple3d vectorToPack, int startRow, int startColumn) { vectorToPack.setX(denseMatrix.get(startRow + 0, startColumn)); vectorToPack.setY(denseMatrix.get(startRow + 1, startColumn)); vectorToPack.setZ(denseMatrix.get(startRow + 2, startColumn)); }
/** * Sets the value of this tuple to the difference of itself and tuple1 (this -= tuple1). * @param tuple1 the other Tuple3d */ public final void sub(double x, double y, double z) { tuple.setX(tuple.getX() - x); tuple.setY(tuple.getY() - y); tuple.setZ(tuple.getZ() - z); }
double crossCrossZ = qx * crossY - qy * crossX; tupleTransformed.setX(x + qs * crossX + crossCrossX); tupleTransformed.setY(y + qs * crossY + crossCrossY); tupleTransformed.setZ(z + qs * crossZ + crossCrossZ);
public static void roundToGivenPrecision(Tuple3d tuple3d, double precision) { tuple3d.setX(roundToPrecision(tuple3d.getX(), precision)); tuple3d.setY(roundToPrecision(tuple3d.getY(), precision)); tuple3d.setZ(roundToPrecision(tuple3d.getZ(), precision)); }
public static void floorToGivenPrecision(Tuple3d tuple3d, double precision) { tuple3d.setX(floorToGivenPrecision(tuple3d.getX(), precision)); tuple3d.setY(floorToGivenPrecision(tuple3d.getY(), precision)); tuple3d.setZ(floorToGivenPrecision(tuple3d.getZ(), precision)); }
public static void roundToGivenPrecisionForAngles(Tuple3d tuple3d, double precision) { tuple3d.setX(roundToGivenPrecisionForAngle(tuple3d.getX(), precision)); tuple3d.setY(roundToGivenPrecisionForAngle(tuple3d.getY(), precision)); tuple3d.setZ(roundToGivenPrecisionForAngle(tuple3d.getZ(), precision)); }
/** * Sets the value of this tuple to the scalar multiplication of tuple1 and then adds the scalar multiplication of tuple2 (this = scaleFactor1 * tuple1 + scaleFactor2 * tuple2). * * @param scaleFactor1 double * @param frameTuple1 Tuple3d * @param scaleFactor2 double * @param frameTuple2 Tuple3d */ public final void scaleAdd(double scaleFactor1, Tuple3d tuple1, double scaleFactor2, Tuple3d tuple2) { tuple.setX(scaleFactor1 * tuple1.getX() + scaleFactor2 * tuple2.getX()); tuple.setY(scaleFactor1 * tuple1.getY() + scaleFactor2 * tuple2.getY()); tuple.setZ(scaleFactor1 * tuple1.getZ() + scaleFactor2 * tuple2.getZ()); }
/** * Clip each component of the given tuple to the axis-aligned bounding box. * Each of the bounding box minimum coordinates is defined as follows: {@code minX = x1 < x2 ? x1 : x2}. * Each of the bounding box maximum coordinates is defined as follows: {@code maxX = x1 > x2 ? x1 : x2}. * * @param tupleToClip the 3D tuple to clip to the bounding box. Modified. * @param x1 minimum/maximum x coordinate of the bounding box. * @param x2 minimum/maximum x coordinate of the bounding box. * @param y1 minimum/maximum y coordinate of the bounding box. * @param y2 minimum/maximum y coordinate of the bounding box. * @param z1 minimum/maximum z coordinate of the bounding box. * @param z2 minimum/maximum z coordinate of the bounding box. */ // FIXME this is rather unsafe, the user should know the difference between the minimum and maximum coordinates of the bounding box. public static void clipToBoundingBox(Tuple3d tupleToClip, double x1, double x2, double y1, double y2, double z1, double z2) { tupleToClip.setX(x1 < x2 ? MathTools.clipToMinMax(tupleToClip.getX(), x1, x2) : MathTools.clipToMinMax(tupleToClip.getX(), x2, x1)); tupleToClip.setY(y1 < y2 ? MathTools.clipToMinMax(tupleToClip.getY(), y1, y2) : MathTools.clipToMinMax(tupleToClip.getY(), y2, y1)); tupleToClip.setZ(z1 < z2 ? MathTools.clipToMinMax(tupleToClip.getZ(), z1, z2) : MathTools.clipToMinMax(tupleToClip.getZ(), z2, z1)); }