This paper describes an algorithm for generating a tripod turning gait which, when given an arbitrarily located turning centre, firstly maximises the rotation angle (angular stride) and then secondly optimises the stability. It does not require a specific walking machine layout or leg workspace shape, and it can deal with changes in the position of the CG caused by walking on a gradient or by uneven loading.