List of usage examples for org.apache.commons.math3.complex Quaternion dotProduct
public static double dotProduct(final Quaternion q1, final Quaternion q2)
From source file:IK.G.java
public static Quaternion getSingleCoveredQuaternion(Quaternion inputQ, Quaternion targetQ) { //targetQ is the Quaternion that exists on the target hemisphere if (Quaternion.dotProduct(inputQ, targetQ) < 0d) { return new Quaternion(-inputQ.getQ0(), -inputQ.getQ1(), -inputQ.getQ2(), -inputQ.getQ3()); } else {/*from w w w . j a v a2 s. c o m*/ return inputQ; } }