/** * @covers Marando\AstroCoord\Equat::toHoriz */ public function testToHoriz() { $epoch = AstroDate::parse('2015-Nov-08 23:20:34.000')->toEpoch(); $ra = Angle::deg(180.58211)->toTime(); $dec = Angle::deg(1.00232); $astr = new Equat(Frame::ICRF(), $epoch, $ra, $dec, Distance::m(0)); $astr->topo = Geo::deg(27.9494, -82.4569); $horiz = $astr->toHoriz(); $prec = Angle::arcsec(9)->deg; $this->assertEquals(-37.8887, $horiz->alt->deg, 'alt', $prec); $this->assertEquals(295.834, $horiz->az->deg, 'az', $prec); }
public function testSetDist() { $v = Velocity::ms(10); $v->dist = Distance::m(4); $this->assertEquals(4, $v->ms); }
/** * Calculates the distance traveled in the provided time at the velocity of * this instance. * * @param Time $time * * @return Distance */ public function dist(Time $time) { return Distance::m($this->dist->m * $time->sec / $this->time->sec); }
/** * Returns a new distance with the negation of this instance. * * @return static */ public function neg() { return Distance::m(bcmul($this->m, -1), static::$s); }