atan2; asin

A

ahso

Hi
I don't really understand what those functions return. Any good
explanation or visual presentation?
Many thanks
Michael Sgier
 
V

Victor Bazarov

ahso said:
I don't really understand what those functions return. Any good
explanation or visual presentation?

atan2 returns the arctangent (the inverse function of tangent) of the
first arg divided by the second arg. asin returns the arcsine (the
inverse function of sine) of its argument.

For the visual representation please turn to a trigonometry textbook.

V
 
R

red floyd

ahso said:
Hi
I don't really understand what those functions return. Any good
explanation or visual presentation?

arcsin and arctan.

What's the problem?
 
A

ahso

What's the problem?

I try to follow a airplane with another and I found:

h = int(atan2((x1-x),(z-z1)));
p = int(asin((y1-y)/hy));

x/y/z in the 3D coordinate system. So my problem is to understand and
use this as much as i can. Basically
I try to get behind the enemy plane with those functions. ie. first
output directions and distances to x1/y1/z1 from
xyz of my plane.
h and p don't actually seem to return any useful data.
Many thanks for your help.
Michael
 
A

aku ankka

I try to follow a airplane with another and I found:

h = int(atan2((x1-x),(z-z1)));
p = int(asin((y1-y)/hy));

x/y/z in the 3D coordinate system. So my problem is to understand and
use this as much as i can. Basically
I try to get behind the enemy plane with those functions. ie. first
output directions and distances to x1/y1/z1 from
xyz of my plane.
h and p don't actually seem to return any useful data.
Many thanks for your help.
Michael

You might be better off not using euler angles, you will get gimbal
locks which the aicraft won't. Use matrix/quaternion form for
orientation, it will simplify the computation a lot even if this is
off-topic here.
 
R

Richard Herring

In message
I try to follow a airplane with another and I found:

h = int(atan2((x1-x),(z-z1)));
p = int(asin((y1-y)/hy));

x/y/z in the 3D coordinate system. So my problem is to understand and
use this as much as i can. Basically
I try to get behind the enemy plane with those functions. ie. first
output directions and distances to x1/y1/z1 from
xyz of my plane.
h and p don't actually seem to return any useful data.

Those int() conversions are indeed discarding most of the available
data, since the results from atan2 and asin are in radians ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top