Coordinate Transformation on Local coordinate system I am having a point $P(x,y,z)$ in $3D$ with respect to global coordinate system. I want to create an another Local  Coordinate System by picking three points $N1, N2, N3$ in 3D. Now I want to know the new coordinate values of the point $P'(x', y', z')$ with respect to the Local Coordinate System.

Please suggest me to create correct transformation matrix, or any procedure.

Thanks in advance.
$P' = T^{-1}.R_x(\theta).T.P $
$P' = T^{-1}.R_x(\theta).T.P $