SystemEX  Lacking
Additional generic collection types missing in .net
SystemEx.Numeric.Quatf Struct Reference

Represents a floating‑point quaternion used for 3D rotations. More...

Inheritance diagram for SystemEx.Numeric.Quatf:
Collaboration diagram for SystemEx.Numeric.Quatf:

Public Member Functions

 Quatf ()
 Initializes the identity quaternion (1,0,0,0).
float Get (int index)
 Gets a component by index .
 Quatf (Vec3f angles)
 Initializes a quaternion from Euler angles (XYZ order).
 Quatf (float fs, float fx, float fy, float fz)
 Initializes a quaternion from explicit components.
 Quatf (float[] pfs)
 Initializes a quaternion from a float array.
 Quatf (AxisAngle< Vec3f, float > axisAngle)
 Initializes a quaternion from an axis‑angle representation.
 Quatf (Quatf other)
 Copy constructor.
Vec3f GetRotationAxis ()
 Computes the normalized rotation axis of this quaternion.
float GetRotationAngle ()
 Returns the rotation angle represented by this quaternion.
CompareResult CompareTo (Quatf a)
 Compares two quaternions using the configured CompareMode.
int IComparable< Quatf >. CompareTo (Quatf other)
int CompareTo (object? obj)
 Compares this quaternion to another object.
bool Equals (Quatf other)
FixedVector< byte > ToBytes ()
 Converts the vector into a deterministic byte sequence.
override int GetHashCode ()
 Computes a hash code for this vector.
override bool Equals (object? obj)
 Determines whether this instance is equal to another object.
Public Member Functions inherited from SystemEx.IComparableEx< T >
CompareResult CompareTo (T a)
 Compares this instance with the specified value and returns a CompareResult describing the relationship between them.

Static Public Member Functions

static AxisAngle< Vec3f, float > ToAxisAngle (Quatf q)
 Converts a quaternion into an axis‑angle representation.
static Quatf FromAxis (AxisAngle< Vec3f, float > axisAngle)
 Creates a quaternion from an axis‑angle representation.
static bool IsIdentity (Quatf v)
 Determines whether a quaternion is the identity rotation.
static Quatf Exponent (Quatf v)
 Computes the quaternion exponential.
static Quatf Logarithm (Quatf v)
 Computes the quaternion logarithm.
static float LenghtSqrt (Quatf v)
 Computes the Euclidean length of the quaternion.
static float Lenght (Quatf v)
 Computes the squared length of the quaternion.
static Quatf Power (Quatf v, float Exp)
 Raises a quaternion to a scalar power.
static float DotProduct (Quatf a, Quatf b)
 Computes the DotProduct product of two quaternions.
static Quatf Invert (Quatf q)
 Computes the inverse of a quaternion.
static Quatf Normalize (Quatf v)
 Normalizes a quaternion to unit length.
static Quatf Conjugate (Quatf v)
 Computes the quaternion conjugate.
static Quatf Slerp (Quatf q0, Quatf q1, float t)
 Performs spherical linear interpolation between two quaternions.
static Quatf operator* (Quatf a, Quatf b)
 Multiplies two Quatf component‑wise.
static Quatf operator* (float a, Quatf b)
 Multiplicate a float with a quaternion.
static Quatf operator* (Quatf a, float b)
 Multiplicate a quaternion with a float.
static Quatf operator+ (Quatf a, Quatf b)
 Adds two Quatf component‑wise.
static Quatf operator- (Quatf a, Quatf b)
 Subtracts two Quatf component‑wise.
static Quatf operator- (Quatf a)
 Invert.
static Quatf operator/ (Quatf a, Quatf b)
 Divides two Quatf component‑wise.
static Quatf operator/ (Quatf a, float b)
 Divides both components of the Quatf by a float.

Properties

float S [get, set]
 Gets or sets the scalar component (w) of the quaternion.
Vec3f V [get, set]
 Gets or sets the vector component (x,y,z) of the quaternion.
float X [get, set]
 Gets or sets the X component of the quaternion's vector part.
