Difference between revisions of "ApplyMatrix Command"

From GeoGebra Manual
Jump to: navigation, search
m (Please,don't use LaTeX syntax for inputs to facilitate copy / paste. Thanks, Noel)
Line 5: Line 5:
 
* point ''project(M*(x(P), y(P), 1))'' where ''project'' is a projection mapping point ''(x,y,z)'' to ''(x/z, y/z)'' in case of 3x3 matrix.
 
* point ''project(M*(x(P), y(P), 1))'' where ''project'' is a projection mapping point ''(x,y,z)'' to ''(x/z, y/z)'' in case of 3x3 matrix.
  
:{{example|1=<div> Let ''M={{cos(<math>\frac{π}{2} </math>),-sin(<math>\frac{π}{2} </math>)},{sin(<math>\frac{π}{2} </math>),cos(<math>\frac{π}{2} </math>)}}'' be the transformation matrix and ''u=(2,1)'' a given vector (object). <code><nowiki>ApplyMatrix[M,u]</nowiki></code> yields the 90 degrees rotated (with mathematicaly positiv sense of rotation) vector ''u´=(-1,2)''.</div>}}
+
:{{example|1= Let <code>M={&#123;cos(π/2),-sin(π/2)},{sin(π/2),cos(π/2)&#125;}</code> be the transformation matrix and <code>u=(2,1)</code> a given vector (object). <code>ApplyMatrix[M,u]</code> yields the 90 degrees rotated (with mathematicaly positiv sense of rotation) vector ''u´=(-1,2)''.}}
 
:{{note| 1=This command also works for [[Images|images]].}}
 
:{{note| 1=This command also works for [[Images|images]].}}

Revision as of 18:02, 8 July 2013



ApplyMatrix[ <Matrix>, <Object> ]
Transforms the object O so that point P of O is mapped to
  • point M*P (with matrix M) in case M is a 2x2 matrix or
  • point project(M*(x(P), y(P), 1)) where project is a projection mapping point (x,y,z) to (x/z, y/z) in case of 3x3 matrix.
Example: Let M={{cos(π/2),-sin(π/2)},{sin(π/2),cos(π/2)}} be the transformation matrix and u=(2,1) a given vector (object). ApplyMatrix[M,u] yields the 90 degrees rotated (with mathematicaly positiv sense of rotation) vector u´=(-1,2).
Note: This command also works for images.
© 2024 International GeoGebra Institute