CREATEBASISTRANSFORM3D Compute matrix for transforming a basis into another basis.
TRANSFO = createBasisTransform3d(SOURCE, TARGET) will create a 4-by-4
transformation matrix representing the transformation from SOURCE basis
to TARGET basis.
SOURCE and TARGET are either standard 1-by-9 geom3d PLANE
representations of the form: [x0 y0 z0 ex1 ey1 ez1 ex2 ey2 ez2]
OR
SOURCE and TARGET may be any string such as 'global' or 'g' in which
case they represent the global plane [0 0 0 1 0 0 0 1 0].
The resulting TRANSFO matrix is such that a point expressed with
coordinates of the first basis will be represented by new coordinates
P2 = transformPoint3d(P1, TRANSFO) in the target basis.
Either (or both) SOURCE or TARGET may be an N-by-9 set of N planes. In
that case, TRANSFO will be a 4-by-4-by-N array of N transformation
matrices.
Example:
% Calculate local plane coords. of a point given in global coords.
plane = [10 10 10 1 0 0 0 1 0];
transfo = createBasisTransform3d('global', plane);
PT_IN_PLANE = transformPoint3d([3 8 2], transfo)
PT_IN_PLANE =
13 18 12
See also
transforms3d, transformPoint3d, planePosition, createBasisTransform
Package: matgeom