Example usage for org.apache.commons.math3.geometry.euclidean.threed Rotation getAngle

List of usage examples for org.apache.commons.math3.geometry.euclidean.threed Rotation getAngle

Introduction

In this page you can find the example usage for org.apache.commons.math3.geometry.euclidean.threed Rotation getAngle.

Prototype

public double getAngle() 

Source Link

Document

Get the angle of the rotation.

Usage

From source file:org.orekit.utils.AngularCoordinates.java

/** Estimate rotation rate between two orientations.
 * <p>Estimation is based on a simple fixed rate rotation
 * during the time interval between the two orientations.</p>
 * @param start start orientation//from   w ww  .ja  va 2s  .  c  o  m
 * @param end end orientation
 * @param dt time elapsed between the dates of the two orientations
 * @return rotation rate allowing to go from start to end orientations
 */
public static Vector3D estimateRate(final Rotation start, final Rotation end, final double dt) {
    final Rotation evolution = start.applyTo(end.revert());
    return new Vector3D(evolution.getAngle() / dt, evolution.getAxis());
}

From source file:shapeCompare.ResultsFromEvaluateCost.java

@Override
public int hashCode() {

    float unit = 3 * algoParameters.getCELL_DIMENSION_OF_THE_PROBABILITY_MAP_ANGSTROM();

    RealVector trans = this.getTranslationVector();
    double x = trans.getEntry(0);
    double y = trans.getEntry(1);
    double z = trans.getEntry(2);
    int xInt = (int) Math.round(x / unit);
    int yInt = (int) Math.round(y / unit);
    int zInt = (int) Math.round(z / unit);

    RealMatrix rotMat = this.getRotationMatrix();
    Rotation rotation = new Rotation(rotMat.getData(), 0.01);

    int unitAngleDegrees = 8;
    double angle = rotation.getAngle();
    int angleInt = (int) Math.round((angle * 180 / Math.PI) / unitAngleDegrees);

    int hashcode = xInt;
    hashcode = hashcode * 71 + yInt;/* ww  w .j a va 2 s.c o  m*/
    hashcode = hashcode * 71 + zInt;
    hashcode = hashcode * 71 + angleInt;
    return hashcode;
}