float Y [get, set]
 Gets or sets the Y component of the quaternion's vector part.
float Z [get, set]
 Gets or sets the Z component of the quaternion's vector part.
AxisAngle< Vec3f, float > AxisAngle [get]
 Gets the axis‑angle representation of this quaternion.
CompareType CompareMode [get, set]
 Gets or sets the comparison mode used by CompareTo(Quatf).

Detailed Description

Represents a floating‑point quaternion used for 3D rotations.

Quatf stores a scalar component w and a vector component (x,y,z) in a sequential memory layout, making it suitable for native interop, compute kernels, and deterministic hashing.

The struct is annotated with HashAlgorithmAttribute to enable attribute‑driven hashing via HashFactory.
BernsteinHash is used because it is fast, byte‑linear, and ideal for small fixed‑size numeric types.

Quatf implements multiple comparison and hashing interfaces:

  • IComparable and IComparable<T> for ordering
  • IEquatable<T> for equality checks
  • IHashable<T> for deterministic byte‑level hashing

Constructor & Destructor Documentation

◆ Quatf() [1/6]

SystemEx.Numeric.Quatf.Quatf ( )

Initializes the identity quaternion (1,0,0,0).

130 {
131 m_v = new Vec3f(0);
132 m_s = 1.0f;
133 m_comparebleMode = CompareType.Skalar;
134 }
CompareType
Defines the comparison mode used by Quatf.
Definition Quatf.cs:33
Here is the caller graph for this function:

◆ Quatf() [2/6]

SystemEx.Numeric.Quatf.Quatf ( Vec3f angles)

Initializes a quaternion from Euler angles (XYZ order).

152 {
153 float cos_z_2 = System.MathF.Cos(0.5f*angles.Z);
154 float cos_y_2 = System.MathF.Cos(0.5f*angles.Y);
155 float cos_x_2 = System.MathF.Cos(0.5f*angles.X);
156
157 float sin_z_2 = System.MathF.Sin(0.5f*angles.Z);
158 float sin_y_2 = System.MathF.Sin(0.5f*angles.Y);
159 float sin_x_2 = System.MathF.Sin(0.5f*angles.X);
160
161 // and now compute quaternion
162 m_s = cos_z_2 * cos_y_2 * cos_x_2 + sin_z_2 * sin_y_2 * sin_x_2;
163 m_v = new Vec3f
164 (
165 cos_z_2 * cos_y_2 * sin_x_2 - sin_z_2 * sin_y_2 * cos_x_2,
166 cos_z_2 * sin_y_2 * cos_x_2 + sin_z_2 * cos_y_2 * sin_x_2,
167 sin_z_2 * cos_y_2 * cos_x_2 - cos_z_2 * sin_y_2 * sin_x_2
168 );
169 m_comparebleMode = CompareType.Skalar;
170 }
@ System
forward indexing
Definition FlexSpan.cs:32

◆ Quatf() [3/6]

SystemEx.Numeric.Quatf.Quatf ( float fs,
float fx,
float fy,
float fz )

Initializes a quaternion from explicit components.

174 {
175 m_s = fs;
176 m_v = new Vec3f(fx, fy, fz);
177 m_comparebleMode = CompareType.Skalar;
178 }

◆ Quatf() [4/6]

SystemEx.Numeric.Quatf.Quatf ( float[] pfs)

Initializes a quaternion from a float array.

183 {
184 m_s = pfs[0];
185 m_v = new Vec3f(pfs[1], pfs[2], pfs[3]);
186 m_comparebleMode = CompareType.Skalar;
187 }

◆ Quatf() [5/6]

SystemEx.Numeric.Quatf.Quatf ( AxisAngle< Vec3f, float > axisAngle)

Initializes a quaternion from an axis‑angle representation.

192 {
193 var tmp = FromAxis(axisAngle);
194 m_s = tmp.m_s;
195 m_v = tmp.m_v;
196 m_comparebleMode = CompareType.Skalar;
197 }
Here is the call graph for this function:

