/** * Sets the x-component of this vector. * * @param x the x-component. */ @Override public void setX(double x) { vector.setX(x); }
@Override protected void setX(Vector3D data, double x) { data.setX(x); }
/** * Sets the radius along the x-axis for this ellipsoid. * * @param radiusX radius of the ellipsoid along the x-axis. * @throws IllegalArgumentException if the argument is negative. */ public void setRadiusX(double radiusX) { if (radiusX < 0.0) throw new IllegalArgumentException("The x-radius of an Ellipsoid3D cannot be negative: " + radiusX); radii.setX(radiusX); }
private void randomizeVector(Random random, Vector3D vector) { vector.setX(random.nextDouble()); vector.setY(random.nextDouble()); vector.setZ(random.nextDouble()); } }
public void packPosition(Vector3D position) { position.setX(this.position[0]); position.setY(this.position[1]); position.setZ(this.position[2]); }
public void surfaceNormalAt(double x, double y, double z, Vector3D normal) { normal.setX(0.0); normal.setY(0.0); normal.setZ(1.0); }
/** * Pack the standard deviation along each principal axis in the Vector3d. * * @param principalStandardDeviationToPack The standard deviation is stored in the Vector3d as * follows: x is the standard deviation on the principal axis, y on the secondary axis, * and z on the third axis. */ public void getStandardDeviation(Vector3D principalStandardDeviationToPack) { principalStandardDeviationToPack.setX(Math.sqrt(variance.getX())); principalStandardDeviationToPack.setY(Math.sqrt(variance.getY())); principalStandardDeviationToPack.setZ(Math.sqrt(variance.getZ())); }
/** * Pack the variance along each principal axis in the given Vector3d. * * @param principalVarianceToPack The variance is stored in the Vector3d as follows: x is the * variance on the principal axis, y on the secondary axis, and z on the third axis. */ public void getVariance(Vector3D principalVarianceToPack) { principalVarianceToPack.setX(variance.getX()); principalVarianceToPack.setY(variance.getY()); principalVarianceToPack.setZ(variance.getZ()); }
public void getMagnetometer(Vector3D magToPack) { magToPack.setX(magX.getDoubleValue()); magToPack.setY(magY.getDoubleValue()); magToPack.setZ(magZ.getDoubleValue()); }
public void packLinearAcceleration(Vector3D accelerationToPack) { accelerationToPack.setX(this.xdd.getDoubleValue()); accelerationToPack.setY(this.ydd.getDoubleValue()); accelerationToPack.setZ(this.zdd.getDoubleValue()); }
public void getAccel(Vector3D accelToPack) { accelToPack.setX(accelX.getDoubleValue()); accelToPack.setY(accelY.getDoubleValue()); accelToPack.setZ(accelZ.getDoubleValue()); }
public void packAngularVelocity(Vector3D angularVelocityToPack) { angularVelocityToPack.setX(this.theta_x.getDoubleValue()); angularVelocityToPack.setY(this.theta_y.getDoubleValue()); angularVelocityToPack.setZ(this.theta_z.getDoubleValue()); }
public void getGyro(Vector3D gyroToPack) { gyroToPack.setX(gyroX.getDoubleValue()); gyroToPack.setY(gyroY.getDoubleValue()); gyroToPack.setZ(gyroZ.getDoubleValue()); }
public void createInertiaEllipsoid(Matrix3D momentOfInertia, Vector3D comOffset, double mass, AppearanceDefinition appearance) { double Ixx = momentOfInertia.getM00(); double Iyy = momentOfInertia.getM11(); double Izz = momentOfInertia.getM22(); // http://en.wikipedia.org/wiki/Ellipsoid#Mass_properties Vector3D ellipsoidRadii = new Vector3D(); ellipsoidRadii.setX(Math.sqrt(5.0 / 2.0 * (Iyy + Izz - Ixx) / mass)); ellipsoidRadii.setY(Math.sqrt(5.0 / 2.0 * (Izz + Ixx - Iyy) / mass)); ellipsoidRadii.setZ(Math.sqrt(5.0 / 2.0 * (Ixx + Iyy - Izz) / mass)); this.translate(comOffset); this.addEllipsoid(ellipsoidRadii.getX(), ellipsoidRadii.getY(), ellipsoidRadii.getZ(), appearance); this.identity(); }
private void extractTandR(RigidBodyTransform tran, Vector3D T, Vector3D R) { tran.getTranslation(T); tran.getRotation(rotationMatrix); rotationMatrix.get(m); ConvertRotation3D_F64.matrixToEuler(m, EulerType.XYZ, euler); R.setX(euler[0]); R.setY(euler[1]); R.setZ(euler[2]); }
public void setTranslationAndUpdate(FrameVector2D translation) { translation.checkReferenceFrameMatch(getParent()); this.translation.setX(translation.getX()); this.translation.setY(translation.getY()); this.update(); }
public void setFramePose2DAndUpdate(FramePose2D framePose2d) { framePose2d.checkReferenceFrameMatch(getParent()); this.rotation = framePose2d.getYaw(); this.translation.setX(framePose2d.getX()); this.translation.setY(framePose2d.getY()); this.update(); }
private Vector3DReadOnly convertToAngularVelocity(QuaternionReadOnly q, Vector4DReadOnly qDot) {// w = qDot * q^-1 QuaternionTools.multiplyConjugateRight(qDot, q, tempConvertVector4D); tempConvertVector3D.setX(tempConvertVector4D.getX()); tempConvertVector3D.setY(tempConvertVector4D.getY()); tempConvertVector3D.setZ(tempConvertVector4D.getZ()); tempConvertVector3D.scale(2.0); return tempConvertVector3D; }
public static Vector3D nextVector3D(Random random, Tuple3DReadOnly boundary1, Tuple3DReadOnly boundary2) { Vector3D ret = new Vector3D(); ret.setX(RandomNumbers.nextDouble(random, boundary1.getX(), boundary2.getX())); ret.setY(RandomNumbers.nextDouble(random, boundary1.getY(), boundary2.getY())); ret.setZ(RandomNumbers.nextDouble(random, boundary1.getZ(), boundary2.getZ())); return ret; }
private Vector3DReadOnly convertToAngularAcceleration(QuaternionReadOnly q, Vector4DReadOnly qDot, Vector4DReadOnly qDDot) { // w = qDDot * q^-1 + qDot * qDot^-1 QuaternionTools.multiplyConjugateRight(qDDot, q, tempConvertVector4D); tempConvertVector3D.setX(tempConvertVector4D.getX()); tempConvertVector3D.setY(tempConvertVector4D.getY()); tempConvertVector3D.setZ(tempConvertVector4D.getZ()); QuaternionTools.multiplyConjugateRight(qDot, qDot, tempConvertVector4D); tempConvertVector3D.addX(tempConvertVector4D.getX()); tempConvertVector3D.addY(tempConvertVector4D.getY()); tempConvertVector3D.addZ(tempConvertVector4D.getZ()); tempConvertVector3D.scale(2.0); return tempConvertVector3D; }