SimTK supports both float (single) and double precision, and is =
compiled with one of those as its default, which is then referred to in Sim=
TK as type Real. SimTK::Real is simply a typedef to either the built-in float or double type.=
OpenSim *always* uses double precision, so for our purposes the Sim=
TK::Real type is always defined

typedef = double Real;

Thus SimTK::Real and double = are interchangeable in the OpenSim API. We will use double everywhere because it is more conventional and = requires fewer characters. However, if you look elsewhere at SimTK document= ation, you will see type Real used instead; just interpret that as double when you see it. Similarly, SimT= K has a type SimTK::Complex which is interchangeable here with the C++ buil= t-in type std::complex<double>. You probably will not need to use complex numbers with OpenSim, but = they are available if you need them.

SimTK pre-defines a number of constants to machine precision; we recomme=
nd you use those rather than defining your own. The most useful ones are: P=
i, E (*e*), Infinity, NaN (not-a-number), and I (*i*=3D sqrt(=
-1) ). Note that the first letter of constants are capitalized and in =
the SimTK namespace.

Next: Vectors and Ma= trices

Home: SimTK Basics | Developer's Guide