Coordinate transform node coordinates.
fem2=xform(fem)
fem2=xform(fem,csto)
fem2=xform(fem,csfrom,csto)
fem2=xform(fem,'silent')
XFORM will transform nodal coordinates in the suppliedIMAT_FEM object FEM between two sets of coordinate systems. Coordinate system transformations can be local to global, global to local, or local to local. Transformations can occur between any two arbitrary coordinate systems.
CSFROM and CSTO are coordinate system labels to transform from and to, respectively. They can either be a vector of the same length as the number of nodes, or a scalar. If neither is supplied, the coordinate system(s) to transform from will be extracted from the third column (current node coordinate system) of the cs property of the node property (IMAT_NODE). The coordinate system(s) to transform to will be extracted from the first column (node definition coordinate system) of the cs property of the node property. If the nodes are currently in local coordinates, XFORM assumes that you want to transform back to the global. If only CSTO is supplied, the coordinate system to transform from will be extracted from the node property. Coordinate system 0 is defined as the global Cartesian coordinate system.
Passing in the string 'silent' suppresses output to the screen.
XFORM assumes that the angular coordinates for nodes defined in cylindrical or spherical systems are in radians. For cylindrical and spherical coordinate transforms, nodes located at a local origin may produce inaccurate results due to numerical roundoff.
XFORM will return an IMAT_FEM containing the transformed node coordinate data.
>> fem = readunv('simple_fem.unv');
>> fem.node.coord % Nodal coordinates
ans =
0 0 0
1 0 0
0 1 0
0 0 1
1 1 1
>> fem.node.cs % Nodal coordinate system definitions
ans =
2 2 0
2 2 0
2 2 0
2 2 0
2 2 0
>> fem.cs.matrix(:,:,2) % Transformation matrix for CS 2
ans =
0.5000 -0.4330 0.7500
0 0.8660 0.5000
-0.8660 -0.2500 0.4330
1.0000 2.0000 3.0000
>> fem2 = xform(fem);
Nodes: Transforming GLOBAL->LOCAL
>> fem2.node.coord
ans =
-1.8840 -3.2321 0.0670
-1.3840 -3.2321 -0.7990
-2.3170 -2.3660 -0.1830
-1.1340 -2.7321 0.5000
-1.0670 -1.8660 -0.6160
>> fem3 = xform(fem2,2,0);
Nodes: Transforming LOCAL->GLOBAL
>> fem3.node.coord
ans =
0 0 0
1.0000 0 0
0 1.0000 0
0 0 1.0000
1.0000 1.0000 1.0000
>>