tan functions

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
elevationsnow
Posts: 22
Joined: Sat Sep 10, 2005 6:45 am

tan functions

Post by elevationsnow »

need help using atan2 function
code so far just excerpts

Code: Select all

#include <math.h>

#define PI 3.14159265

    while&#40;1&#41;&#123;
         sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
         x= pad.Lx - 130;
         y= pad.Ly - 130;
         rotation = float atan2 &#40;x,y&#41; /&#40;PI/180&#41;;
         for&#40;loop=0; loop < 10; loop++&#41;&#123;
         printf&#40;"rotation&#58; %i",rotation&#41;;
         &#125;
    &#125;


what it should do:
find the rotation of the analog stick just for testing purposes

error codes:
undefined reference to atan2
error 1
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

did you link in the math library? (-lm)
Lego of my Ago!
Post Reply