Phew, here's a lot to be said but this will do for now...
The mathematics follows a standard pattern in robotics I guess. The main task was to define the robot's forward kinematics. First I defined all transformation matrices from the body to the foot for each leg. I used 4-by-4 transformation matrices that include orientation, position, scaling and scewing.
Then I had to solve the inverse kinematics equations in order to transfer the desired position of each foot (measured in some cartesian coordinate system) into the corresponding joint angles.
There are around 30 coordinate systems involved in the kinematic model, systems dedicated for motion control included.
Perhaps the most interesting part is the motion control. There are lots of approaches here. My goal is to create smooth and controlled movements that can be defined in the simplest manner. The motion control shall be able to perform complex movements and sequences. It shall also be able to seamlessly mix different independent movements with each other. This will also be performed in real-time. To begin with, the robot will use tripod gait only (which means that three legs drives while three legs are returning).
The motion control shall eventually receive high level commands like "move in direction x at speed y". It shall independently of any on-going walking sequence be able to e g change the body orientation and/or position wrt some reference system, slow down, take higher steps, make the curve a bit wider and so on. For example, if the robot walks on a sloping surface the gait sequence will work exactly the same although the body is counter-tilted so it still is horizontal.
All movements are parameterized in a hopefully clever way in order to make them comprehensive for the human mind (or a higher level control program). There are presently over 30 "comprehensive" motion control parameters.
At an even higher level there will be path-planning, environment awareness et c involved in order to make the robot more autonomous.