]> git.mxchange.org Git - flightgear.git/blobdiff - Math/polar.c
Edited cvs log messages in source files ... bad bad bad!
[flightgear.git] / Math / polar.c
index cbbed7494c69f2f83c4b3603b3e95e939d46f2fe..ad157643e4e3cd1d3cd73bcaa6b47b5cddba9081 100644 (file)
 #include <math.h>
 #include <stdio.h>
 
-#include "polar.h"
-#include "../constants.h"
+#include <Math/polar.h>
+#include <Include/fg_constants.h>
 
 
 /* we can save these values between calls for efficiency */
 static double st, ct, sp, cp;
 
 
-/* Convert a geodetic coordinate to a cartesian coordinat on the unit
- * circle, scaled by the radius of the earth in meters.  Ignores Altitude,
- * since this is just for translating points around on the surface. */
-struct fgCartesianPoint fgGeodetic2Cartesian(double lon, double lat) {
+/* Convert a polar coordinate to a cartesian coordinate.  Lon and Lat
+ * must be specified in radians.  The FG convention is for distances
+ * to be specified in meters */
+struct fgCartesianPoint fgPolarToCart(double lon, double lat, double radius) {
     struct fgCartesianPoint pnew;
 
-    pnew.x = cos(lon) * cos(lat) * EARTH_RAD;
-    pnew.y = sin(lon) * cos(lat) * EARTH_RAD;
-    pnew.z = sin(lat) * EARTH_RAD;
+    pnew.x = cos(lon) * cos(lat) * radius;
+    pnew.y = sin(lon) * cos(lat) * radius;
+    pnew.z = sin(lat) * radius;
 
     return(pnew);
 }
@@ -101,6 +101,24 @@ struct fgCartesianPoint fgRotateCartesianPoint(struct fgCartesianPoint p) {
 
 
 /* $Log$
-/* Revision 1.1  1997/07/07 21:02:36  curt
-/* Initial revision.
-/* */
+/* Revision 1.6  1998/04/25 22:06:23  curt
+/* Edited cvs log messages in source files ... bad bad bad!
+/*
+ * Revision 1.5  1998/01/27 00:48:00  curt
+ * Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
+ * system and commandline/config file processing code.
+ *
+ * Revision 1.4  1998/01/19 19:27:12  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
+ * Revision 1.3  1997/12/15 23:54:54  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
+ * Revision 1.2  1997/07/31 22:52:27  curt
+ * Working on redoing internal coordinate systems & scenery transformations.
+ *
+ * Revision 1.1  1997/07/07 21:02:36  curt
+ * Initial revision.
+ * */