+void Gear::set_teeth(int nt, float tooth_pitch)
+{
+ float circ = tooth_pitch * nt;
+ radius = circ / (2.0 * M_PI);
+ nteeth = nt;
+ init_angle = get_angular_pitch() * 3.0 / 8.0;
+}
+
+float Gear::get_rotation() const
+{
+ return fmod(init_angle + angle, M_PI * 2.0);
+}
+
+float Gear::get_angular_pitch() const
+{
+ return 2.0 * M_PI / (float)nteeth;
+}
+