Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbATANFULL() Question.

Author
Message
OceanJeff
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: Ocean Shores, WA
Posted: 9th Jan 2009 11:45
Ok, so I'm using dbATANFULL() to figure the angle between two points.

I tried simply sending it this.

dbATANFULL ( x1 - x2, y1 - y2 );

this returned results from -135+ to +100+, or should I say - on the first one...anyways, I didn't get the results 0 to 360...

then I decided maybe it wants the distance, so that should be any negative values.

dbATANFULL ( dbABS ( x1 - x2 ), dbABS ( y1 - y2 ) );

that only returned values from 0 to 90...

HELP, am I missing something here?

looking forward to responses,

jeff


AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 9th Jan 2009 12:32 Edited at: 9th Jan 2009 12:36
The problem is you're using the absolute value of the distance. Try this code:



It should return values from -180 to 180.


Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 9th Jan 2009 18:55
Give this a try also, Ive remembered it from another thread,
the fact that the second value is opposite sign to what you had makes a difference.

OceanJeff
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: Ocean Shores, WA
Posted: 9th Jan 2009 21:54
I'll have to take another look, but the documentation doesn't say that...

thanks,

jeff

OceanJeff
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: Ocean Shores, WA
Posted: 11th Jan 2009 09:36
Wow, I found the dbAtanfull() function in the camera demo.

Pretty cool.

I just went ahead and added 180 to the result it gave me, and that works...!!

later all,

jeff

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 13th Jan 2009 04:25
Note that the dbAtanFull is really atan2

dbAtanFull uses degrees

atan2 uses radians to my knowledge.

--jason

Login to post a reply

Server time is: 2024-09-30 15:30:33
Your offset time is: 2024-09-30 15:30:33