/* latlon_to_xyz.f -- translated by f2c (version 20100827).
   You must link the resulting object file with libf2c:
	on Microsoft Windows system, link with libf2c.lib;
	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
	or, if you install libf2c.a in a standard place, with -lf2c -lm
	-- in that order, at the end of the command line, as in
		cc *.o -lf2c -lm
	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,

		http://www.netlib.org/f2c/libf2c.zip
*/

#include "f2c.h"

/* Table of constant values */

static integer c__9 = 9;
static integer c__1 = 1;
static integer c__4 = 4;

/* Main program */ int MAIN__(void)
{
    /* Builtin functions */
    integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
	    e_wsle(void), s_rsle(cilist *), e_rsle(void);
    /* Subroutine */ int s_stop(char *, ftnlen);

    /* Local variables */
    static real x, y, z__, rdis, rlat, rlon;
    extern /* Subroutine */ int t_sph_to_car__(real *, real *, real *, real *,
	     real *, real *);

    /* Fortran I/O blocks */
    static cilist io___1 = { 0, 6, 0, 0, 0 };
    static cilist io___2 = { 0, 5, 0, 0, 0 };
    static cilist io___6 = { 0, 6, 0, 0, 0 };
    static cilist io___10 = { 0, 6, 0, 0, 0 };



/*     ------------------------------------------------------------------ */
/* *   Conversion lat, longitude to x y z */
/*     ------------------------------------------------------------------ */

    s_wsle(&io___1);
    do_lio(&c__9, &c__1, "lat, long, dist ? (deg. and any units)", (ftnlen)38)
	    ;
    e_wsle();
    s_rsle(&io___2);
    do_lio(&c__4, &c__1, (char *)&rlat, (ftnlen)sizeof(real));
    do_lio(&c__4, &c__1, (char *)&rlon, (ftnlen)sizeof(real));
    do_lio(&c__4, &c__1, (char *)&rdis, (ftnlen)sizeof(real));
    e_rsle();
    s_wsle(&io___6);
    do_lio(&c__4, &c__1, (char *)&rlat, (ftnlen)sizeof(real));
    do_lio(&c__4, &c__1, (char *)&rlon, (ftnlen)sizeof(real));
    do_lio(&c__4, &c__1, (char *)&rdis, (ftnlen)sizeof(real));
    e_wsle();

    rlat = rlat * 3.1415927f / 180.f;
    rlon = rlon * 3.1415927f / 180.f;

    t_sph_to_car__(&rdis, &rlat, &rlon, &x, &y, &z__);

    s_wsle(&io___10);
    do_lio(&c__4, &c__1, (char *)&x, (ftnlen)sizeof(real));
    do_lio(&c__4, &c__1, (char *)&y, (ftnlen)sizeof(real));
    do_lio(&c__4, &c__1, (char *)&z__, (ftnlen)sizeof(real));
    e_wsle();

    s_stop("latlon_to_xyz: normal termination", (ftnlen)33);
    return 0;
} /* MAIN__ */

/* Main program alias */ int latlon_to_xyz__ () { MAIN__ (); return 0; }
