Make your own free website on
SIN COS and Random Numbers

Before we even get started in this I really want you to understand that math is NOT a strong point of mine. I passed Algebra I with a B-, Algebra II with a C, and barely squeeked thru geometry with a D in highschool. After getting the D I decided that perhaps math was not something I would excell at. But thanks to the efforts of Roboforge player, Slow Slosh, a few higher math functions have been compiled. Below you can find AI blocks for SIN, COS and a Random Number Generator.

I've taken the liberty of trimming these blocks so that they can be used individually, but if I've mucked it up the entire bot is also available for download.

Once you have SIN and COS in place, then you can use these to derive other math functions :

tan(x) = sin(x) / cos(x)
cot(x) = cos(x) / sin(x)
sec(x) = 1 / cos(x)
csc(x) = 1 / sin(x)

At the moment I have neither the knowledge or understanding on how to use these functions. Perhaps some enterprising individuals can create ways in which to turn these into useful bits of AI code and allow the public to use them. It is my understanding that with these functions a person can determine things such has

Knowing how far and what angle to travel to intercept a moving enemy.
Knowing where an enemy can go dependant on their max speed and facing.
Understanding what area your weapon can reach without the use of zones.
Creating complex moving patterns.

These are only some of what might be possible. It will take a better mind than I have to actually do it. Click on the name below to download the associated file.


As a side Note, I'd like to point out that the Random Number Generation Block doesnt truly create Random Numbers. It is based on the weight of the enemy (which of course you could change to base upon anything you like) and the "random" results will be duplicated every fight that the two same bots fight in the same arena, even if the fights take place on different computers. However the RND AI Block is random enough to be used to generate numbers of a chaotic nature.

And finaly, if you have any questions on any of this I will TRY and help, but as I said, my math is terrible. You'd probably have better luck in getting a useful answer by going to the RoboForge Message Forums