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.

Code Snippets / inner workings of atanfull()

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Mar 2004 21:38 Edited at: 9th Sep 2013 16:12
This function will work the same way is the DB built-in function. Just for those who like to know how things work.




modified version


Slayer
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 4th Mar 2004 22:54 Edited at: 4th Mar 2004 22:54
thats great!

also, isent there a way to use tan() and cos() to get an angle value?

I dont know how to spell
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Mar 2004 01:54
the two distances (x,y) you specify are the legs of a triangle. You could figure out the length of the hypotneuse and use sine or cosine, but its not needed. Tangent is used to find the angle given two legs. Atan to get the angle of that tangent value.

"eureka" - Archimedes
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 5th Mar 2004 20:44
Nice, usefull snippet! I know this was probably only to show how it works, but if with the way you have it written, if x# does equal zero, your going to get a divide by zero error. I'd re-write it like this:



Hoooowwwwllll!!!!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Mar 2004 04:50
That's odd. That never occurred to me. I know I've tested it x=0 I'm sure, and I got no error.

"eureka" - Archimedes
Proteus 1935
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 7th Mar 2004 00:41 Edited at: 7th Mar 2004 00:44
maybe cause in some cases floats just don't zero...

hey wolf theres a # missing there...

Currently coding: MAG
Recent coding: Video Capture Plug-in
Pharos, Time traveling since 2025

Login to post a reply

Server time is: 2024-04-26 01:51:39
Your offset time is: 2024-04-26 01:51:39