예제 #1
0
 /**
  * @covers Marando\AstroDate\Epoch::J2000
  */
 public function testJ2000()
 {
     $epoch = Epoch::J2000();
     $this->assertEquals(2000, $epoch->year);
     $this->assertEquals(YearType::Julian(), $epoch->type);
     $this->assertEquals(2451545.0, $epoch->jd, 'jd', 0.0001);
 }
예제 #2
0
 /**
  * Creates a new epoch from a Julian year number
  * @param float $year Year number in Julian years
  */
 public static function J($year)
 {
     // Get JD of the epoch
     $jd = static::J2000()->jd + ($year - 2000) * static::DaysJulianYear;
     // Create and return new epoch
     $epoch = new static($jd);
     $epoch->type = YearType::Julian();
     return $epoch;
 }
예제 #3
0
 /**
  * @covers Marando\AstroDate\YearType::Julian
  */
 public function testJulian()
 {
     $this->assertEquals(365.25, YearType::Julian()->days);
 }