Hey guys, I made this function called "gaussian function", named after the great mathematician "Gauss". For more info about his biography, google his name.
It will work in DBC, and there is no reason it shouldn`t work in DBP.
Anyway, here is a screeny:
And here is the function:
function gaussian_function(x,y,centerx,centery,spread,intensity)
xterm#=((x-centerx)/spread)^2
yterm#=((y-centery)/spread)^2
height#=intensity*2.718281828^(0-(xterm+yterm))
endfunction height#
How to use:
rem setup screen
sync on
sync rate 30
backdrop on
color backdrop 0
hide mouse
rem make a matrix
make matrix 1,1000,1000,50,50
rem set variables
centerx=25:`where the hill should be on the x axis
centery=25:`where the hill should be on the y axis
spread=5:`how big should the hill be
intensity=100:`how high should the hill be
rem make the gaussian hill
for x=0 to 50:`maximum matrix width
for y=0 to 50:`maximum matrix height
height#=gaussian_function(x,y,centerx,centery,spread,intensity)
set matrix height 1,x,y,height#
next y
next x
update matrix 1
And 1 more thing:Have fun!!
Please report any errors and please reply!
TheComet
Suicide is away of telling God, You can’t fire me I quit !!!!!