GLBasic forum

Main forum => GLBasic - en => Topic started by: acristo on 2008-Aug-01

Title: ATAN
Post by: acristo on 2008-Aug-01
I'd like to know what lib the atan function calls... if it is the math.atan2 or math.atan itselft ?
Title: Re: ATAN
Post by: D2O on 2008-Aug-01
Sorry, bad English ;)
I hope, i understand you.

Lock This:
Code (glbasic) Select
// --------------------------------- //
// Project: Atan
// Start: Saturday, January 27, 2007
// IDE Version: 4.051


// Zwei bilder erstellen und laden
DRAWRECT  0,0,32,32,RGB(0x80, 0xff, 0x80)
GRABSPRITE 0,0,0,32,32

BLACKSCREEN

DRAWRECT  0,0,32,32,RGB(0xfc, 0x83, 0xb6)
GRABSPRITE 1,0,0,32,32


//Mainschleife
WHILE TRUE
// Mouskoordinaten zuweisen
MOUSESTATE mx,my,b1,b2

// Bild 0 hat eine feste Koordinate
DRAWSPRITE 0,300,250
// Bild 1 hängt an der Mousekoordinate
DRAWSPRITE 1,mx,my

// Mod((Atan(yBild0 - yBild1,xBild0 -xBild1)+360),360) 
winkel =  MOD((ATAN(250-my,300-mx)+360),360)

// Linie zu den Eckpunkten zeichnen
DRAWLINE 300,250,mx,my,RGB(255,0,0)
// Den Winke ausgeben
PRINT winkel,mx+38,my


SHOWSCREEN
WEND


Or here:
http://www.glbasic.com/forum/index.php?topic=651.0 (http://www.glbasic.com/forum/index.php?topic=651.0)
Title: Re: ATAN
Post by: acristo on 2008-Aug-01
D²O if I ever get any money from this I give you a share !!! :D very thanks, it worked better than I wanted... I was trying to calculate it in a diferent way, and it was not working at wall... you saved my project. :D
Title: Re: ATAN
Post by: D2O on 2008-Aug-01
That is the sense of the community to help itself/themselves mutually.