public AngleAxis Divide(float scale) { AngleAxis aa = this; aa.Divide(scale); return(aa); }
public AngleAxis Multiply(float scale) { AngleAxis aa = this; aa.Multiply(scale); return(aa); }
// Combine two rotations (this is VERY costly). // @param aa the inner rotation // @returns the resulting rotation (like this*q for matrices) public AngleAxis Multiply(AngleAxis aa) { // This is best done as quaternions Quaternion q1 = new Quaternion(this); Quaternion q2 = new Quaternion(aa); return(new AngleAxis(q1.Multiply(q2))); }
/// <summary> /// The angle is recovered as angleaxis = angle and /// the axis as axis = angleaxis / angle. /// </summary> /// <param name="angleaxis">the 3D vector whose size gives the angle and direction </param> void Set(AngleAxis angleaxis) { float x = angleaxis.GetX(); float y = angleaxis.GetY(); float z = angleaxis.GetZ(); float angle = (float)Math.Sqrt(x * x + y * y + z * z); if (angle > 0.0) { float s = (float)Math.Sin(angle / 2.0) / angle; float c = (float)Math.Cos(angle / 2.0f); _x = s * x; _y = s * y; _z = s * z; _r = c; } else { _x = _y = _z = 0.0f; _r = 1.0f; } }
public Quaternion(AngleAxis angleaxis) { Set(angleaxis); }
/// <summary> /// The angle is recovered as angleaxis = angle and /// the axis as axis = angleaxis / angle. /// </summary> /// <param name="angleaxis">the 3D vector whose size gives the angle and direction </param> void Set(AngleAxis angleaxis) { float x = angleaxis.GetX(); float y = angleaxis.GetY(); float z = angleaxis.GetZ(); float angle = (float)Math.Sqrt(x*x + y*y + z*z); if (angle > 0.0) { float s = (float)Math.Sin(angle/2.0)/angle; float c = (float)Math.Cos(angle/2.0f); _x = s * x; _y = s * y; _z = s * z; _r = c; } else { _x = _y = _z = 0.0f; _r = 1.0f; } }
public Quaternion(AngleAxis angleaxis) { Set(angleaxis); }
public bool NotEqualTo(AngleAxis aa) { return((aa._x != _x) || (aa._y != _y) || (aa._z != _z)); }
public bool Equals(AngleAxis aa) { return((aa._x == _x) && (aa._y == _y) && (aa._z == _z)); }
// Combine two rotations (this is VERY costly). // @param aa the inner rotation // @returns the resulting rotation (like this*q for matrices) public AngleAxis Multiply (AngleAxis aa) { // This is best done as quaternions Quaternion q1 = new Quaternion(this); Quaternion q2 = new Quaternion(aa); return new AngleAxis(q1.Multiply(q2)); }
public bool NotEqualTo (AngleAxis aa) { return ((aa._x != _x) || (aa._y != _y) || (aa._z != _z)); }
public bool Equals (AngleAxis aa) { return ((aa._x == _x) && (aa._y == _y) && (aa._z == _z)); }