A little rough but you could try
http://forums.planetside.co.uk/index.php?topic=1841.0I'm going to be redeveloping this over the summer and will release a Mac version as well, although some of the functionality is Windows specific. Here are the field definitions in my database showing the different conditions and calculations for each. dx,, dy and dz are the differences between the tarpos values and the campos values.
TGS Pitch
===========
Case(
dz = 0;0;
Degrees(Atan(dz / Sqrt( dx^2 + dy^2 )))
)
TGS Heading
===========
Case(
(dx) > 0 and (dy) > 0;90 - Degrees(Atan(dy / dx));
(dx) > 0 and (dy) < 0;180 + Degrees(Atan(dx/dy));
(dx) < 0 and (dy) < 0;180 + Degrees(Atan(dx / dy));
(dx) < 0 and (dy) > 0;360 + Degrees(Atan(dx / dy));
(dx) = 0 and (dy) > 0;0;
(dx) = 0 and (dy) < 0;180;
(dx) > 0 and (dy) = 0;90;
(dx) < 0 and (dy) = 0;270
;-999) /* previous conditions should cover all combinations, set to weird value for error checking */