News:

*NEW* Current Version on STEAM16.793

Webchat:
Visit the chat



ATAN

Previous topic - Next topic

acristo

I'd like to know what lib the atan function calls... if it is the math.atan2 or math.atan itselft ?

D2O

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
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

acristo

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

D2O

That is the sense of the community to help itself/themselves mutually.
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell