Yado_tech

旅館+ITとはなんぞ

正規分布

f:id:devilmakelie:20171109000322p:plain

もう少しだけ頑張るんじゃよ
まだ数式の意味がわからないので形だけ整えた。

float start = -3*width;
float step = 0.1;
float dev = 100;

void setup(){
  size(800,800);
  background(255);
  translate(height/2,width/2);
  line(0,height/2.0,0,-height/2.0);
  line(width/2.0,0,-width/2.0,0);
  
  noLoop();
}

void draw(){
  translate(height/2,width/2);
  for(float i = start; i < width/2.0 ; i +=step){
    point(i,-50000*(exp(-sq(i)/(2*sq(dev)))/sqrt(2*PI*sq(dev))));
  }

}

draw()内の
(exp(-sq(i)/(2*sq(dev)))/sqrt(2*PI*sq(dev)))
正規分布のグラフ。Wiki見ながら体だけ整えたのでこれが何を意味しているのかサッパリ分からん。 特にネイピア数の使い方がまったく・・