| View previous topic :: View next topic |
| Author |
Message |
elevationsnow
Joined: 10 Sep 2005 Posts: 22
|
Posted: Sat Sep 10, 2005 2:24 pm Post subject: tan functions |
|
|
need help using atan2 function
code so far just excerpts
| Code: |
#include <math.h>
#define PI 3.14159265
while(1){
sceCtrlReadBufferPositive(&pad, 1);
x= pad.Lx - 130;
y= pad.Ly - 130;
rotation = float atan2 (x,y) /(PI/180);
for(loop=0; loop < 10; loop++){
printf("rotation: %i",rotation);
}
}
|
what it should do:
find the rotation of the analog stick just for testing purposes
error codes:
undefined reference to atan2
error 1 |
|
| Back to top |
|
 |
Agoln

Joined: 08 Jun 2005 Posts: 326 Location: Fort Wayne, IN
|
Posted: Tue Sep 13, 2005 2:53 am Post subject: |
|
|
did you link in the math library? (-lm) _________________ Lego of my Ago! |
|
| Back to top |
|
 |
|