MicroBasic script sinusoidal function

8 years 4 months ago #29530648 by Trainee
Hello,

In Roborun MicroBasic script, is there a sinusoidal function that returns a sin(x) value?

Please Log in or Create an account to join the conversation.

8 years 4 months ago #29530650 by roboteq
Replied by roboteq on topic MicroBasic script sinusoidal function
There is no sin() function in microbasic

You can create one by loading an array of 90 variables, each containing the value of sine(index) * 1000, for example

SinTable[0] = 000
SinTable[1] = 017
SinTable[2] = 034
SinTable[3] = 052
SinTable[4] = 069
SinTable[5] = 087
...
SinTable[90] = 1000

Then, depending on which quadrant you are, you can use the table to compute the sine along the full 360 degrees

A sine function could be added to the language but there has been no demand for this before.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.051 seconds