![]() |
bezier and cubic curves - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16) +---- Thread: bezier and cubic curves (/showthread.php?tid=390) |
bezier and cubic curves - nitrofurano - 10-25-2011 finally i coded some snipets - two of them are about drawing bezier and cubic curves - btw, if someone can help them being faster, or part of the library, be welcome! ![]() beziercurve.bas Code: dim x0,y0,x1,y1,x2,y2,x3,y3 as float cubiccurve.bas Code: dim x0,y0,x1,y1,x2,y2,x3,y3 as float circlefill.bas Code: dim x,y,r,xl as ubyte boxfill.bas Code: dim x1,y1,x2,y2 as integer box.bas Code: dim x1,y1,x2,y2 as integer line.bas Code: dim x1,y1,x2,y2 as integer Re: bezier and cubic curves - britlion - 10-25-2011 They could be sped up by using faster trig functions, somewhat - though they would lose accuracy: https://zxbasic.readthedocs.io/en/docs/library/fsin.bas/ Boriel has also optimized draw and circle to be much faster than Sinclair Basic already. Floats are also the slowest data type - you should avoid for anything you want speed for. |