Home > matGeom > geom3d > createRotationAboutPoint3d.m

createRotationAboutPoint3d

PURPOSE ^

CREATEROTATIONABOUTPOINT3D Rotate about a point using a rotation matrix.

SYNOPSIS ^

function TFM = createRotationAboutPoint3d(ROT, point)

DESCRIPTION ^

CREATEROTATIONABOUTPOINT3D Rotate about a point using a rotation matrix.

   TFM = createRotationAboutPoint3d(ROT, POINT) Returns the transformation 
   matrix corresponding to a translation(-POINT), rotation with ROT and 
   translation(POINT). Ignores a possible translation in ROT(1:3,4).

   See also:
   transforms3d, transformPoint3d, createRotationOx, createRotationOy,
   createRotationOz, createRotation3dLineAngle, createRotationVector3d,
   createRotationVectorPoint3d

 ---------
 Author: oqilipo
 Created: 2021-01-31
 Copyright 2021

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function TFM = createRotationAboutPoint3d(ROT, point)
0002 %CREATEROTATIONABOUTPOINT3D Rotate about a point using a rotation matrix.
0003 %
0004 %   TFM = createRotationAboutPoint3d(ROT, POINT) Returns the transformation
0005 %   matrix corresponding to a translation(-POINT), rotation with ROT and
0006 %   translation(POINT). Ignores a possible translation in ROT(1:3,4).
0007 %
0008 %   See also:
0009 %   transforms3d, transformPoint3d, createRotationOx, createRotationOy,
0010 %   createRotationOz, createRotation3dLineAngle, createRotationVector3d,
0011 %   createRotationVectorPoint3d
0012 %
0013 % ---------
0014 % Author: oqilipo
0015 % Created: 2021-01-31
0016 % Copyright 2021
0017 
0018 % Extract only the rotation
0019 ROT = [ROT(1:3,1:3), [0 0 0]'; [0 0 0 1]];
0020 
0021 TFM = createTranslation3d(point) * ROT * createTranslation3d(-point);
0022 
0023 end
0024     
0025

Generated on Wed 16-Feb-2022 15:10:47 by m2html © 2003-2019