If you’re using loads of trig functions, the usual generic method to increase speed is to pre-calculate as much as you can into lookup tables/ arrays.
Most compliers (Python, C++, Fortran, Java, etc) are obviously optimized for one dimensional arrays because multiplications aren’t required to calculate the array element address.
‘// define arrays
Dim ASIn(360) as Single
Dim ACos(360) as Single
‘// pre-calculate arrays
Cs=360
de=(2* PI)/Cs
For d=1 to Cs
ASin(d)=Sin(d*de)
ACos(d)=Cos(d*de)
Next
‘// plot circle or rotate vector
For d=1 to Cs
X=100+20*Asin(d)
Y=100+20*ACos(d)
PlotPoint x,y
Next
:)