Here you can find the source of gaussian(float x, float mean, float sd)
public static float gaussian(float x, float mean, float sd)
//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*/ }