forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

tan functions

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
elevationsnow



Joined: 10 Sep 2005
Posts: 22

PostPosted: Sat Sep 10, 2005 2:24 pm    Post subject: tan functions Reply with quote

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
View user's profile Send private message
Agoln



Joined: 08 Jun 2005
Posts: 326
Location: Fort Wayne, IN

PostPosted: Tue Sep 13, 2005 2:53 am    Post subject: Reply with quote

did you link in the math library? (-lm)
_________________
Lego of my Ago!
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group