/** * @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); }
/** * 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; }
/** * @covers Marando\AstroDate\YearType::Julian */ public function testJulian() { $this->assertEquals(365.25, YearType::Julian()->days); }