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