   3x3matrix and rotation c++
  HY.I have polyline class that have a list of Point3d,Point3d is a class composed by 3 double (x, y and z).so i have a little math engine that can multiply vector by matrix.Next i have the x and the z axis directions, how i can create a matrix that multiplied by my point(vector) transform the coordinate to my own coordinate system?thanks.
  Ciao. Do you want to transform your 3D points from the standard coordinate system {(1,0,0), (0,1,0), (0,0,1)} to the new coordinate system represented by the 2 x and z direction?First of all you can obtain the y direction using the cross product: y = cross(z, x)You now have all the images of the three basis vector and the matrix of this transformation is [x y z] (the 3x3 matrix with x, y and z as columns). Indeed,[x y z]*[1, 0, 0]^t = x[x y z]*[0, 1, 0]^t = y[x y z]*[0, 0, 1]^t = zas you can easily test. Note that if you need the inverse transformation and the {x, y, z} basis is orthonormal, than you simply have to take the transpose.   