Java Gauss gaussian(float x, float mean, float sd)

Here you can find the source of gaussian(float x, float mean, float sd)

Description

gaussian

License

Open Source License

Declaration

public static float gaussian(float x, float mean, float sd) 

Method Source Code

//package com.java2s;

public class Main {
    public static float gaussian(float x, float mean, float sd) {
        float mu = mean;
        float sigma = sd;

        float k1 = (float) ((float) 1 / (sigma * (Math.sqrt(2 * Math.PI))));
        float k2 = -1 / (2 * (sigma * sigma));

        return (float) (k1 * Math.exp((x - mu) * (x - mu) * k2));
    }/*from w  w w  .j  av a  2 s  .  c o  m*/
}

Related

  1. gaussian(double mu, double sigma, double x)
  2. gaussian(double t)
  3. gaussian(double x, double sigma)
  4. gaussian(double[] d, double sigma, double mean)
  5. gaussian(double[][] A, double[] b)
  6. gaussian(int size, double sigma)
  7. gaussianBlur(int[][] pixels, float sigma)
  8. gaussianDensity(double x, double mean, double standardDeviation)
  9. gaussianDerivative(double x)