Example usage for java.lang Math sinh

List of usage examples for java.lang Math sinh

Introduction

In this page you can find the example usage for java.lang Math sinh.

Prototype

public static double sinh(double x) 

Source Link

Document

Returns the hyperbolic sine of a double value.

Usage

From source file:org.cirdles.ambapo.UTMToLatLong.java

/**
 * //www  .j  a  v  a  2 s.c o  m
 * @param xiPrime
 * @param etaPrime
 * @return tau prime
 */
private static BigDecimal calcTauPrime(BigDecimal xiPrime, BigDecimal etaPrime) {

    double xiPrimeDouble = xiPrime.doubleValue();
    double etaPrimeDouble = etaPrime.doubleValue();

    BigDecimal sinOfXiPrime = new BigDecimal(Math.sin(xiPrimeDouble));
    BigDecimal cosOfXiPrime = new BigDecimal(Math.cos(xiPrimeDouble));
    BigDecimal sinhOfEtaPrime = new BigDecimal(Math.sinh(etaPrimeDouble));

    BigDecimal squareRoot = new BigDecimal(
            Math.sqrt(sinhOfEtaPrime.pow(2).add(cosOfXiPrime.pow(2)).doubleValue()));

    BigDecimal tauPrime = sinOfXiPrime.divide(squareRoot, PRECISION, RoundingMode.HALF_UP);

    return tauPrime;
}

From source file:org.cirdles.ambapo.LatLongToUTM.java

/**
 * Eccentricity helps define the shape of the ellipsoidal representation of
 * the earth//from w  w  w . java2s. c  o  m
 * 
 * Conformal latitude gives an angle-preserving (conformal) transformation 
 * to the sphere
 * 
 * It defines a transformation from the ellipsoid to a sphere 
 * of arbitrary radius such that the angle of intersection between any two 
 * lines on the ellipsoid is the same as the corresponding angle on the sphere.
 * 
 * @param eccentricity
 * @param latitudeRadians
 * @return BigDecimal conformal latitude
 * 
         
 */
private static BigDecimal calcConformalLatitude(BigDecimal eccentricity, BigDecimal latitudeRadians) {

    BigDecimal conformalLatitude;

    double latRadDouble = latitudeRadians.doubleValue();
    double eccDouble = eccentricity.doubleValue();
    double confLatDouble;

    Atanh atanh = new Atanh();
    Asinh asinh = new Asinh();

    confLatDouble = Math.atan(Math.sinh(
            asinh.value(Math.tan(latRadDouble)) - eccDouble * atanh.value(eccDouble * Math.sin(latRadDouble))));

    conformalLatitude = new BigDecimal(confLatDouble);

    return conformalLatitude;

}

From source file:org.cirdles.ambapo.UTMToLatLong.java

/**
 * /*from w ww.  ja va2  s .c  o  m*/
 * @param eccentricity
 * @param tau
 * @return sigma
 */
private static BigDecimal calcSigma(BigDecimal eccentricity, BigDecimal tau) {

    double eccentricityDouble = eccentricity.doubleValue();
    double tauDouble = tau.doubleValue();

    Atanh atanh = new Atanh();
    double sigmaDouble = Math.sinh(eccentricityDouble
            * (atanh.value(eccentricityDouble * tauDouble / Math.sqrt(1 + Math.pow(tauDouble, 2)))));

    BigDecimal sigma = new BigDecimal(sigmaDouble);

    return sigma;

}

From source file:org.cirdles.geoapp.LatLongToUTM.java

private static BigDecimal calcEtaEast(BigDecimal xiPrimeNorth, BigDecimal etaPrimeEast,
        BigDecimal[] alphaSeries) {

    double multiplicand = 2;
    double etaEastDouble = etaPrimeEast.doubleValue();
    double etaPrimeEastDouble = etaPrimeEast.doubleValue();
    double xiPrimeNorthDouble = xiPrimeNorth.doubleValue();

    for (int i = 0; i < alphaSeries.length - 2; i++) {

        double cosOfXiPrimeNorth = Math.cos(xiPrimeNorthDouble * multiplicand);

        double sinhOfEtaPrimeEast = Math.sinh(etaPrimeEastDouble * multiplicand);

        double augend = (alphaSeries[i].doubleValue() * cosOfXiPrimeNorth) * sinhOfEtaPrimeEast;

        etaEastDouble = etaEastDouble + augend;
        multiplicand = multiplicand + 2;

    }//from w w  w  . j  a  v  a  2 s.  c om

    double cosOfXiPrimeNorth = Math.cos(xiPrimeNorthDouble * multiplicand);

    double sinhOfEtaPrimeEast = Math.sinh(etaPrimeEastDouble * multiplicand);

    double augend = (alphaSeries[5].doubleValue() * cosOfXiPrimeNorth) * sinhOfEtaPrimeEast;

    etaEastDouble = etaEastDouble + augend;

    BigDecimal etaEast = new BigDecimal(etaEastDouble);

    return etaEast;

}

