# Calculate axis of rotation

Thanks for kind support @lassoan

Found this, after some research

"Similarly we can also calculate backwards and find the intantanous axis of rotation at some distance

r
from any point if we know the linear velocity of the point and the angular velocity. This is given by:

[$$\label{eq:2} -\vec{r}= \frac{\vec{\omega} \times \vec{v}_P }{ \vec{\omega}\cdot\vec{\omega} }$$]
Thus if know the position of a point

r
P
, its linear velocity

v
P
we can find closest point

r
C
on the rotation axis as:

[\vec{r}_C = \vec{r}_P - \vec{r} = \vec{r}_P + \frac{\vec{\omega}\times\vec{v}_P}{\vec{\omega}\cdot\vec{\omega} }]

Script

   AnyKinRotational Rotational ={
AngVelOnOff = On;
AnyRefFrame& Ref1= .ReferenceFrame;
};

AnyKinLinear Linear ={
Ref=-1;
AnyRefFrame& Ref1= .ReferenceFrame;
};

/// Direction of the instantaneous axis of rotation
AnyVec3 e_iaor = Rotational.Vel/vnorm(Rotational.Vel)

/// The point on the rotation axis closest to ReferenceFrame origin
AnyVec3 r_iaor = Linear.Pos + cross(Rotational.Vel, Linear.Vel)/(vnorm(Rotational.Vel)^2);


Unfortunately I cant use the same software, as it only runs on Windows
Is there any possibility that slicer could enable this function, Thanks

1 Like