예제 #1
0
 public static Quaternion exp(Quaternion q) {
   final double k = Math.exp(q.re);
   Double3Vector imag = q.imag();
   final double imagNorm = imag.norm();
   return new Quaternion(
       k * Math.cos(imagNorm),
       (Double3Vector) imag.normalize().scalarMultiply(k * Math.sin(imagNorm)));
 }
예제 #2
0
 /** Returns a hashcode for this quaternion. */
 public int hashCode() {
   return (int) (Math.exp(norm()));
 }