![]() |
|
bezier and cubic curves - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Help & Support (https://forum.boriel.com/forumdisplay.php?fid=16) +---- Thread: bezier and cubic curves (/showthread.php?tid=390) |
bezier and cubic curves - nitrofurano - 2011-10-25 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 floatcubiccurve.bas Code: dim x0,y0,x1,y1,x2,y2,x3,y3 as floatcirclefill.bas Code: dim x,y,r,xl as ubyteboxfill.bas Code: dim x1,y1,x2,y2 as integerbox.bas Code: dim x1,y1,x2,y2 as integerline.bas Code: dim x1,y1,x2,y2 as integerRe: bezier and cubic curves - britlion - 2011-10-25 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. |