Example usage for java.lang StrictMath atan

List of usage examples for java.lang StrictMath atan

Introduction

In this page you can find the example usage for java.lang StrictMath atan.

Prototype

public static native double atan(double a);

Source Link

Document

Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2.

Usage

From source file:Main.java

public static void main(String[] args) {

    double d1 = 0.20, d2 = 60.00, d3 = 0;

    System.out.println("arc tangent of " + d1 + " = " + StrictMath.atan(d1));

    System.out.println("arc tangent of " + d2 + " = " + StrictMath.atan(d2));

    System.out.println("arc tangent of " + d3 + " = " + StrictMath.atan(d3));
}

From source file:net.nicoulaj.benchmarks.math.DoubleAtan.java

@GenerateMicroBenchmark
public void strictmath(BlackHole hole) {
    for (int i = 0; i < data.length - 1; i++)
        hole.consume(StrictMath.atan(data[i]));
}

From source file:org.esa.beam.util.math.FastMathPerformance.java

public void testAtan() {
    System.gc();/*from www . jav a  2 s. c  o m*/
    double x = 0;
    long time = System.nanoTime();
    for (int i = 0; i < RUNS; i++)
        x += StrictMath.atan(i * F1);
    long strictTime = System.nanoTime() - time;

    System.gc();
    double y = 0;
    time = System.nanoTime();
    for (int i = 0; i < RUNS; i++)
        y += FastMath.atan(i * F1);
    long fastTime = System.nanoTime() - time;

    System.gc();
    double z = 0;
    time = System.nanoTime();
    for (int i = 0; i < RUNS; i++)
        z += Math.atan(i * F1);
    long mathTime = System.nanoTime() - time;

    report("atan", x + y + z, strictTime, fastTime, mathTime);
}