#ifndef RELATIVISTIC_ROCKET_H #define RELATIVISTIC_ROCKET_H #include //for sqrt #include "rocket.h" using namespace std; class relativistic_rocket: public rocket { public: relativistic_rocket(double init_length, double init_v); //speed of light in vacuum (meters per second) static const double c; double length() const override { const double fraction {v() / c}; return rocket::length() * sqrt(1 - fraction * fraction); } }; #endif