Subject: xearth suggestion (attn: Nils Rennebarth)

From: "Brian C. White" <[email-masked]>
Date: Thu, 04 Jul 1996 19:24:31 -0400

Attn: Nils Rennebarth <[email-masked]>

( I tried to send this to you directly, but it bounced! )

Hi!

Would you pass the following on to the author of "xearth"?   Thanks!

-----

I think it would be nice to add an additional feature to "xearth" to
automatically choose the "-rot" value so as to appear as if the earth
is view from the plane it makes relative to the sun.

I wrote a small program to do this, but I just guessed at the values.

==========
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <math.h>

const float EarthTilt = 23.5;

main()
{
        struct tm*      date;
        time_t          timestamp;
        int                     day;
        double          offset;

        time(&timestamp);
        date = localtime(&timestamp);

        day  = date->tm_yday;
        day += 10;              /* Shortest day is Dec 21st, 10 days before new year */
        day %= 365;

        offset = -EarthTilt * sin( 2.0 * M_PI * (double)day / 365.0 );

        printf("%0.4f\n",offset);
}
==========

I then start it as such:  xearth -rot `earthtilt`

I think this would be a nice feature and should probably be the default
rotation instead of "0".

                                        Brian
                               ( [email-masked] )

-------------------------------------------------------------------------------
    In theory, theory and practice are the same.  In practice, they're not.