Java Gauss gaussian(double t)

Here you can find the source of gaussian(double t)

Description

Satisfies Integral[gaussian(t),t,0,1] == 1D Therefore can distribute a value as a bell curve over the intervel 0 to 1

License

Open Source License

Parameter

Parameter Description
t = A value, 0 to 1, representing a percent along the curve

Return

The value of the gaussian curve at this position

Declaration

private static double gaussian(double t) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//w  w  w  . jav  a  2 s.  c  o  m
     * Satisfies Integral[gaussian(t),t,0,1] == 1D Therefore can distribute a
     * value as a bell curve over the intervel 0 to 1
     *
     * @param t = A value, 0 to 1, representing a percent along the curve
     *
     * @return The value of the gaussian curve at this position
     */
    private static double gaussian(double t) {
        t = 10D * t - 5D;
        return 1D / (Math.sqrt(5D) * Math.sqrt(2D * Math.PI)) * Math.exp(-t * t / 20D);
    }
}

Related

  1. gauss(int N, long seed)
  2. GaussElimination(double a[][])
  3. gaussian(double a[][], int index[])
  4. gaussian(double mu, double sigma, double x)
  5. gaussian(double mu, double sigma, double x)
  6. gaussian(double x, double sigma)
  7. gaussian(double[] d, double sigma, double mean)
  8. gaussian(double[][] A, double[] b)
  9. gaussian(float x, float mean, float sd)