2 instantiations of Quaternion
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
105P15 = new Quaternion(1, 2, 3, 4),
Microsoft.Maui.Essentials (1)
OrientationSensor\OrientationSensor.shared.cs (1)
139 Orientation = new Quaternion(x, y, z, w);
128 references to Quaternion
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesSpecialTypesExtensions.cs (1)
32public Quaternion P15 { get; set; }
Microsoft.Maui.Essentials (2)
OrientationSensor\OrientationSensor.shared.cs (2)
142 /// Gets the current orientation that represents a <see cref="Quaternion"/>. 144 public Quaternion Orientation { get; }
netstandard (1)
netstandard.cs (1)
1336[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Quaternion))]
System.Numerics (1)
System.Numerics.cs (1)
9[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Quaternion))]
System.Numerics.Vectors (1)
artifacts\obj\System.Numerics.Vectors\Debug\net10.0\System.Numerics.Vectors.Forwards.cs (1)
6[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Quaternion))]
System.Private.CoreLib (122)
src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix4x4.cs (3)
622public static Matrix4x4 CreateFromQuaternion(Quaternion quaternion) 967public static bool Decompose(Matrix4x4 matrix, out Vector3 scale, out Quaternion rotation, out Vector3 translation) 1022public static Matrix4x4 Transform(Matrix4x4 value, Quaternion rotation)
src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix4x4.Impl.cs (9)
300Quaternion q = Quaternion.CreateFromAxisAngle(axis, angle); 305public static Impl CreateFromQuaternion(in Quaternion quaternion) 346Quaternion q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll); 950public static unsafe bool Decompose(in Impl matrix, out Vector3 scale, out Quaternion rotation, out Vector3 translation) 1122rotation = Quaternion.Identity; 1128rotation = Quaternion.CreateFromRotationMatrix(matTemp.AsM4x4()); 1491public static Impl Transform(in Impl value, in Quaternion rotation)
src\libraries\System.Private.CoreLib\src\System\Numerics\Plane.cs (1)
158public static Plane Transform(Plane plane, Quaternion rotation) => Vector4.Transform(plane.AsVector4(), rotation).AsPlane();
src\libraries\System.Private.CoreLib\src\System\Numerics\Quaternion.cs (84)
11/// <remarks>The <see cref="Quaternion" /> structure is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where: 14public struct Quaternion : IEquatable<Quaternion> 30/// <summary>Initializes a <see cref="Quaternion" /> from the specified components.</summary> 41/// <summary>Initializes a <see cref="Quaternion" /> from the specified vector and rotation parts.</summary> 52public static Quaternion Zero 60public static Quaternion Identity 92/// <remarks>The <see cref="op_Addition" /> method defines the operation of the addition operator for <see cref="Quaternion" /> objects.</remarks> 95public static Quaternion operator +(Quaternion value1, Quaternion value2) => (value1.AsVector128() + value2.AsVector128()).AsQuaternion(); 101/// <remarks>The <see cref="op_Division" /> method defines the division operation for <see cref="Quaternion" /> objects.</remarks> 102public static Quaternion operator /(Quaternion value1, Quaternion value2) => value1 * Inverse(value2); 109/// The <see cref="op_Equality" /> method defines the operation of the equality operator for <see cref="Quaternion" /> objects.</remarks> 112public static bool operator ==(Quaternion value1, Quaternion value2) => value1.AsVector128() == value2.AsVector128(); 119public static bool operator !=(Quaternion value1, Quaternion value2) => !(value1 == value2); 125/// <remarks>The <see cref="Quaternion.op_Multiply" /> method defines the operation of the multiplication operator for <see cref="Quaternion" /> objects.</remarks> 127public static Quaternion operator *(Quaternion value1, Quaternion value2) 146/// <remarks>The <see cref="Quaternion.op_Multiply" /> method defines the operation of the multiplication operator for <see cref="Quaternion" /> objects.</remarks> 149public static Quaternion operator *(Quaternion value1, float value2) => (value1.AsVector128() * value2).AsQuaternion(); 155/// <remarks>The <see cref="op_Subtraction" /> method defines the operation of the subtraction operator for <see cref="Quaternion" /> objects.</remarks> 158public static Quaternion operator -(Quaternion value1, Quaternion value2) => (value1.AsVector128() - value2.AsVector128()).AsQuaternion(); 163/// <remarks>The <see cref="op_UnaryNegation" /> method defines the operation of the unary negation operator for <see cref="Quaternion" /> objects.</remarks> 166public static Quaternion operator -(Quaternion value) => (-value.AsVector128()).AsQuaternion(); 173public static Quaternion Add(Quaternion value1, Quaternion value2) => value1 + value2; 179public static Quaternion Concatenate(Quaternion value1, Quaternion value2) => value2 * value1; 186public static Quaternion Conjugate(Quaternion value) 194/// <summary>Creates a <see cref="Quaternion" /> from the specified components.</summary> 199/// <returns>A <see cref="Quaternion" /> created from the specified components.</returns>> 201public static Quaternion Create(float x, float y, float z, float w) => Vector128.Create(x, y, z, w).AsQuaternion(); 203/// <summary>Creates a <see cref="Quaternion" /> from the specified vector and rotation parts.</summary> 206/// <returns>A <see cref="Quaternion" /> created from the specified vector and rotation parts.</returns> 208public static Quaternion Create(Vector3 vectorPart, float scalarPart) => Vector4.Create(vectorPart, scalarPart).AsQuaternion(); 214/// <remarks><paramref name="axis" /> vector must be normalized before calling this method or the resulting <see cref="Quaternion" /> will be incorrect.</remarks> 216public static Quaternion CreateFromAxisAngle(Vector3 axis, float angle) 228public static Quaternion CreateFromRotationMatrix(Matrix4x4 matrix) 232Quaternion q = default; 282public static Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float roll) 290Quaternion result; 304public static Quaternion Divide(Quaternion value1, Quaternion value2) => value1 / value2; 312public static float Dot(Quaternion quaternion1, Quaternion quaternion2) => Vector128.Dot(quaternion1.AsVector128(), quaternion2.AsVector128()); 319public static Quaternion Inverse(Quaternion value) 342public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, float amount) 360public static Quaternion Multiply(Quaternion value1, Quaternion value2) => value1 * value2; 367public static Quaternion Multiply(Quaternion value1, float value2) => value1 * value2; 373public static Quaternion Negate(Quaternion value) => -value; 375/// <summary>Divides each component of a specified <see cref="Quaternion" /> by its length.</summary> 380public static Quaternion Normalize(Quaternion value) => (value.AsVector128() / value.Length()).AsQuaternion(); 387public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, float amount) 425public static Quaternion Subtract(Quaternion value1, Quaternion value2) => value1 - value2; 430/// <remarks>The current instance and <paramref name="obj" /> are equal if <paramref name="obj" /> is a <see cref="Quaternion" /> object and the corresponding components of each matrix are equal.</remarks> 431public override readonly bool Equals([NotNullWhen(true)] object? obj) => (obj is Quaternion other) && Equals(other); 438public readonly bool Equals(Quaternion other) => this.AsVector128().Equals(other.AsVector128());
src\libraries\System.Private.CoreLib\src\System\Numerics\Quaternion.Extensions.cs (4)
10/// <summary>Reinterprets a <see cref="Quaternion" /> as a new <see cref="Vector4" />.</summary> 12/// <returns><paramref name="value" /> reinterpreted as a new <see cref="Quaternion" />.</returns> 14public static Vector4 AsVector4(this Quaternion value) => Unsafe.BitCast<Quaternion, Vector4>(value);
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (1)
924public static Vector2 Transform(Vector2 value, Quaternion rotation) => Vector4.Transform(value, rotation).AsVector2();
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (1)
946public static Vector3 Transform(Vector3 value, Quaternion rotation) => Vector4.Transform(value, rotation).AsVector3();
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (8)
985public static Vector4 Transform(Vector2 value, Quaternion rotation) => Transform(Create(value, 0.0f, 1.0f), rotation); 1008public static Vector4 Transform(Vector3 value, Quaternion rotation) => Transform(Create(value, 1.0f), rotation); 1032public static Vector4 Transform(Vector4 value, Quaternion rotation) 1037Quaternion conjuagate = Quaternion.Conjugate(rotation); 1038Quaternion temp = Quaternion.Concatenate(conjuagate, value.AsQuaternion()); 1039return Quaternion.Concatenate(temp, rotation).AsVector4();
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.Extensions.cs (4)
17/// <summary>Reinterprets a <see cref="Vector4" /> as a new <see cref="Quaternion" />.</summary> 19/// <returns><paramref name="value" /> reinterpreted as a new <see cref="Quaternion" />.</returns> 20public static Quaternion AsQuaternion(this Vector4 value) => Unsafe.BitCast<Vector4, Quaternion>(value);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.Numerics.cs (7)
58/// <summary>Reinterprets a <see langword="Vector128&lt;Single&gt;" /> as a new <see cref="Quaternion" />.</summary> 60/// <returns><paramref name="value" /> reinterpreted as a new <see cref="Quaternion" />.</returns> 62public static Quaternion AsQuaternion(this Vector128<float> value) => Unsafe.BitCast<Vector128<float>, Quaternion>(value); 70/// <summary>Reinterprets a <see cref="Quaternion" /> as a new <see langword="Vector128&lt;Single&gt;" />.</summary> 74public static Vector128<float> AsVector128(this Quaternion value) => Unsafe.BitCast<Quaternion, Vector128<float>>(value);