0

I've been searching day and have found several examples but have yet to actually get a working formula to achieve what I'm trying to do. On the surface I though it would be rather easy but I have been proven wrong.

I have a php script that prints numbers 1-XXX-1 to create a pyramid shape. For aesthetics I'm trying to smooth this into a bell curve. I can provide the data as: 1,2,3,4,5,6,5,4,3,2,1 or 1,11 or 1,2,3...,9,10,11

Every attempt I have made has ended in failure from increasing to a needle point and back to zero or a bell curve that ends negative etc..

I though I could write a simple function like: function makeCurve (P1,TotalPoints) and iterate through it where the next point would be makeCurve (P2,TotalPoints) and when Px was naer 1/2 the total number of points it would slow the increase then begin counting down.

example for 9 points: 1, 1.3, 2.5, 3.3, 4, 3.3, 2.5, 1.3, 1 If it matters I'm using Canvas Js

  • It looks to me like you are simply trying to grab values off the Gaussian function. The function is described in details here: https://en.wikipedia.org/wiki/Gaussian_function – kainaw Apr 09 '16 at 19:08
  • yes sir, I have read that several times now. – user3478913 Apr 09 '16 at 21:11

0 Answers0