Re: How do I write a program to calculate the golden section?
-- code begins --
atom height, width, old_height, gold_sect
height = 1
width = 1
for i = 1 to 50 do
gold_sect = height / width
printf(1, "height: %d width: %d ratio: %1.16f\n", {height, width,
gold_sect})
old_height = height
height = width
width = old_height + width
end for
-- code ends
_______ ______ _______ ______
[ _ \[ _ ][ _ _ ][ _ ]
[/| [_] |[/| [_\][/ | | \][/| [_\]
| ___/ | _] | | | _]
[\| [/] [\| [_/] [\| |/] [\| [_/]
[_____] [______] [_____] [______]
xseal at harborside.com ICQ:13466657
http://www.harborside.com/home/x/xseal/euphoria/
|
Not Categorized, Please Help
|
|