From source file:org.netxilia.functions.MathFunctions.java

public double SINH(double number) {
    return Math.sinh(number);
}

From source file:org.cirdles.ambapo.UTMToLatLong.java

/**
 * //from   ww  w  .jav  a2 s  .  c o m
 * @param zoneCentralMeridian
 * @param etaPrime
 * @param xiPrime
 * @return longitude
 */
private static BigDecimal calcLongitude(double zoneCentralMeridian, BigDecimal etaPrime, BigDecimal xiPrime) {

    double longitudeRadians = Math.atan(Math.sinh(etaPrime.doubleValue()) / Math.cos(xiPrime.doubleValue()));

    BigDecimal changeInLongitude = new BigDecimal(longitudeRadians * 180.0 / Math.PI);

    BigDecimal longitude = new BigDecimal(zoneCentralMeridian).add(changeInLongitude);

    return longitude;
}

From source file:org.cirdles.ambapo.LatLongToUTM.java

/**
 * //from w ww. java 2  s .  com
 * @param xiPrimeNorth
 * @param etaPrimeEast
 * @param alphaSeries
 * @return BigDecimal eta
 */
private static BigDecimal calcEtaEast(BigDecimal xiPrimeNorth, BigDecimal etaPrimeEast, double[] alphaSeries) {

    double multiplicand = 2;
    double etaEastDouble = etaPrimeEast.doubleValue();
    double etaPrimeEastDouble = etaPrimeEast.doubleValue();
    double xiPrimeNorthDouble = xiPrimeNorth.doubleValue();

    for (int i = 0; i < alphaSeries.length - 1; i++) {

        double cosOfXiPrimeNorth = Math.cos(xiPrimeNorthDouble * multiplicand);

        double sinhOfEtaPrimeEast = Math.sinh(etaPrimeEastDouble * multiplicand);

        double augend = (alphaSeries[i] * cosOfXiPrimeNorth) * sinhOfEtaPrimeEast;

        etaEastDouble = etaEastDouble + augend;
        multiplicand = multiplicand + 2;

    }

    BigDecimal etaEast = new BigDecimal(etaEastDouble);

    return etaEast;

}

From source file:iDynoOptimizer.MOEAFramework26.src.org.moeaframework.util.tree.NumberArithmetic.java

/**
 * Returns the hyperbolic sine of the number.
 * /* w ww.j a  v  a  2  s . c o m*/
 * @param a the number
 * @return the hyperbolic sine of the number
 * @see Math#sinh(double)
 */
public static Number sinh(Number a) {
    return Math.sinh(a.doubleValue());
}

From source file:blusunrize.immersiveengineering.api.ApiUtils.java

public static Vec3d[] getConnectionCatenary(Vec3d start, Vec3d end, double slack, @Nullable Connection c) {
    double dx = (end.x) - (start.x);
    double dy = (end.y) - (start.y);
    double dz = (end.z) - (start.z);
    double dw = Math.sqrt(dx * dx + dz * dz);
    double k = Math.sqrt(dx * dx + dy * dy + dz * dz) * slack;
    double l = 0;
    int limiter = 0;
    while (limiter < 300) {
        limiter++;/*from  ww  w  .j a va 2 s  . c  om*/
        l += 0.01;
        if (Math.sinh(l) / l >= Math.sqrt(k * k - dy * dy) / dw)
            break;
    }
    double a = dw / 2 / l;
    double offsetX = (0 + dw - a * Math.log((k + dy) / (k - dy))) * 0.5;
    double offsetY = (dy + 0 - k * Math.cosh(l) / Math.sinh(l)) * 0.5;
    if (c != null) {
        c.catOffsetX = offsetX;
        c.catOffsetY = offsetY;
        c.catA = a;
        c.horizontalLength = dw;
    }

    Vec3d[] vex = new Vec3d[vertices + 1];

    vex[0] = new Vec3d(start.x, start.y, start.z);
    for (int i = 1; i < vertices; i++) {
        float posRelative = i / (float) vertices;
        double x = 0 + dx * posRelative;
        double z = 0 + dz * posRelative;
        double y = a * Math.cosh((dw * posRelative - offsetX) / a) + offsetY;
        vex[i] = new Vec3d(start.x + x, start.y + y, start.z + z);
    }
    vex[vertices] = new Vec3d(end.x, end.y, end.z);

    return vex;
}

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

public void testSinh() {
    System.gc();// w w w .j  a va 2 s .c  o m
    double x = 0;
    long time = System.nanoTime();
    for (int i = 0; i < RUNS; i++)
        x += StrictMath.sinh(i * F1);
    long strictTime = System.nanoTime() - time;

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

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

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