I need to make a programme that works out the coordinates of the white triangles, given an original (larger) black triangle for a Sierpinski Gasket. I know I need to use recursion.
At the moment, I have a structure which holds the coordinates of the vertices of the black triangle, and I know how to calculate the coordinates by hand... but I don't know how to get the computer to define 3 new black triangles each time a white one is created (up to some user-defined maximum depth).
Help me out, please.
2007-03-11
23:10:01
·
1 answers
·
asked by
sarciness
3
in
Computers & Internet
➔ Programming & Design