Bubble universe


Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1424
Posted: 01:44pm 15 Jan 2024      

  Bleep said  :-)
Most of the time is in the Sin and Cos functions, if there was a way of optimising those it could possibly be a lot faster. ;-)

The values that uses SIN and COS in this Program are integers.
So you can precalculate a "lookup Table" with all results of 0 to 359

dim Sin1(360),Cos1(360)
for f=0 to 356:Sin1(f)=sin(f):Cos1(f)=Cos(f):next

then replace the Sin and Cos in the Program with Sin1 and Cos1.
if it is out of range, a MOD360 would help
I have no Idea if this is faster ;-)