O'Reilly logo

Software Engineering and Computer Games by Rudy Rucker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.2. The laws of motion

As well as being parallel, physics is homogeneous. We implement the principle of homogeneity by making sure to derive all of our classes from a base class that has the necessary laws built into it. We give the base class a move(dt) method that encapsulates the laws of motion. And we ensure homogeneity by making move(dt) non-virtual so that the child classes can’t override it.

What are the laws of physical motion that we need to use? Ordinarily we discuss motion in terms of a scalar mass quantity and four vector quantities: position, velocity, acceleration, and force. (Keep in mind that when we say, for instance, that velocity is a vector, we mean that velocity is a scalar speed times a unit direction vector.) The laws ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required