Java Code Examples for org.apache.commons.math3.util.FastMath#toRadians()

The following examples show how to use org.apache.commons.math3.util.FastMath#toRadians() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DerivativeStructure.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Convert degrees to radians, with error of less than 0.5 ULP
 *  @return instance converted into radians
 */
public DerivativeStructure toRadians() {
    final DerivativeStructure ds = new DerivativeStructure(compiler);
    for (int i = 0; i < ds.data.length; ++i) {
        ds.data[i] = FastMath.toRadians(data[i]);
    }
    return ds;
}
 
Example 2
Source File: CannonballExample.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public Cannonball(double timeslice, double angle, double initialVelocity, double measurementNoise, int seed) {
    this.timeslice = timeslice;
    
    final double angleInRadians = FastMath.toRadians(angle);
    this.velocity = new double[] {
            initialVelocity * FastMath.cos(angleInRadians),
            initialVelocity * FastMath.sin(angleInRadians)
    };
    
    this.location = new double[] { 0, 0 };
    
    this.measurementNoise = measurementNoise;
    this.rng = new Well19937c(seed);
}
 
Example 3
Source File: KalmanFilterTest.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public Cannonball(double timeslice, double angle, double initialVelocity) {
    this.timeslice = timeslice;
    
    final double angleInRadians = FastMath.toRadians(angle);
    this.velocity = new double[] {
            initialVelocity * FastMath.cos(angleInRadians),
            initialVelocity * FastMath.sin(angleInRadians)
    };
    
    this.location = new double[] { 0, 0 };
}
 
Example 4
Source File: DerivativeStructure.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Convert degrees to radians, with error of less than 0.5 ULP
 *  @return instance converted into radians
 */
public DerivativeStructure toRadians() {
    final DerivativeStructure ds = new DerivativeStructure(compiler);
    for (int i = 0; i < ds.data.length; ++i) {
        ds.data[i] = FastMath.toRadians(data[i]);
    }
    return ds;
}
 
Example 5
Source File: DerivativeStructure.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Convert degrees to radians, with error of less than 0.5 ULP
 *  @return instance converted into radians
 */
public DerivativeStructure toRadians() {
    final DerivativeStructure ds = new DerivativeStructure(compiler);
    for (int i = 0; i < ds.data.length; ++i) {
        ds.data[i] = FastMath.toRadians(data[i]);
    }
    return ds;
}
 
Example 6
Source File: DerivativeStructure.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Convert degrees to radians, with error of less than 0.5 ULP
 *  @return instance converted into radians
 */
public DerivativeStructure toRadians() {
    final DerivativeStructure ds = new DerivativeStructure(compiler);
    for (int i = 0; i < ds.data.length; ++i) {
        ds.data[i] = FastMath.toRadians(data[i]);
    }
    return ds;
}
 
Example 7
Source File: DerivativeStructure.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Convert degrees to radians, with error of less than 0.5 ULP
 *  @return instance converted into radians
 */
public DerivativeStructure toRadians() {
    final DerivativeStructure ds = new DerivativeStructure(compiler);
    for (int i = 0; i < ds.data.length; ++i) {
        ds.data[i] = FastMath.toRadians(data[i]);
    }
    return ds;
}
 
Example 8
Source File: DerivativeStructure.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Convert degrees to radians, with error of less than 0.5 ULP
 *  @return instance converted into radians
 */
public DerivativeStructure toRadians() {
    final DerivativeStructure ds = new DerivativeStructure(compiler);
    for (int i = 0; i < ds.data.length; ++i) {
        ds.data[i] = FastMath.toRadians(data[i]);
    }
    return ds;
}
 
Example 9
Source File: CannonballExample.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public Cannonball(double timeslice, double angle, double initialVelocity, double measurementNoise, int seed) {
    this.timeslice = timeslice;
    
    final double angleInRadians = FastMath.toRadians(angle);
    this.velocity = new double[] {
            initialVelocity * FastMath.cos(angleInRadians),
            initialVelocity * FastMath.sin(angleInRadians)
    };
    
    this.location = new double[] { 0, 0 };
    
    this.measurementNoise = measurementNoise;
    this.rng = new Well19937c(seed);
}
 
Example 10
Source File: KalmanFilterTest.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public Cannonball(double timeslice, double angle, double initialVelocity) {
    this.timeslice = timeslice;
    
    final double angleInRadians = FastMath.toRadians(angle);
    this.velocity = new double[] {
            initialVelocity * FastMath.cos(angleInRadians),
            initialVelocity * FastMath.sin(angleInRadians)
    };
    
    this.location = new double[] { 0, 0 };
}
 
Example 11
Source File: SparseGradient.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Convert degrees to radians, with error of less than 0.5 ULP
 *  @return instance converted into radians
 */
public SparseGradient toRadians() {
    return new SparseGradient(FastMath.toRadians(value), FastMath.toRadians(1.0), derivatives);
}
 
Example 12
Source File: SphericalPolygonsSetTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
private S2Point s2Point(double latitude, double longitude) {
    return new S2Point(FastMath.toRadians(longitude), FastMath.toRadians(90.0 - latitude));
}
 
Example 13
Source File: SparseGradient.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Convert degrees to radians, with error of less than 0.5 ULP
 *  @return instance converted into radians
 */
public SparseGradient toRadians() {
    return new SparseGradient(FastMath.toRadians(value), FastMath.toRadians(1.0), derivatives);
}
 
Example 14
Source File: SphericalPolygonsSetTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
private S2Point s2Point(double latitude, double longitude) {
    return new S2Point(FastMath.toRadians(longitude), FastMath.toRadians(90.0 - latitude));
}