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.

DarkBASIC Professional Discussion / atanfull for dummies

Author
Message
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 15th Jul 2003 14:42
What does atanfull full do? I mean, I can read the documentation for the function, and I can read up on the maths behind it, but I don't understand in which circumstances it would be useful.

Thanks in advance,
Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 15th Jul 2003 16:04 Edited at: 15th Jul 2003 16:07
Ok, say you want to figure out what direction your mum is travelling if she starts at x1,y1 and moves to x2,y2 .... you do this ...

AngleOfTravel = atanfull(x2-x1,y2-y1)

And hey presto, you know your mum is travelling in a 45 degree direction, for example.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 15th Jul 2003 16:37
Don't you be talkin bout my momma

Seriously though - cheers. Sounds like a handy function

Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 15th Jul 2003 17:28
As I understand it its basically a short cut function that saves having to work out vectors before calculating the angle with asin or acos.

Useful, although in a 3d world you still need to be able to work out what direction your ship is pointing, rather than just the angle.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
JamesBlond
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Germany
Posted: 15th Jul 2003 18:09
Question: What is the difference between atanfull and atan?
I can only see two differences, the spelling and instead of writing "," you write "/" ( ie. angle=atan(4/2)=atanfull(4,2)=63.4349 ).

Smile and be happy, things could be worse!
So I smiled and was happy, and things got worse...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Jul 2003 20:39
They're not the same. Using ATAN() in that way only gives you angles from -90 to +90, where ATANFULL() gives you a full 360 degree range of -180 to +180.

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 16th Jul 2003 01:38
I HATE THE 360 degree turn left right threshhold barrier thing thing thing. For example, if I'm making a game with an A.I. that turns from one angle to another, turning left or right depending on which is quickest, you have to consider the 360->0 jump. Everytime I work it out and get it working in my program, I forget it again, and then have to work it out all over again for my next program.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)

Login to post a reply

Server time is: 2026-07-21 12:49:25
Your offset time is: 2026-07-21 12:49:25