示例#1
0
 /**
  * @covers Marando\AstroDate\AstroDate::sidereal
  */
 public function testSidereal()
 {
     $tests = [[1.7541749718700912, AstroDate::mjd(53736.0, TimeScale::UT1())->sidereal('m'), 1.0E-9], [1.754166137675019, AstroDate::mjd(53736.0, TimeScale::UT1())->sidereal('a'), 1.0E-8], [1.7541749718700912 + deg2rad(-20), AstroDate::mjd(53736.0, TimeScale::UT1())->sidereal('m', Angle::deg(-20)), 1.0E-9], [1.754166137675019 + deg2rad(-20), AstroDate::mjd(53736.0, TimeScale::UT1())->sidereal('a', Angle::deg(-20)), 1.0E-8]];
     foreach ($tests as $t) {
         $expt = $t[0];
         $st = $t[1];
         $this->assertEquals($expt, Angle::time($st)->rad, null, $t[2]);
     }
 }
示例#2
0
 /**
  * Converts this instance to Universal Time (UT1)
  * @return static
  */
 public function toUT1()
 {
     if ($this->timescale == TimeScale::UT1()) {
         return $this;
     }
     $this->toUTC();
     $utc1 = $this->jd;
     $utc2 = $this->dayFrac;
     $dut1 = IERS::jd($utc1 + $utc2)->dut1();
     IAU::Utcut1($utc1, $utc2, $dut1, $ut11, $ut12);
     $this->jd = $ut11;
     $this->dayFrac = $ut12;
     $this->timescale = TimeScale::UT1();
     return $this;
 }