# Re: [Flightgear-devel] YASIM

```Marco Gugel wrote:
> Is there someone who can tell me about local coordinates and
> global coordinates.  What is the difference?```
```
Local coordinates are in the aircraft frame (note that this isn't
the same convention that other FDMs use for their airframe
coordinates).  Global coordinates are in the earth's frame.
There are utilities in Glue.hpp you can use to convert between
them, but be careful: global coordinates *must* be handled in
double precision, a float is not enough.

> **what is height AGL?**

"Above Ground Level"

>   // Get the ground's "down" vector [...]
>   out[0] = -(float)_ground[0]; **why is it inverted?**

Presumably because I want a "up" vector, and the _ground vector
stores a normal vector to the ground plane, which points "down".

> ** what is the meaning of this operation, what is _ground[3]?**

It's a plane equation, which requires four parameters.  There are
notes somewhere in there as to what convention I'm using for the
ground plane, I honestly don't remember off the top of my head.

Never mind, you found them:

> // Get a ground plane in local coordinates.  The first three
> // elements are the normal vector the final one is the distance
> // from the local origin along that vector to the ground plane
> (**where is the origin of this vector?**),
> // (negative for objects "above" the ground)
>  **Why negative?**

Vectors are directions, they don't have origins.  The "local origin"
referred to is, of course, the origin of the local coordinate system.
And it's negative simply because that was the convention I chose.
This is a vector that points from the aircraft origin (which is above
the ground) to the ground plane.  Dotting it with something above the
ground is going to be negative.  Other conventions could have been
picked, I chose this one. :)

Andy

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
```