package org.altusmetrum.altoslib_11;
-public class AltosQuaternion implements AltosHashable, AltosJsonable {
+public class AltosQuaternion implements AltosJsonable {
double r; /* real bit */
double x, y, z; /* imaginary bits */
}
public AltosQuaternion(AltosQuaternion q) {
- this.r = q.r;
- this.x = q.x;
- this.y = q.y;
- this.z = q.z;
+ r = q.r;
+ x = q.x;
+ y = q.y;
+ z = q.z;
+ }
+
+ public AltosQuaternion() {
+ r = 1;
+ x = 0;
+ y = 0;
+ z = 0;
}
static public AltosQuaternion vector(double x, double y, double z) {
c_x * c_y * s_z - s_x * s_y * c_z);
}
- public AltosHashSet hashSet() {
- AltosHashSet h = new AltosHashSet();
-
- h.putDouble("r", r);
- h.putDouble("x", x);
- h.putDouble("y", y);
- h.putDouble("z", z);
- return h;
- }
-
public AltosJson json() {
AltosJson j = new AltosJson();
return j;
}
- public AltosQuaternion(AltosHashSet h) {
- if (h == null)
- return;
-
- r = h.getDouble("r", 1);
- x = h.getDouble("x", 0);
- y = h.getDouble("y", 0);
- z = h.getDouble("z", 0);
- }
-
public AltosQuaternion(AltosJson j) {
if (j == null)
return;