/** * Creates a new Cartesian vector instance * * @param Frame $frame Reference frame * @param Epoch|AstroDate $epoch Observation epoch * @param Distance $x x position * @param Distance $y y position * @param Distance $z z position * @param Velocity $vx x velocity * @param Velocity $vy y velocity * @param Velocity $vz z velocity */ public function __construct(Frame $frame, $epoch, Distance $x, Distance $y, Distance $z, Velocity $vx = null, Velocity $vy = null, Velocity $vz = null) { // Set reference frame and observation epoch $this->frame = $frame; $this->epoch = $epoch instanceof Epoch ? $epoch : $epoch->toEpoch(); // Set position components $this->x = $x; $this->y = $y; $this->z = $z; // Set velocity components $this->vx = $vx; $this->vy = $vy; $this->vz = $vz; // Set default rounding and units $this->decimalPlaces = 13; }