*****************************************************************************

Mdate 1.0.1 - this code (C) 1998, 1999 Sean Dwyer <ewe2@cvis.com.au>, 
all rights and responsibilites not otherwise retained by
other authors, or the provisions of the GPL are reserved.

The meaning of all that is simply that I am the author of this code with
derivations of some algorithms of other authors, and it is I that assume the
responsibility for the program, not them.

Please read the COPYRIGHT and LICENSE documents: they list your rights and
responsibilities pertaining to this software.

*****************************************************************************

This program is not intended for the experts in mayan calendrical systems,
although it is hoped it will be of use to them in some way. It is really
intended for the enthusiast and the curious, as well as providing an
alterntative to ddate :) .

Please bear with the fact that this program is still evolving; it could use
some more bells and whistles, and a GUI interface would be much nicer :). See
the TODO file for a list of things to consider.

Configuring For Tkmdate
-----------------------

--with-tkmdate
	This enables tkmdate, at a cost of a basic commandline output, so the
	output of Mdate is easily parseable by it, or any other GUI interface for
	that matter. See the tkmdate manpage for details. Note that, for now,
	tkmdate hasn't any commandline options, you just run it.

or

--without-tkmdate
	This won't use tkmdate as standard. You get a much nicer commandline
	output at the cost of no GUI interface. Take your pick.


NEW! NEW! NEW!

with Mdate 1.0.1, we proudly announce a new home at:

http://ewe2.cvis.com.au/mdate/

also available by ftp at:

ftp://ewe2.cvis.com.au/pub/mdate/

I can also be contacted at the new address at: ewe2@cvis.com.au

*******************************************************************************

So what does it do?
===================

Simply typing "mdate" on the command line will give you a Mayan date in much
the same way as date(1) does: the Long Count, the Tzolkin day and month, and
the Haab day and month. For example (in program-parseable mode),

mdate

gives

JDN: 2451169.0 date:  21  12  1998 12.19.05.14.04  10 Kan     17 Mac    

for the 21st of December, 1998.

If you enter a Julian Day Number (JDN) instead, you will get some diagnostic
data about the JDN, the R.D. (fixed date) number, and finally the Long Count,
the Tzolkin date and Haab date of the JDN you entered. For example,

mdate -j 584285.0

gives

JDN:  584285.0 date:  13  08 -3113 00.00.00.00.00  04 Ahau    08 Cumku  

NOTE : if you enter 584285.0, you will get the same result, but it NOT be the
same if you entered 584284.0, which is another day. This round-off complies
with the rigorous testing of "Calendrical Calculations" and allows a precision
of half a Julian Day for dates, considering that most civil days start at
midnight, not noon. Note that in pre-epoch cases (like 584285.0) you will get
an ERROR (and garbage), as mdate doesnt support pre-epoch dates.

If you enter a day month year, you will get a confirmation of the date you
entered according to the program, the JDN, and the Mayan date. For example,

mdate -d 21 12 1998

gives

JDN: 2451169.0 date:  21  12  1998 12.19.05.14.04  10 Kan     17 Mac    

NOTE: notice that the JDN is a ROUNDED-OFF number, it is the SAME as the
JDN 2451168.5, NOT JDN 2451169.5 !!

this approach works for B.C dates also, eg:

mdate 21 12 -1 (21st December 1 B.C.)

gives

JDN: 1721049.0 date:  21  12 -1 07.17.17.12.04  09 Kan     17 Yaxkin 

Because we are calculating based on RD rather than JDN, you can actually get
Year 0, which doesn't exist :) but this method makes calculation MUCH more
reliable.

You can get similar results for early A.D. dates, but it's not necessary to
use negative numbers:

mdate 21 12 100 (21st December 100 A.D.)

gives

JDN: 1757939.0 date:  21  12  100 08.03.00.02.14  05 Ix      02 Chen   

There is also support for entering Long Counts, for instance:

mdate -l 12 17 9 15 6

gives

JDN: 2438231.0 date:  20  07  1963 12.17.09.15.06  07 Cimi    14 Tzec   

There are round-off issues inherent in the JDN, and as yet, mdate is not
accurate enough to guarrantee perfect results in returning the correct
Gregorian date for all dates. Scrutiny of B.C dates by others would be most
helpful to me to track down errors.


Typing "mdate -h" will give you information on all these options.
Typing "mdate -v" will give you the current version, and exits.

*****************************************************************************

Notes on the implementation
---------------------------

After searching for existing functions to do the necessary math work for the
algorithms, i had to implement my own macros and functions to replicate what
was necessary, hence the macros and functions in mdate.h and mtools.c.

I suppose I'm a bit of a magpie, but in this field, it is better to stand on
the shoulders of giants than to reinvent the wheel. My mathematical ability
certainly couldn't stand too much scrutiny :).

I use the 285 correlation in preference to the standard G-M-T because of the
many objections to GMT assumptions, and the much better correlation to
astronomical events. Add two days to your dates if it really bothers you, or
alter the correlation in mdate.h to taste.

This program could have been based on RD dates rather than JDN dates, but two
reasons made me use a conversion from JDN instead: most people
interested in Mayan dates will be using JDN anyway, and RD is more a handy
calendar-to-calendar convention; also publicly-available JDN functions for
conversion to and from our calendar were handy.

What this program REALLY needs is rough beta-testing and PORTING to other
architectures than the ones i have access to (or have compilers for)! If
people think it is worth more than a simple CLI utility, perhaps (gasp!)
something more GTK+ for the GUI crowd?? I'm not an accomplished programmer by
most standards, so i could use the analysis, too...

See what you can do with it...


Sean Dwyer <ewe2@cvis.com.au>

$Id: README,v 1.7 1999/09/21 03:53:17 ewe2 Exp $
$Log: README,v $
Revision 1.7  1999/09/21 03:53:17  ewe2
Final changes to Mdate for a while.

Revision 1.6  1999/05/23 05:50:33  ewe2
mdate 1.0.0beta3 revision

Revision 1.5  1999/05/11 11:43:33  ewe2
Mdate 1.0.0beta2 extra fixes

Revision 1.4  1999/05/04 16:38:30  ewe2
New Mdate version 1.0.0.beta1

Revision 1.3  1999/04/13 01:26:15  ewe2
GPL'ed code, ready for distribution

Revision 1.2  1999/04/07 09:33:41  ewe2
Adding keywords on some source files

$State: Exp $
