0 Members and 1 Guest are viewing this topic.
Something you absolutely need to know : if you want to use trig, just build some LUTs (look-up tables, tables to hold constant values instead of recalculating them) and leave sin() and cos() alone. Do that at the really beginning of your code ::E90D3→°SinLUT+2→°CosLUT:L1→SinLUT+256→CosLUT // L1 or whatever free RAM area of at least 512 bytes:~1 // the negate sign, not the minus:For(256) // 256 possible angles, from 0 to 255:sin(+1→r1)→{r1+SinLUT}:cos(r1)→{r1+CosLUT}:r1:End
:E90D3->°SinLUT+2->°CosLUT // gives two names to two numbers:L1->SinLUT+256->CosLUT
:E90D3→°SinLUT+2→°CosLUT:L1→SinLUT+256→CosLUT // L1 or whatever free RAM area of at least 512 bytes:~1 // the negate sign, not the minus:For(256) // 256 possible angles, from 0 to 255:sin(+1→r1)→{r1+SinLUT}:cos(r1)→{r1+CosLUT}:r1:End
With this way of thinking, you can still directly use L1.