Regular API function

simGetRotationAxis / sim.getRotationAxis

Description Retrieves an axis and rotation angle that brings one transformation matrix onto another one. The translation part of the transformation matrices is ignored. This function, when used in combination with sim.rotateAroundAxis, can be used to build interpolations between transformation matrices. See also sim.getObjectMatrix, sim.setObjectMatrix and the other matrix/transformation functions.
C synopsis simInt simGetRotationAxis(const simFloat* matrixStart,const simFloat* matrixGoal,simFloat* axis,simFloat* angle)
C parameters
matrixStart: the start transformation matrix
matrixGoal: the goal transformation matrix
axis: the returned rotation axis in absolute coordinates
angle: the returned rotation angle
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis table_3 axis,number angle=sim.getRotationAxis(table_12 matrixStart,table_12 matrixGoal)
Lua parameters
Same as C-function
Lua return values
axis: the rotation axis in absolute coordinates, or nil in case of an error
angle: the rotation angle, or nil in case of an error

All regular API functions on one page