Example usage for org.apache.commons.math3.analysis.function Gaussian Gaussian

List of usage examples for org.apache.commons.math3.analysis.function Gaussian Gaussian

Introduction

In this page you can find the example usage for org.apache.commons.math3.analysis.function Gaussian Gaussian.

Prototype

public Gaussian() 

Source Link

Document

Normalized gaussian with zero mean and unit standard deviation.

Usage

From source file:com.velonuboso.made.core.common.MadePattern.java

public static double gaussian(double value, double target, double amplitude) {
    Gaussian g = new Gaussian();
    return g.value(3 * (target - value) / amplitude);
}

From source file:com.velonuboso.made.core.common.Helper.java

public static double getGaussian(float ratio, Float from, Float to) {
    Gaussian gaussian = new Gaussian();
    if (from == null && to == null) {
        return 1;
    } else if (from == null) {
        from = 1 - to;/* www .  jav  a 2 s  .c om*/
    } else if (to == null) {
        to = 2 - from;
    }
    float target = (from + to) / 2f;
    float amplitude = to - from;
    return gaussian.value((ratio - target) / amplitude) / 0.40;
}