/** * @covers Marando\AstroDate\Epoch::B1900 */ public function testB1900() { $epoch = Epoch::B1900(); $this->assertEquals(1900, $epoch->year); $this->assertEquals(YearType::Besselian(), $epoch->type); $this->assertEquals(2415020.31352, $epoch->jd, 'jd', 0.0001); }
/** * Finds the year of this epoch * @return float */ protected function getYear() { $year = 0; if ($this->type == YearType::Besselian()) { $year = 1900 + ($this->jd - Epoch::B1900()->jd) / static::DaysBesselianYear; } else { $year = 2000 + ($this->jd - Epoch::J2000()->jd) / static::DaysJulianYear; } return round($year, 6); }