struct Quaternion

in global :: System . Numerics

Represents a vector that is used to encode three-dimensional physical rotations.


public Quaternion( Vector3 vectorPart, float scalarPart )

Creates a quaternion from the specified vector and rotation parts.

  • vectorPart The vector part of the quaternion.
  • scalarPart The rotation part of the quaternion.

public Quaternion( float x, float y, float z, float w )

Constructs a quaternion from the specified components.

  • x The value to assign to the X component of the quaternion.
  • y The value to assign to the Y component of the quaternion.
  • z The value to assign to the Z component of the quaternion.
  • w The value to assign to the W component of the quaternion.

public static Quaternion Add( Quaternion value1, Quaternion value2 )

Adds each element in one quaternion with its corresponding element in a second quaternion.

  • value1 The first quaternion.
  • value2 The second quaternion.
  • Returns The quaternion that contains the summed values of and .

public static Quaternion Concatenate( Quaternion value1, Quaternion value2 )

Concatenates two quaternions.

  • value1 The first quaternion rotation in the series.
  • value2 The second quaternion rotation in the series.
  • Returns A new quaternion representing the concatenation of the rotation followed by the rotation.

public static Quaternion Conjugate( Quaternion value )

Returns the conjugate of a specified quaternion.

  • value The quaternion.
  • Returns A new quaternion that is the conjugate of .

public static Quaternion CreateFromAxisAngle( Vector3 axis, float angle )

Creates a quaternion from a unit vector and an angle to rotate around the vector.

  • axis The unit vector to rotate around.
  • angle The angle, in radians, to rotate around the vector.
  • Returns The newly created quaternion.

public static Quaternion CreateFromRotationMatrix( Matrix4x4 matrix )

Creates a quaternion from the specified rotation matrix.

  • matrix The rotation matrix.
  • Returns The newly created quaternion.

public static Quaternion CreateFromYawPitchRoll( float yaw, float pitch, float roll )

Creates a new quaternion from the given yaw, pitch, and roll.

  • yaw The yaw angle, in radians, around the Y axis.
  • pitch The pitch angle, in radians, around the X axis.
  • roll The roll angle, in radians, around the Z axis.
  • Returns The resulting quaternion.

public static Quaternion Divide( Quaternion value1, Quaternion value2 )

Divides one quaternion by a second quaternion.

  • value1 The dividend.
  • value2 The divisor.
  • Returns The quaternion that results from dividing by .

public static float Dot( Quaternion quaternion1, Quaternion quaternion2 )

Calculates the dot product of two quaternions.

  • quaternion1 The first quaternion.
  • quaternion2 The second quaternion.
  • Returns The dot product.

public bool Equals( Quaternion other )

Returns a value that indicates whether this instance and another quaternion are equal.

  • other The other quaternion.
  • Returns if the two quaternions are equal; otherwise, .

public bool Equals( object obj )

Returns a value that indicates whether this instance and a specified object are equal.

  • obj The object to compare with the current instance.
  • Returns if the current instance and are equal; otherwise, . If is , the method returns .

public static Quaternion Identity { get; }

Gets a quaternion that represents no rotation.

  • Returns A quaternion whose values are (0, 0, 0, 1).

public static Quaternion Inverse( Quaternion value )

Returns the inverse of a quaternion.

  • value The quaternion.
  • Returns The inverted quaternion.

public bool IsIdentity { get; }

Gets a value that indicates whether the current instance is the identity quaternion.

  • Returns if the current instance is the identity quaternion; otherwise, .

public static Quaternion Lerp( Quaternion quaternion1, Quaternion quaternion2, float amount )

Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion.

  • quaternion1 The first quaternion.
  • quaternion2 The second quaternion.
  • amount The relative weight of in the interpolation.
  • Returns The interpolated quaternion.

public static Quaternion Multiply( Quaternion value1, Quaternion value2 )

Returns the quaternion that results from multiplying two quaternions together.

  • value1 The first quaternion.
  • value2 The second quaternion.
  • Returns The product quaternion.

public static Quaternion Multiply( Quaternion value1, float value2 )

Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor.

  • value1 The source quaternion.
  • value2 The scalar value.
  • Returns The scaled quaternion.

public static Quaternion Negate( Quaternion value )

Reverses the sign of each component of the quaternion.

  • value The quaternion to negate.
  • Returns The negated quaternion.

public static Quaternion Normalize( Quaternion value )

Divides each component of a specified by its length.

  • value The quaternion to normalize.
  • Returns The normalized quaternion.

public static Quaternion op_Addition( Quaternion value1, Quaternion value2 )

Adds each element in one quaternion with its corresponding element in a second quaternion.

  • value1 The first quaternion.
  • value2 The second quaternion.
  • Returns The quaternion that contains the summed values of and .

public static Quaternion op_Division( Quaternion value1, Quaternion value2 )

Divides one quaternion by a second quaternion.

  • value1 The dividend.
  • value2 The divisor.
  • Returns The quaternion that results from dividing by .

public static bool op_Equality( Quaternion value1, Quaternion value2 )

Returns a value that indicates whether two quaternions are equal.

  • value1 The first quaternion to compare.
  • value2 The second quaternion to compare.
  • Returns if the two quaternions are equal; otherwise, .

public static bool op_Inequality( Quaternion value1, Quaternion value2 )

Returns a value that indicates whether two quaternions are not equal.

  • value1 The first quaternion to compare.
  • value2 The second quaternion to compare.
  • Returns if and are not equal; otherwise, .

public static Quaternion op_Multiply( Quaternion value1, Quaternion value2 )

Returns the quaternion that results from multiplying two quaternions together.

  • value1 The first quaternion.
  • value2 The second quaternion.
  • Returns The product quaternion.

public static Quaternion op_Multiply( Quaternion value1, float value2 )

Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor.

  • value1 The source quaternion.
  • value2 The scalar value.
  • Returns The scaled quaternion.

public static Quaternion op_Subtraction( Quaternion value1, Quaternion value2 )

Subtracts each element in a second quaternion from its corresponding element in a first quaternion.

  • value1 The first quaternion.
  • value2 The second quaternion.
  • Returns The quaternion containing the values that result from subtracting each element in from its corresponding element in .

public static Quaternion op_UnaryNegation( Quaternion value )

Reverses the sign of each component of the quaternion.

  • value The quaternion to negate.
  • Returns The negated quaternion.

public static Quaternion Slerp( Quaternion quaternion1, Quaternion quaternion2, float amount )

Interpolates between two quaternions, using spherical linear interpolation.

  • quaternion1 The first quaternion.
  • quaternion2 The second quaternion.
  • amount The relative weight of the second quaternion in the interpolation.
  • Returns The interpolated quaternion.

public static Quaternion Subtract( Quaternion value1, Quaternion value2 )

Subtracts each element in a second quaternion from its corresponding element in a first quaternion.

  • value1 The first quaternion.
  • value2 The second quaternion.
  • Returns The quaternion containing the values that result from subtracting each element in from its corresponding element in .

public float W

The rotation component of the quaternion.

public float X

The X value of the vector component of the quaternion.

public float Y

The Y value of the vector component of the quaternion.

public float Z

The Z value of the vector component of the quaternion.

public float Length( )

😔 No documentation found.

public float LengthSquared( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public float Item { get; set; }

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public static Quaternion Zero { get; }

😔 No documentation found.