21.01.2015 Views

COMSOL Multiphysics™

COMSOL Multiphysics™

COMSOL Multiphysics™

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

otate<br />

Purpose<br />

rotate<br />

Rotate geometry object.<br />

Syntax<br />

Description<br />

[g,...] = rotate(g,r,...)<br />

[g3,...] = rotate(g,r,v,c,...)<br />

[g3,...] = rotate(g,r,vx,vy,vz,cx,cy,cz,...)<br />

[g3,Q,c] = rotate(g,...)<br />

[g,...] = rotate(g,r,c,...)<br />

[g,...] = rotate(g,r,cx,cy,...)<br />

[g,...] = rotate(g,r,...) rotates the 2D or 3D geometry object g, r radians<br />

about the z-axis.<br />

[g3,...] = rotate(g,r,v,c,...) rotates the 3D geometry object g by r radians<br />

about the axis v=(vx,vy,vz), with center of rotation c=(cx,cy,cz). v can also be<br />

a vector of spherical coordinates, where v(1) is the polar angle, that is, the angle<br />

between the axis of rotation and the positive z-axis, and v(2) is the azimuthal angle<br />

of the axis of rotation.<br />

[g3,...] = rotate(g,r,vx,vy,vz,cx,cy,cz,...) is the same as above, but<br />

the components of the axis and center of rotation are explicitly given.<br />

[g3,Q,c] = rotate(g,...) additionally returns a rotation matrix Q<br />

corresponding to rotation given by r and v centered at the origin. The translation<br />

vector c is also returned for convenience. This means that a point set p, of size<br />

3-by-n, containing 3D point coordinates, that is to be rotated in the same way as g,<br />

is transformed according to prot = Q*(p-cp)+cp, where cp =<br />

repmat(c(:),1,size(p,2)) represents the center of rotation.<br />

[c,...] = rotate(g,r,c,...) rotates a 2D geometry object about the point<br />

c=(cx,cy).<br />

[c,...] = rotate(g,r,cx,cy,...) is the same as above, but the center<br />

coordinates are explicitly given.<br />

The function rotate accepts the following property/values:<br />

TABLE 1-38: VALID PROPERTY/VALUE PAIRS<br />

PROPERTY VALUE DEFAULT DESCRIPTION<br />

Out stx | ftx | ctx |<br />

ptx<br />

empty<br />

See geomcsg for more information on geometry objects.<br />

Output parameters<br />

Example<br />

The command below rotates the ellipse by 1 radian about (2,3) and plots the result.<br />

378 | CHAPTER 1: COMMAND REFERENCE

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!