◆ Quatf() [6/6]

SystemEx.Numeric.Quatf.Quatf ( Quatf other)

Copy constructor.

202 {
203 m_s = other.m_s;
204 m_v = other.m_v;
205 m_comparebleMode = CompareType.Skalar;
206 }
Here is the call graph for this function:

Member Function Documentation

◆ CompareTo() [1/3]

int SystemEx.Numeric.Quatf.CompareTo ( object? obj)

Compares this quaternion to another object.

534 {
535 if ( (obj is Quatf) ) {
536 return (int)CompareTo((Quatf)(obj));
537 }
538 throw new ArgumentException("Object is not a Quatf object");
539 }
Here is the call graph for this function:

◆ CompareTo() [2/3]

CompareResult SystemEx.Numeric.Quatf.CompareTo ( Quatf a)

Compares two quaternions using the configured CompareMode.

502 {
503
504 CompareResult _ret = CompareResult.Equal;
505
506 float _a = 0;
507 float _b = 0;
508
509 switch ( m_comparebleMode) {
510 case CompareType.Skalar:
511 _ret = (CompareResult)m_s.CompareTo(a.m_s);
512 break;
513 case CompareType.Norm:
514 _a = m_s * m_s + Vec3f.Lenght(m_v);
515 _b = a.m_s * a.m_s + Vec3f.Lenght(a.m_v);
516 _ret = (CompareResult)_a.CompareTo(_b);
517 break;
518 case CompareType.Rotation:
519 _a = GetRotationAngle();
520 _b = a.GetRotationAngle();
521 _ret = (CompareResult)_a.CompareTo(_b);
522 break;
523 }
524 return _ret;
525 }
CompareResult
Specifies the result of a comparison between two values.
Definition Algorithm.cs:26
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompareTo() [3/3]

int IComparable< Quatf >. SystemEx.Numeric.Quatf.CompareTo ( Quatf other)
527 {
528 return (int)CompareTo(other);
529 }

◆ Conjugate()

Quatf SystemEx.Numeric.Quatf.Conjugate ( Quatf v)
static

Computes the quaternion conjugate.

