Axis
Enumeration class for the Cartesian axes x, y, z.
Contents
Description
The only three instances Axis.x, Axis.y, and Axis.z of Axis are used extensively in MaxwellFDS to represent and specify the x-, y-, and z-axis of the Cartesian coordinate system.
Axis is a subclass of Enumerated, so it inherits all the methods of Enumerated. See Enumerated for more details.
Instances
- Axis.x: instance representing the x-axis
- Axis.y: instance representing the y-axis
- Axis.z: instance representing the z-axis
Methods
Below, axis is an instance of Axis.
- [p, q, r] = cycle(axis): [p, q, r] is a cyclic permutation of [Axis.x, Axis.y, Axis.z] satisfying r == axis.
Example
% Test conversion to integers and strings. fprintf('# of instances of Axis: %d\n', Axis.count); for w = Axis.elems fprintf('The integer value of Axis.%s is %d\n', char(w), int(w)); end
% Test cyclic permutation. [p q r] = cycle(Axis.y); fprintf('The cyclic permutation of [x, y, z] beginning with y is [%s, %s, %s]\n', char(r), char(p), char(q));