code: public double decimalYear(GregorianCalendar cal)
      {
  	int year = cal.get(Calendar.YEAR);
  	double daysInYear;
  	if(cal.isLeapYear(year))
  	{
  	    daysInYear = 366.0;
  	}
  	else
  	{
  	    daysInYear = 365.0;
  	}
  	
  	return year + (cal.get(Calendar.DAY_OF_YEAR))/daysInYear;
      }
docs: <p>
  Given a Gregorian Calendar object, this returns the decimal year
  value for the calendar, accurate to the day of the input calendar.
  The hours, minutes, and seconds of the date are ignored.</p><p>
  
  If the input Gregorian Calendar is new GregorianCalendar(2012, 6, 1), all of
  the first of July is counted, and this returns 2012.5. (183 days out of 366)</p><p>
  
  If the input Gregorian Calendar is new GregorianCalendar(2010, 0, 0), the first
  of January is not counted, and this returns 2010.0</p><p>
  
  @param cal  Has the date (year, month, and day of the month)
  @return	   The date in decimal years