424 {
425 Quatf temp = new Quatf( v);
426
427 temp.m_v.X = -temp.m_v.X;
428 temp.m_v.Y = -temp.m_v.Y;
429 temp.m_v.Z = -temp.m_v.Z;
430
431 return temp;
432 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DotProduct()

float SystemEx.Numeric.Quatf.DotProduct ( Quatf a,
Quatf b )
static

Computes the DotProduct product of two quaternions.

378 {
379 return a.m_s * b.m_s +
380 a.m_v.X * b.m_v.X +
381 a.m_v.Y * b.m_v.Y +
382 a.m_v.Z * b.m_v.Z;
383 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Equals() [1/2]

override bool SystemEx.Numeric.Quatf.Equals ( object? obj)

Determines whether this instance is equal to another object.

The object is considered equal if it is a Quatf and compares equal using Equals(Quatf).

Parameters
objThe object to compare with.
Returns
true if obj is a Quatf and equal to this instance; otherwise false.
590 {
591 if ( obj == null ) return false;
592 return (obj is Quatf) && Equals((Quatf)obj);
593 }
Here is the call graph for this function:

◆ Equals() [2/2]

bool SystemEx.Numeric.Quatf.Equals ( Quatf other)
540 {
541 return m_s == other.m_s && m_v == other.m_v;
542 }

◆ Exponent()

Quatf SystemEx.Numeric.Quatf.Exponent ( Quatf v)
static

Computes the quaternion exponential.

284 {
285 float Mul;
286
287 Quatf temp = new Quatf( v);
288 float Length = Vec3f.LenghtSqrt(temp.m_v);
289
290 if ( Length > 1.0e-4f )
291 Mul = System.MathF.Sin(Length) / Length;
292 else
293 Mul = 1.0f;
294
295 temp.m_s = System.MathF.Cos(Length);
296
297 temp.m_v.X *= Mul;
298 temp.m_v.Y *= Mul;
299 temp.m_v.Z *= Mul;
300
301 return temp;
302 }
Here is the call graph for this function:

◆ FromAxis()

Quatf SystemEx.Numeric.Quatf.FromAxis ( AxisAngle< Vec3f, float > axisAngle)
static

Creates a quaternion from an axis‑angle representation.

240 {
241
242 float len = Vec3f.LenghtSqrt(axisAngle.Axis);
243 Quatf temp = new Quatf();
244
245 if ( len > 1e-12f ) {
246 float inv = 1.0f / len;
247
248 // Achse normalisieren
249 float nx = axisAngle.Axis.X * inv;
250 float ny = axisAngle.Axis.Y * inv;
251 float nz = axisAngle.Axis.Z * inv;
252
253 float omega = 0.5f * axisAngle.Angle;
254 float s = MathF.Sin(omega);
255
256 temp.m_v = new Vec3f(s * nx, s * ny, s * nz);
257 temp.m_s = MathF.Cos(omega);
258 } else {
259 // Ungültige Achse → Identity
260 temp.m_s = 1.0f;
261 temp.m_v = Vec3f.Zero;
262 }
263
264 return Normalize(temp);
265
266 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get()

float SystemEx.Numeric.Quatf.Get ( int index)

Gets a component by index .

138 {
139 return index switch
140 {
141 0 => S,
142 1 => X,
143 2 => Y,
144 3 => Z,
145 _ => throw new ArgumentOutOfRangeException(nameof(index))
146 };
147 }
Here is the caller graph for this function:

◆ GetHashCode()

override int SystemEx.Numeric.Quatf.GetHashCode ( )

Computes a hash code for this vector.

The primary hash is generated using HashFactory and the HashAlgorithmAttribute applied to this struct.
If hashing fails (rare), a fallback XOR‑based hash is used.

570 {
571 var x = HashFactory.Hash32(this, 674545);
572 if ( x.Value != 0 ) return (int)x.Value;
573
574 return m_v.GetHashCode() ^ m_s.GetHashCode() ;
575
576 }

◆ GetRotationAngle()

float SystemEx.Numeric.Quatf.GetRotationAngle ( )

Returns the rotation angle represented by this quaternion.

270 {
271 float s = System.Math.Clamp(m_s, -1.0f, 1.0f);
272 float thetaOver2 = System.MathF.Acos(s);
273 return thetaOver2 * 2.0f;
274 }
Here is the caller graph for this function:

◆ GetRotationAxis()

Vec3f SystemEx.Numeric.Quatf.GetRotationAxis ( )

Computes the normalized rotation axis of this quaternion.

211 {
212 float sinThetaOver2Sq = 1.0f - m_s * m_s;
213
214 if ( sinThetaOver2Sq <= 0.0f ) {
215 return new Vec3f(1.0f, 0.0f, 0.0f);
216 }
217 float oneOverSinThetaOver2 = 1.0f / System.MathF.Sqrt(sinThetaOver2Sq);
218
219 return Vec3f.Normalize(new Vec3f(
220 m_v.X * oneOverSinThetaOver2,
221 m_v.Y * oneOverSinThetaOver2,
222 m_v.Z * oneOverSinThetaOver2
223 ));
224
225 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Invert()

Quatf SystemEx.Numeric.Quatf.Invert ( Quatf q)
static

Computes the inverse of a quaternion.

388 {
389 float temp = Lenght(q);
390 Quatf tq = new Quatf(q);
391
392 tq.m_s /= temp;
393 tq.m_v.X /= -temp;
394 tq.m_v.Y /= -temp;
395 tq.m_v.Z /= -temp;
396 return tq; // Okay, same norm.
397 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsIdentity()

bool SystemEx.Numeric.Quatf.IsIdentity ( Quatf v)
static

Determines whether a quaternion is the identity rotation.

278 {
279 return v.m_v == Vec3f.Zero && MathF.Abs(v.m_s - 1.0f) <= 0.00001f;
280 }
Here is the call graph for this function:

◆ Lenght()

float SystemEx.Numeric.Quatf.Lenght ( Quatf v)
static

Computes the squared length of the quaternion.

341 {
342 return (v.m_s * v.m_s +
343 v.m_v.X * v.m_v.X +
344 v.m_v.Y * v.m_v.Y +
345 v.m_v.Z * v.m_v.Z);
346 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LenghtSqrt()

float SystemEx.Numeric.Quatf.LenghtSqrt ( Quatf v)
static

Computes the Euclidean length of the quaternion.

330 {
331 return System.MathF.Sqrt(v.m_s *
332 v.m_s + v.m_v.X *
333 v.m_v.X + v.m_v.Y *
334 v.m_v.Y + v.m_v.Z *
335 v.m_v.Z);
336 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Logarithm()

Quatf SystemEx.Numeric.Quatf.Logarithm ( Quatf v)
static

Computes the quaternion logarithm.

307 {
308
309 Quatf temp = new Quatf( v);
310
311 float vLen = Vec3f.LenghtSqrt(temp.m_v);
312 float angle = MathF.Atan2(vLen, temp.m_s);
313
314 temp.m_s = 0.0f;
315
316 if ( vLen > 1e-6f ) {
317 float scale = angle / vLen;
318 temp.m_v.X *= scale;
319 temp.m_v.Y *= scale;
320 temp.m_v.Z *= scale;
321 } else {
322 temp.m_v = Vec3f.Zero;
323 }
324
325 return temp;
326 }
Here is the call graph for this function:

◆ Normalize()

Quatf SystemEx.Numeric.Quatf.Normalize ( Quatf v)
static

Normalizes a quaternion to unit length.

401 {
402 float norme = LenghtSqrt(v);
403 Quatf temp = new Quatf(v);
404
405 if ( norme < 1e-12f ) {
406 temp.m_s = 1.0f;
407 temp.m_v = new Vec3f(0,0,0);
408 } else {
409 float recip = 1.0f/norme;
410
411 temp.m_s *= recip;
412 temp.m_v.X *= recip;
413 temp.m_v.Y *= recip;
414 temp.m_v.Z *= recip;
415 }
416 return temp;
417 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator*() [1/3]

Quatf SystemEx.Numeric.Quatf.operator* ( float a,
Quatf b )
static

Multiplicate a float with a quaternion.

626 {
627 Quatf _ret = new Quatf();
628
629 _ret.m_s = a * b.m_s;
630 _ret.m_v = a * b.m_v;
631
632 return _ret;
633 }
Here is the call graph for this function:

◆ operator*() [2/3]

Quatf SystemEx.Numeric.Quatf.operator* ( Quatf a,
float b )
static

Multiplicate a quaternion with a float.

637 {
638 Quatf _ret = new Quatf();
639
640 _ret.m_s = a.m_s * b;
641 _ret.m_v = a.m_v * b;
642
643 return _ret;
644 }
Here is the call graph for this function:

◆ operator*() [3/3]

Quatf SystemEx.Numeric.Quatf.operator* ( Quatf a,
Quatf b )
static

Multiplies two Quatf component‑wise.

597 {
598 Quatf qtmp = new Quatf();
599
600 float ax = a.m_v.X;
601 float ay = a.m_v.Y;
602 float az = a.m_v.Z;
603
604 float bx = b.m_v.X;
605 float by = b.m_v.Y;
606 float bz = b.m_v.Z;
607
608 float as_ = a.m_s;
609 float bs_ = b.m_s;
610
611 // Skalarteil
612 qtmp.m_s = as_ * bs_ - ax * bx - ay * by - az * bz;
613
614 // Vektorteil
615 qtmp.m_v = new Vec3f(
616 as_ * bx + bs_ * ax + ay * bz - az * by,
617 as_ * by + bs_ * ay + az * bx - ax * bz,
618 as_ * bz + bs_ * az + ax * by - ay * bx
619 );
620
621 return qtmp;
622 }
Here is the call graph for this function:

◆ operator+()

Quatf SystemEx.Numeric.Quatf.operator+ ( Quatf a,
Quatf b )
static

Adds two Quatf component‑wise.

648 {
649 return new Quatf(
650 a.m_s + b.m_s,
651 a.m_v.X + b.m_v.X,
652 a.m_v.Y + b.m_v.Y,
653 a.m_v.Z + b.m_v.Z
654 );
655 }
Here is the call graph for this function:

◆ operator-() [1/2]

Quatf SystemEx.Numeric.Quatf.operator- ( Quatf a)
static

Invert.

670 {
671 return new Quatf(
672 -a.m_s,
673 -a.m_v.X,
674 -a.m_v.Y,
675 -a.m_v.Z
676 );
677 }
Here is the call graph for this function:

◆ operator-() [2/2]

Quatf SystemEx.Numeric.Quatf.operator- ( Quatf a,
Quatf b )
static

Subtracts two Quatf component‑wise.

659 {
660 return new Quatf(
661 a.m_s - b.m_s,
662 a.m_v.X - b.m_v.X,
663 a.m_v.Y - b.m_v.Y,
664 a.m_v.Z - b.m_v.Z
665 );
666 }
Here is the call graph for this function:

◆ operator/() [1/2]

Quatf SystemEx.Numeric.Quatf.operator/ ( Quatf a,
float b )
static

Divides both components of the Quatf by a float.

687 {
688 Quatf _ret = new Quatf();
689
690 _ret.m_s = a.m_s / b;
691 _ret.m_v = a.m_v / b;
692
693 return _ret;
694 }
Here is the call graph for this function:

◆ operator/() [2/2]

Quatf SystemEx.Numeric.Quatf.operator/ ( Quatf a,
Quatf b )
static

Divides two Quatf component‑wise.

681 {
682 return a * Invert(b);
683 }
Here is the call graph for this function:

◆ Power()

Quatf SystemEx.Numeric.Quatf.Power ( Quatf v,
float Exp )
static

Raises a quaternion to a scalar power.

350 {
351 if ( System.MathF.Abs(v.m_s) > .9999f ) {
352 return v;
353 }
354
355 // Erhalte halbe angle alpha (alpha = theta/2)
356 float alpha = System.MathF.Acos(v.m_s);
357
358 // Berechne neuen alpha Wert
359 float newAlpha = alpha * Exp;
360
361 // Berechne neuen s wert
362 Quatf result = new Quatf();
363 result.m_s = System.MathF.Cos(newAlpha);
364
365 // Berechne neue xyz Werte
366
367 float mult = System.MathF.Sin(newAlpha) / System.MathF.Sin(alpha);
368 result.m_v.X = v.m_v.X * mult;
369 result.m_v.Y = v.m_v.Y * mult;
370 result.m_v.Z = v.m_v.Z * mult;
371
372 return Normalize(result);
373 }
Here is the call graph for this function:

◆ Slerp()

Quatf SystemEx.Numeric.Quatf.Slerp ( Quatf q0,
Quatf q1,
float t )
static

Performs spherical linear interpolation between two quaternions.

437 { // Spherical linear interpolation.
438 if ( t <= 0.0f ) return q0;
439 if ( t >= 1.0f ) return q1;
440
441 float cosOmega = DotProduct(q0, q1);
442
443 float q1w = q1.m_s;
444 float q1x = q1.m_v.X;
445 float q1y = q1.m_v.Y;
446 float q1z = q1.m_v.Z;
447
448 if ( cosOmega < 0.0f ) {
449 q1w = -q1w;
450 q1x = -q1x;
451 q1y = -q1y;
452 q1z = -q1z;
453 cosOmega = -cosOmega;
454 }
455
456 Debug.Assert(cosOmega < 1.0f);
457
458 // Compute interpolation fraction, checking for quaternions
459 // almost exactly the same
460
461 float k0, k1;
462 if ( cosOmega > 0.9999f ) {
463 k0 = 1.0f - t;
464 k1 = t;
465 } else {
466 // Compute the sin of the angle using the
467 // trig identity sin^2(omega) + cos^2(omega) = 1
468
469 float sinOmega = System.MathF.Sqrt(1.0f - cosOmega*cosOmega);
470
471 // Compute the angle from its sin and cosine
472
473 float omega = System.MathF.Atan2(sinOmega, cosOmega);
474
475 // Compute inverse of denominator, so we only have
476 // to divide once
477
478 float oneOverSinOmega = 1.0f / sinOmega;
479
480 // Compute interpolation parameters
481
482 k0 = System.MathF.Sin((1.0f - t) * omega) * oneOverSinOmega;
483 k1 = System.MathF.Sin(t * omega) * oneOverSinOmega;
484 }
485
486 // Interpolate
487
488 Quatf result = new Quatf();
489
490 result.m_v.X = k0 * q0.m_v.X + k1 * q1x;
491 result.m_v.Y = k0 * q0.m_v.Y + k1 * q1y;
492 result.m_v.Z = k0 * q0.m_v.Z + k1 * q1z;
493 result.m_s = k0 * q0.m_s + k1 * q1w;
494
495 // Return it
496
497 return result;
498 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToAxisAngle()

AxisAngle< Vec3f, float > SystemEx.Numeric.Quatf.ToAxisAngle ( Quatf q)
static

Converts a quaternion into an axis‑angle representation.

229 {
230 AxisAngle<Vec3f, float> _ret = new AxisAngle<Vec3f, float>();
231
232 _ret.Angle = q.GetRotationAngle();
233 _ret.Axis = q.GetRotationAxis();
234
235 return _ret;
236 }
Here is the call graph for this function:

◆ ToBytes()

FixedVector< byte > SystemEx.Numeric.Quatf.ToBytes ( )

Converts the vector into a deterministic byte sequence.

This method is used by HashFactory to compute attribute‑driven hashes. The byte layout is stable and platform‑safe, ensuring consistent hashing across devices and backends.

Implements SystemEx.Hash.IHashable< T >.

552 {
553 Cache m = new Cache(sizeof(float) * 4);
554
555 for ( byte i = 0 ; i < 4 ; i++ )
556 m.WriteRange((ulong)(sizeof(float) * i), Get(i).ToBytes());
557
558 return m.ToArrayEx();
559 }
FixedVector< byte > ToArrayEx()
Returns a copy of the internal buffer, as Array<T>.
Definition Cache.cs:656
virtual ulong WriteRange(ulong position, byte[] data)
Writes a byte range into the cache starting at the specified position.
Definition Cache.cs:231
Here is the call graph for this function:
Here is the caller graph for this function:

Property Documentation

◆ AxisAngle

AxisAngle<Vec3f, float> SystemEx.Numeric.Quatf.AxisAngle
get

Gets the axis‑angle representation of this quaternion.

◆ CompareMode

CompareType SystemEx.Numeric.Quatf.CompareMode
getset

Gets or sets the comparison mode used by CompareTo(Quatf).

125{ get => m_comparebleMode; set => m_comparebleMode = value; }

◆ S

float SystemEx.Numeric.Quatf.S
getset

Gets or sets the scalar component (w) of the quaternion.

90{ get => m_s; set => m_s = value; }

◆ V

Vec3f SystemEx.Numeric.Quatf.V
getset

Gets or sets the vector component (x,y,z) of the quaternion.

95{ get => m_v; set => m_v = value; }

◆ X

float SystemEx.Numeric.Quatf.X
getset

Gets or sets the X component of the quaternion's vector part.

100{ get => m_v.X; set => m_v.X = value; }

◆ Y

float SystemEx.Numeric.Quatf.Y
getset

Gets or sets the Y component of the quaternion's vector part.

105{ get => m_v.Y; set => m_v.Y = value; }

◆ Z

float SystemEx.Numeric.Quatf.Z
getset

Gets or sets the Z component of the quaternion's vector part.

110{ get => m_v.Z; set => m_v.Z = value; }

The documentation for this struct was generated from the following file:
  • Quatf.cs