public function testToEclip() { // Earth -> Venus @ 2015-Nov-08 23:20:34.000 UT $dt = AstroDate::jd(2457335.47261574); $x = Distance::au(-0.7956853147170494); $y = Distance::au(-0.00807301690301796); $z = Distance::au(0.01392567642390632); $c = new Cartesian(Frame::ICRF(), $dt->toEpoch(), $x, $y, $z); $equat = $c->toEquat(); $eclip = $equat->toEclip(); $prec = Angle::arcmin(13)->deg; $this->assertEquals(180.3510658, $eclip->lon->deg, 'λ', $prec); $this->assertEquals(1.1487465, $eclip->lat->deg, 'β', $prec); }
public function test() { return; $frame = Frame::ICRF(); $epoch = Epoch::J(2000); echo $epoch->toDate()->toTDB(); echo "\n"; echo "\n"; exit; $ra = \Marando\Units\Time::hms(11, 16, 46.6); $dec = \Marando\Units\Angle::dms(5, 45, 32.5); $dist = Distance::au(5.8); echo "\n" . ($eq = new Equat($frame, $epoch, $ra, $dec, $dist)); echo "\n" . ($eq = (new Equat($frame, $epoch, $ra, $dec, $dist))->apparent()); echo "\n"; return; $frame = Frame::ICRF(); $epoch = AstroDate::jd(2457335.472615741)->toEpoch(); $ra = \Marando\Units\Time::hms(11, 16, 46.6); $dec = \Marando\Units\Angle::dms(5, 45, 32.5); $dist = Distance::au(5.8); echo "\n" . ($eq = new Equat($frame, $epoch, $ra, $dec, $dist)); echo "\n" . ($eq = (new Equat($frame, $epoch, $ra, $dec, $dist))->apparent()); $eq = new Equat($frame, $epoch, $ra, $dec, $dist); $eq->topo = Geo::deg(27, -82); echo "\n" . $eq->toHoriz(); echo "\n" . $eq->apparent(); echo "\n" . ($h = $eq->toHoriz()); echo "\n" . $h->az->deg . "\t" . $h->alt->deg; echo "\n" . $eq->apparent(\Marando\Units\Pressure::mbar(100), \Marando\Units\Temperature::F(90), 0.85); echo "\n" . $eq->toHoriz(); return; $ra = \Marando\Units\Time::hours(14.424354); $dec = \Marando\Units\Angle::deg(33.54366); $dist = Distance::au(1.5); $geo = Geo::deg(27, -82); $e = new Equat(Frame::ICRF(), Epoch::jd(2455586), $ra, $dec, $dist); $e->topo = $geo; echo "\n\n" . $e; echo "\n" . $e->apparent(); $e = new Equat(Frame::ICRF(), Epoch::jd(2455586), $ra, $dec, $dist); $e->topo = $geo; echo "\n" . $e->apparent(); $e = new Equat(Frame::ICRF(), Epoch::jd(2455586), $ra, $dec, $dist); $e->topo = $geo; echo "\n" . $e->toHoriz(); return; $e = new Equat(Frame::ICRF(), Epoch::jd(2455586), $ra, $dec, $dist); echo "\n\n" . $e; echo "\n" . $e->apparent($geo); echo "\n" . $e->apparent()->toHoriz($geo); $e = new Equat(Frame::ICRF(), Epoch::jd(2455586), $ra, $dec, $dist); echo "\n\n" . $e; echo "\n" . $e->apparent(); echo "\n" . $e->apparent()->toHoriz(); $e = new Equat(Frame::ICRF(), Epoch::jd(2451586), $ra, $dec, $dist); $e->topo = $geo; echo "\n\n" . $e; echo "\n" . $e->apparent(); echo "\n" . $e->apparent()->toHoriz(); return; // Position of Mercury $x = Distance::au(+1.18052679326447); $y = Distance::au(-0.3650485652522116); $z = Distance::au(-0.2123422968928603); // Velocity of Mercury $vx = Velocity::aud(0.02052320553396918); $vy = Velocity::aud(0.02828864020900079); $vz = Velocity::aud(0.01145246106968459); // Frame & epoch $frame = Frame::ICRF(); $epoch = AstroDate::parse('2015-Mar-20')->toEpoch(); $c = new Cartesian($frame, $epoch, $x, $y, $z, $vx, $vy, $vz); echo "\n\n"; echo $c; echo "\n\n"; echo $c->setUnit('km km/d'); echo "\n\n"; echo $c->setUnit('km km/s'); echo "\n\n"; echo $c->toEquat(); echo "\n\n"; echo $c->toEquat()->apparent(); echo "\n\n"; echo $c->toEquat()->apparent(Geo::deg(27, 278)); echo "\n\n"; echo $c->toEquat()->toHoriz(Geo::deg(27, 278)); echo "\n\n"; }
/** * @covers Marando\AstroCoord\Frame::ICRF */ public function testICRF() { $ircf = Frame::ICRF(); $this->assertEquals('ICRF', $ircf->name); $this->assertEquals(Epoch::J2000(), $ircf->equinox); }
public function testCreateWithAstroDate() { $x = Distance::au(+9.32); $y = Distance::au(-5.25); $z = Distance::au(-6.89); $c = new Cartesian(Frame::ICRF(), AstroDate::now(), $x, $y, $z); }