Please forgive me if I'm being redundant and rambling. I can be that way.
I was thinking about how to move a large multibot. I was thinking that one of the major problems in moving a large multibot is the difficulty in making each individual bot face the same direction... so I was trying to create an algorithm to make each individual bot move the same direction, no matter what the heading of the bot is at the time. So this is my small mini-algorithm:
sine and cosine take the top value from the stack, and give back the sine and cosine values for that number (in Darwinbot units).
heading is a variable that is passed along ties-- it shows what heading the bots want to move in.
magnitude is a variable that is passed along ties-- it shows how fast the bot wants to move in the particular direction.
cond
start
heading *.angle sub cosine magnitude mult .up store
heading *.angle sub sine magnitude mult .dx store
stop
If this worked, then the heading could be determined by some sort of queen, and passed along to each bot using ties-- so each bot would move in the same direction, preventing the need for more complicated algorithms to deal with other suff.
It wasn't until I tried to implement this that I realized that the sine and cosine functions don't exist! I then started thinking that a sine and function would be so nice to have... Does anyone know if a sine and cosine function exist? If so, what are they? If not, how should I mimic them?
Thankee all!
-rayz