Example usage for org.apache.commons.math3.complex Quaternion dotProduct

List of usage examples for org.apache.commons.math3.complex Quaternion dotProduct

Introduction

In this page you can find the example usage for org.apache.commons.math3.complex Quaternion dotProduct.

Prototype

public static double dotProduct(final Quaternion q1, final Quaternion q2) 

Source Link

Document

Computes the dot-product of two quaternions.

Usage

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;
    }

}