Anyone know the equations for this transformation?
Defining the Greenwich meridian as zero longitude, +x as east,
+y as up from the centre of the Earth, then at the equator,
+x = r. sin(long)
+y = r. cos(long).
Hence at lat = 0, long = 0, x = 0 and y = r.
As you come further north you'll have a smaller radius
for x and y, reducing to zero at the pole, so this new radius is
r.cos(lat).
so (x,y,z) = (r.cos(lat).sin(long), r.cos(lat).cos(long), r.cos(lat))
Not sure what you mean by the observer unless you mean a
second point, in which case its just (x1-x2, y1-y2, z1-z2) and
Euclidean geometry applies.
So now a rotation matrix is called for, as you'll want to define
the x-y plane as the ground plane for elevation and azimuth.
I won't write that out here, text is a poor vehicle. Instead, I'll
point you to
http://www.fastgraph.com/makegames/3drotation/
Oops!
z = r. SIN(90 degrees) = r.1 = r as you'd expect.
z = 0 at the equator, sin(0) = 0.
|
| Defining the Greenwich meridian as zero longitude, +x as east,
| +y as up from the centre of the Earth, then at the equator,
| +x = r. sin(long)
| +y = r. cos(long).
| Hence at lat = 0, long = 0, x = 0 and y = r.
|
| As you come further north you'll have a smaller radius
| for x and y, reducing to zero at the pole, so this new radius is
| r.cos(lat).
|
| so (x,y,z) = (r.cos(lat).sin(long), r.cos(lat).cos(long), r.cos(lat))
|
Oops again!
so (x,y,z) = (r.cos(lat).sin(long), r.cos(lat).cos(long), r.SIN(lat))
Yes, everyone that took high school trig.
--
Jim Pennino
Remove .spam.sux to reply.
How accurate does it have to be? eg Can you treat the earth as a sphere?
Try imagining a plane that passes through the center of the earth and both
points. Do a drawing for whats on that plane.
Actually it is you that does not understand the problem.
If you want an exact answer, you have to take into account the actual
shape of the Earth.
If you want an almost exact answer, you have to take into account the fact
that lat/long are referenced to a reference ellipsoid that approxiates the
shape of the Earth.
If you want a slightly less accurate answer, you approximate the shape of
the Earth as a sphere.
If you want an even less accurate answer, you assume the Earth is flat.
The less the distance between the two points, the more accurate the
approximated solutions become.
So, what is it you want?
Could you provide the exact link please?
Ok. Let's assume a spherical Earth.
Are you able now to answer my question?
Why don't you convert both points to xyz coordinates and
do vector addition? The learning is in the figuring it out!
May you provide an example?
I may not provide an example. What are you working on?
I have thetrajectory of an airplane and, given some places, I would
understand if the airplane is above the horizon (i.e. elevation) and
where I should turn away to watch it(i.e. azimuth).
That's all.
Which horizon, the geometric horizon, the visual horizon, or the radio
horizon?
Here you can find the definition of the Az-El ref. system
http://searchcio-midmarket.techtarget.com/sDefinition/0,,sid183_gci838808,00.html
I am well aware of what azimuth/elevation mean.
You said you wanted to know if something was above the horizon and I asked
which horizon.
Is your native language Italian?
I think he is fishing for someone to do his homework and doesn't have
a firm grasp on what the problem is, as in what sort of approximations
are allowed.
> X,Y, Z are easy to find.
> I think you did not understand the problem.
> Let's try an example, as it was a homework.
> I know longitude, latitude and altitude of an airplane (let's say lat
> = 40°30' N lon = 74° W and altitude 10000 m)
> I ma at the control tower of JFK airport. My coordinates are lat
> 40°38′23″N lon = 73°46′44″W and altitude 4m. Can you find
> the azimuth, the elevation and the slant range that I can record from
> the control tower? Overall can you indicate the procedure to compute
> them?
>
Nobody is going to do the whole problem for you but perhaps take a look
here..
http://www.movable-type.co.uk/scripts/latlong.html
"This page presents a variety of calculations for latitude/longitude
points, with the formul� and code fragments for implementing them."
It provides equations for working out the initial bearing between two
points which is part way to the azimuth. Then if you make some assumptions
and do the drawing I suggested it shouldn't be too hard to find the
elevation above/below the horizon/tangent and the slant range.