Package javajs.util
Class Quat
java.lang.Object
javajs.util.Quat
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(float x) static Quat[]
float
get3dProjection
(V3 v3d) float[]
float[]
getNormalDirected
(V3 v0) static final Quat
getQuaternionFrame
(P3 center, T3 x, T3 xy) returns a quaternion frame based on three points (center, x, and any point in xy plane) or two vectors (vA, vB).static final Quat
getQuaternionFrameV
(V3 vA, V3 vB, V3 vC, boolean yBased) Create a quaternion based on a framefloat
getTheta()
getThetaDirected
(P4 axisAngle) float
getThetaDirectedV
(V3 vector) float
getVector
(int i) getVectorScaled
(int i, float scale) inv()
leftDifference
(Quat q2) mul
(float x) negate()
static Quat
new4
(float q1, float q2, float q3, float q0) Note that q0 is the last parameter herestatic Quat
static Quat
static Quat
static Quat
static Quat
rightDifference
(Quat q2) void
void
void
void
q = (cos(theta/2), sin(theta/2) * n)static Quat
sphereMean
(Quat[] data, float[] retStddev, float criterion) Quaternions are saved as {q1, q2, q3, q0} While this may seem odd, it is so that for any point4 -- planes, axisangles, and quaternions -- we can use the first three coordinates to determine the relavent axis the fourth then gives us offset to {0,0,0} (plane), rotation angle (axisangle), and cos(theta/2) (quaternion).toString()
Java axisAngle / plane / Point4f format all have the format {x y z w} so we go with that here as welltransform2
(T3 pt, T3 ptNew)
-
Field Details
-
q0
public float q0 -
q1
public float q1 -
q2
public float q2 -
q3
public float q3
-
-
Constructor Details
-
Quat
public Quat()
-
-
Method Details
-
newQ
-
newVA
-
newM
-
newAA
-
newP4
-
new4
Note that q0 is the last parameter here- Parameters:
q1
-q2
-q3
-q0
-- Returns:
- {q1 q2 q3 q0}
-
set
-
setTA
q = (cos(theta/2), sin(theta/2) * n)- Parameters:
pt
-theta
-
-
setAA
-
setRef
-
getQuaternionFrame
returns a quaternion frame based on three points (center, x, and any point in xy plane) or two vectors (vA, vB).- Parameters:
center
- (null for vA/vB option)x
-xy
-- Returns:
- quaternion for frame
-
getQuaternionFrameV
Create a quaternion based on a frame- Parameters:
vA
-vB
-vC
-yBased
-- Returns:
- quaternion
-
getMatrix
-
add
-
mul
-
mulQ
-
divLeft
-
dot
-
inv
-
negate
-
getVector
-
getVectorScaled
-
getNormal
- Returns:
- vector such that 0 <= angle <= 180
-
getTheta
public float getTheta()- Returns:
- 0 <= angle <= 180 in degrees
-
getThetaRadians
public float getThetaRadians() -
getNormalDirected
- Parameters:
v0
-- Returns:
- vector option closest to v0
-
get3dProjection
-
getThetaDirected
- Parameters:
axisAngle
-- Returns:
- fill in theta of axisAngle such that
-
getThetaDirectedV
- Parameters:
vector
- a vector, same as for getNormalDirected- Returns:
- return theta
-
toPoint4f
Quaternions are saved as {q1, q2, q3, q0} While this may seem odd, it is so that for any point4 -- planes, axisangles, and quaternions -- we can use the first three coordinates to determine the relavent axis the fourth then gives us offset to {0,0,0} (plane), rotation angle (axisangle), and cos(theta/2) (quaternion).- Returns:
- {x y z w} (unnormalized)
-
toAxisAngle4f
-
transform2
-
leftDifference
-
rightDifference
-
toString
Java axisAngle / plane / Point4f format all have the format {x y z w} so we go with that here as well -
div
-
arrayDiv
- Parameters:
data1
-data2
-nMax
- > 0 --> limit to this numberisRelative
-- Returns:
- pairwise array of data1 / data2 or data1 \ data2
-
sphereMean
-
getEulerZYZ
public float[] getEulerZYZ() -
getEulerZXZ
public float[] getEulerZXZ()
-