1
HP Calculators / Fast filled circles routine
« on: January 15, 2014, 09:18:39 am »
After a discussion an another thread about filled circles, I made a little program using FILLPOLY_P to simulate a fillled circle. It was really slow because of the use of a FOR loop to make a list of coordinates to feed the FILLPOLY function. One day Han told me it would be more efficient to call MAKELIST for building lists, so I modified it a bit, and this is now REALLY faster
You can push the attached program in your calc or the simulator, run "circles" for a quick demo drawing random circles on screen at a nice speed, or use the EXPORTed FILLCIRCLE_P(centerX, centerY, radius, color) function in your program.
You can also copy/past the function in your program if you want to use it but don't want to rely on an external lib.
NB : these are not perfect circles, they are not suitable for mathematics purposes. Also, very small circle may look weird.
Enjoy
You can push the attached program in your calc or the simulator, run "circles" for a quick demo drawing random circles on screen at a nice speed, or use the EXPORTed FILLCIRCLE_P(centerX, centerY, radius, color) function in your program.
You can also copy/past the function in your program if you want to use it but don't want to rely on an external lib.
NB : these are not perfect circles, they are not suitable for mathematics purposes. Also, very small circle may look weird.
Enjoy