Example usage for org.apache.commons.math4.util FastMath cosh

List of usage examples for org.apache.commons.math4.util FastMath cosh

Introduction

In this page you can find the example usage for org.apache.commons.math4.util FastMath cosh.

Prototype

public static double cosh(double x) 

Source Link

Document

Compute the hyperbolic cosine of a number.

Usage

From source file:com.ericbarnhill.arrayMath.ArrayMath.java

/**
  * In-place element-wise {@code cosh} of a {@code double[]}. Returns reference to first passed array.
  *// w w  w  .j a va2 s.c om
  * @param f {@code double[]} array.
  * @return  {@code double[]} array.
  * 
  * @since 0.1
  */
public static double[] cosh(double[] f) {
    final int fi = f.length;
    for (int i = 0; i < fi; i++) {
        f[i] = FastMath.cosh(f[i]);
    }
    return f;
}

From source file:com.ericbarnhill.arrayMath.ArrayMath.java

/**
  * Element-wise {@code cosh} of a {@code double[]}. Returns deep copy.
  *//from  w  ww .  j a v  a2  s .c o m
  * @param f {@code double[]} array.
  * @return  {@code double[]} array.
  * 
  * @since 0.1
  */
public static double[] coshC(double[] f) {
    final int fi = f.length;
    double[] h = new double[fi];
    for (int i = 0; i < fi; i++) {
        h[i] = FastMath.cosh(f[i]);
    }
    return h;
}