Hi all,
Just trying to calculate the angular velocity for something I'm playing around with. I can get this working fine in C, but I'm getting strange values returned from my Monkey equivalent. What am I missing?
Here's the C code
#include <stdio.h>
#include <math.h>
#define PI 3.1415926535
double calcAngleMoveX(int angle) {
return (double) cos(angle * PI / 180);
}
double calcAngleMoveY(int angle) {
return (double) sin(angle * PI / 180);
}
main()
{
int i;
for (i=0; i<360; i+=45)
{
printf("angle %d calcAngleMoveX is %f calcAngleMoveY is %f\n",i,calcAngleMoveX(i), calcAngleMoveY(i));
}
}
..and here are my Monkey equivalent functions, but the numbers returned are nothing like the ones from my C program!
Function calcanglemovex:Float(angle:Int)
Return Cos(angle*PI/180)
End Function
Function calcanglemovey:Float(angle:Int)
Return Sin(angle*PI/180)
End Function
|