de.jreality.math

## Class Quat

• ```public class Quat
extends Object```
This class provides static methods that interpret 4-vectors (double-arrays) as Quaternions.
Author:
weissman
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static double[]` ```add(double[] dst, double[] a, double[] b)```
`static double[]` ```conjugate(double[] dst, double[] a)```
return the conjugate quaternion: a_bar = a.re - a.im
`static double[]` ```conjugateBy(double[] dst, double[] a, double[] b)```
compute the conjugation of a by b: b*a*b^-1
`static double[]` `im(double[] a)`
`static double[]` ```invert(double[] dst, double[] a)```
`static double` `length(double[] a)`
`static double` `lengthSqared(double[] a)`
`static double` `re(double[] a)`
`static double[]` ```subtract(double[] dst, double[] a, double[] b)```
`static double[]` ```times(double[] dst, double[] a, double[] b)```
`static double[]` ```times(double[] dst, double a, double[] b)```
`static double[]` ```toQuat(double[] dst, double re, double[] im)```
`static double[]` ```toQuat(double[] dst, double re, double x, double y, double z)```
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Method Detail

```public static double[] add(double[] dst,
double[] a,
double[] b)```
• #### subtract

```public static double[] subtract(double[] dst,
double[] a,
double[] b)```
• #### times

```public static double[] times(double[] dst,
double[] a,
double[] b)```
• #### times

```public static double[] times(double[] dst,
double a,
double[] b)```
• #### invert

```public static double[] invert(double[] dst,
double[] a)```
• #### lengthSqared

`public static double lengthSqared(double[] a)`
• #### length

`public static double length(double[] a)`
• #### re

`public static double re(double[] a)`
• #### im

`public static double[] im(double[] a)`
• #### toQuat

```public static double[] toQuat(double[] dst,
double re,
double[] im)```
• #### toQuat

```public static double[] toQuat(double[] dst,
double re,
double x,
double y,
double z)```
• #### conjugateBy

```public static double[] conjugateBy(double[] dst,
double[] a,
double[] b)```
compute the conjugation of a by b: b*a*b^-1
Parameters:
`dst` - the destination
`a` -
`b` -
Returns:
the result
• #### conjugate

```public static double[] conjugate(double[] dst,
double[] a)```
return the conjugate quaternion: a_bar = a.re - a.im
Parameters:
`dst` - the destination
`a` - the quaternion to conjugate
Returns: