Matrix Class Function Manual (P-R)

PERCENTILE

| HOME | BACK |

Purpose

To compute the value of a specified percentile of a matrix.  A 70% percentile is a value at which 70% of data are smaller.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{double} ret  =  object.PERCENTILE({double} argm1)

For class Matrix_flt

{float} ret  =  object.PERCENTILE({double} argm1)

For class Matrix_int

{int} ret  =  object.PERCENTILE({double} argm1)

For class Matrix_sht

{short} ret  =  object.PERCENTILE({double} argm1)

For class Matrix_uch

{uchar} ret  =  object.PERCENTILE({double} argm1)

For class Matrix_bln

{bool} ret  =  object.PERCENTILE({double} argm1)

argm1 = percent at which a percentile value being wanted

Example:

->A = Matrix()
->A.lingen(1,20)
->print A.tsp()

no of row    : 20
no of column : 1

0:   1.00000
1:   2.00000
2:   3.00000
3:   4.00000
4:   5.00000
5:   6.00000
6:   7.00000
7:   8.00000
8:   9.00000
9:  10.00000
10: 11.00000
11: 12.00000
12: 13.00000
13: 14.00000
14: 15.00000
15: 16.00000
16: 17.00000
17: 18.00000
18: 19.00000
19: 20.00000

->A.percentile(90)

ans = 19.00000

->

See also (class function)

mean, median, max, min

| HOME | BACK |


POLYLINE

| HOME | BACK |

Purpose

To find poly-lines in a Matrix.  A poly-line is defined by pixels, whose value greater than zero, connected to each other in one direction.  This function will detect all connected poly-lines in the matrix, and store the result in a vector of poly-lines, a VecRCpline object.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{VecRCpline} ret  =  object.POLYLINE()

Example:

->A = Matrix()
->A.unit(5)
->print A


no of row    : 5
no of column : 5

0:  1.00000  0.00000  0.00000  0.00000  0.00000
1:  0.00000  1.00000  0.00000  0.00000  0.00000
2:  0.00000  0.00000  1.00000  0.00000  0.00000
3:  0.00000  0.00000  0.00000  1.00000  0.00000
4:  0.00000  0.00000  0.00000  0.00000  1.00000

->v = A.polyline()
->print v

Vector size : 1


Vector of Index (row, column)...

list id : 1

Vector size : 5

(0 , 0)
(1 , 1)
(2 , 2)
(3 , 3)
(4 , 4)


->

See also (class function)

linefollow

| HOME | BACK |


PRODCOL

| HOME | BACK |

Purpose

To compute a product, a multiplication, of all values in each column.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{Matrix} ret  =  object.PRODCOL()

For class Matrix_flt

{Matrix_flt} ret  =  object.PRODCOL()

For class Matrix_int

{Matrix_int} ret  =  object.PRODCOL()

For class Matrix_sht

{Matrix_sht} ret  =  object.PRODCOL()

For class Matrix_uch

{Matrix_uch} ret  =  object.PRODCOL()

For class Matrix_bln

{Matrix_bln} ret  =  object.PRODCOL()

Example:

->a = [ 1 2 3; 4 5 6; 7 8 9]

->b = a.prodcol()

->print b

 no of row    : 1
 no of column : 3

 0:    28.00000    80.00000    162.00000

See also (class function)

prodrow

| HOME | BACK |


PRODROW

| HOME | BACK |

Purpose

To compute a product, a multiplication, of all values in each row.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{Matrix} ret  =  object.PRODROW()

For class Matrix_flt

{Matrix_flt} ret  =  object.PRODROW()

For class Matrix_int

{Matrix_int} ret  =  object.PRODROW()

For class Matrix_sht

{Matrix_sht} ret  =  object.PRODROW()

For class Matrix_uch

{Matrix_uch} ret  =  object.PRODROW()

For class Matrix_bln

{Matrix_bln} ret  =  object.PRODROW()

Example:

->a = [ 1 2 3; 4 5 6; 7 8 9]

->b = a.prodrow()

->print b

 no of row : 3
 no of column : 1

 0:      6.00000
 1:    120.00000
 2:    504.00000

See also (class function)

prodcol

| HOME | BACK |


PYRAMID

| HOME | BACK |

Purpose

To create an image pyramid, consisting of a number of Matrix objects, stored in files, at different resolutions.

The 1st level is the same as the original matrix.  The 2nd level has number of rows and columns half of those of the 1st level, and so on.

A decrease of resolution is each level is done by skipping data for one row and one column of the previous matrix.  There is a Gaussian filter applied to the previous level of matrix prior to skipping.  If the standard deviation of the Gaussian filter is not given by the user, the program uses the default value of 0.75.

Each level of a pyramid is stored in a file by a name specified by the user followed by "_n", where n is a level number, and the first level is zero.  For example, if an output file name is "my_matrix", the 1st level matrix will have a name of "my_matrix_0".  The 2nd level will have a name of "my_matrix_1" and so on.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{void} object.PYRAMID({int} argm1, [{String} argm2, {double} argm3])

argm1 = no of levels of pyramid image

argm2 = output pyramid file name                     (default = "pyramid")

argm2 = standard deviation of the Gausiian filter    (default = 0.75)

Example:

->A.pyramid(5, "my_matrix")

->

See also (class function)

save

| HOME | BACK |


QFIND

| HOME | BACK |

Purpose

To find a particular element within a certain column of a matrix.  If found the function returns the row number at which the data is found, otherwise returns -1.

This function performs a binary search, thus it assumes that the matrix is already sorted in the specific column.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{int} ret = object.QFIND({double} argm1,{int} argm2)

For class Matrix_flt

{int} ret = object.QFIND({float} argm1,{int} argm2)

For class Matrix_int

{int} ret = object.QFIND({int} argm1,{int} argm2)

For class Matrix_sht

{int} ret = object.QFIND({short} argm1,{int} argm2)

For class Matrix_uch

{int} ret = object.QFIND({uchar} argm1,{int} argm2)

For class Matrix_bln

{int} ret = object.QFIND({bool} argm1,{int} argm2)

argm1 = data wanted to find in a matrix

argm2 = column number within which the data are searched

Example:

->A = [ 1 2 3; 4 5 6; 7 8 9]
->print A


no of row    : 3
no of column : 3

0:   1.00000   2.00000   3.00000
1:   4.00000   5.00000   6.00000
2:   7.00000   8.00000   9.00000


->A.qfind(4,0)

ans = 1

->

See also (class function)

find

| HOME | BACK |


R2OPK

| HOME | BACK |

Purpose

To extract 3 rotation angles from a rotation matrix.  The result is a vector of 3 elements, in which the first element is omega, angle about the x-axis, the second is phi , angle about y-axis, and the last is kappa, angle about z-axis.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{vector} ret  =  object.R2OPK()

Example:

 

->a = Matrix()

->a.Rxyz(10,20,30)

->print a

 no of row : 3
 no of column : 3

 0:    0.81380    0.54384   -0.20487
 1:   -0.46985    0.82317    0.31880
 2:    0.34202   -0.16318    0.92542


->v = a.r2opk()
->v

ans =
Vector size : 3

10.00000
20.00000
30.00000

See also (class function)

Rx, Ry, Rz, Rxyz

| HOME | BACK |


RAND

| HOME | BACK |

Purpose

To create a matrix whose element values are random numbers.  The random numbers will overwrite all previous values of all elements in the matrix.  Thus, the matrix must be initialized to have a certain size, before it can call this function.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{void} object.RAND([{double} argm1])

argm1 = maximum possible value of random number

       (default = value set by command "set randmax")

Example:

->A = Matrix(5,5)
->A.rand(25)
->print A


no of row : 5
no of column : 5

0:   15.44694   21.45222   18.71776   17.78314    0.38301
1:   18.54839   12.57744    8.14920    6.26774   16.48152
2:    7.42134    1.48473   11.25904   15.69491    9.64690
3:   17.91589   24.52849   17.54967   16.06265    1.84332
4:   20.88763   11.04617    6.84530    8.69472    8.67946


->

See also (class function)

init, lingen

| HOME | BACK |


RANK

| HOME | BACK |

Purpose

To determine the rank of a matrix

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{int} ret  =  object.RANK()

Example:

->a = [ 1 2 3; 4 5 6; 7 8 9]
->a

ans =

no of row    : 3
no of column : 3

0:    1.00000    2.00000    3.00000
1:    4.00000    5.00000    6.00000
2:    7.00000    8.00000    9.00000



->a.rank()

ans = 2

->

See also (class function)

rref, inv

| HOME | BACK |


RC2NO

| HOME | BACK |

Purpose

To convert a row and column number to a number.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{int} ret  =  object.RC2NO({int} argm1, {int} argm2)

argm1 = row number

argm2 = column number

Example:

->A = Matrix(2,3)

->A.rc2no(0,0)

ans =      0

->A.rc2no(0,2)

ans =      2

See also (class function)

no2rc

| HOME | BACK |


REASSIGN

| HOME | BACK |

Purpose

To re-assign a new value to elements of a matrix, if the original value is within a certain range, argm1 x argm2, specified by argument 1 and argument 2 in the function.  Otherwise keeps the original value. 

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{Matrix} ret  =  object.REASSIGN({double} argm1, {double} argm2, {double} argm3)

argm1 = start value of the specified range 

argm2 = end value of the specified range   

argm3 = value to be assigned, if original value is within the range.

Example:

->a = [ 1 2 3; 4 5 6; 7 8 9]
->b = a.reassign(4,6,999)
->b

ans =

 no of row    : 3
 no of column : 3

 0:     1.00000      2.00000      3.00000
 1:   999.00000    999.00000    999.00000
 2:     7.00000      8.00000      9.00000

See also (class function)

reclass

| HOME | BACK |


RECLASS

| HOME | BACK |

Purpose

To re-assign value of elements of a matrix according to a list of boundary, given by a vector. 

The following is an example of a list of boundary values, stored in a vector object, says 5 values:  12 15 20 35 60.

Then the function will classify elements of the matrix, according to their values, into 6 classes, as follows (x is the original value).

class 0       x < 12

class 1       12 ≤ x < 15

class 2       15 ≤ x < 20

class 3       20 ≤ x < 35

class 4       35 ≤ x < 60

class 5       x 60

Thus each element of the new matrix will be assigned a number from 0 to 5, according to the original values of the calling matrix.

It is very important that values in the specified vector be sorted from small to large values.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{Matrix} ret  =  object.RECLASS({Vector} argm1)

For class Matrix_flt

{Matrix_flt} ret  =  object.RECLASS({Vector} argm1)

For class Matrix_int

{Matrix_int} ret  =  object.RECLASS({Vector} argm1)

For class Matrix_sht

{Matrix_sht} ret  =  object.RECLASS({Vector} argm1)

For class Matrix_uch

{Matrix_uch} ret  =  object.RECLASS({Vector} argm1)

For class Matrix_bln

{Matrix_bln} ret  =  object.RECLASS({Vector} argm1)

argm1 = vector contains boundary points

Example:

->a = [ 1 2 3; 4 5 6; 7 8 9]
->v1 = vector(2)
->v1.pushback(4)
->v1.pushback(6)
->b = a.reclass(v1)
->b

ans =

 no of row    : 3
 no of column : 3

 0:    0.00000    0.00000    0.00000
 1:    1.00000    1.00000    2.00000
 2:    2.00000    2.00000    2.00000

See also (class function)

reassign

| HOME | BACK |


RESHAPE

| HOME | BACK |

Purpose

To reshape the size of a matrix. 

It is important that the total number of elements of a matrix before and after reshape must be the same.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{Matrix} ret  =  object.RESHAPE({int} argm1, {int} argm2)

For class Matrix_flt

{Matrix_flt} ret  =  object.RESHAPE({int} argm1, {int} argm2)

For class Matrix_int

{Matrix_int} ret  =  object.RESHAPE({int} argm1, {int} argm2)

For class Matrix_sht

{Matrix_sht} ret  =  object.RESHAPE({int} argm1, {int} argm2)

For class Matrix_uch

{Matrix_uch} ret  =  object.RESHAPE({int} argm1, {int} argm2)

For class Matrix_bln

{Matrix_bln} ret  =  object.RESHAPE({int} argm1, {int} argm2)

argm1 = new number of rows

argm2 = new number of columns 

Example:

->A = [ 1 2 3; 4 5 6; 7 8 9]
->print A


no of row    : 3
no of column : 3

0:   1.00000   2.00000   3.00000
1:   4.00000   5.00000   6.00000
2:   7.00000   8.00000   9.00000


->B = A.reshape(9,1)
->print B


no of row    : 9
no of column : 1

0: 1.00000
1: 2.00000
2: 3.00000
3: 4.00000
4: 5.00000
5: 6.00000
6: 7.00000
7: 8.00000
8: 9.00000


->

See also (class function)

tsp

| HOME | BACK |


REVERSE

| HOME | BACK |

Purpose

To reverse values of elements of a matrix.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{Matrix} ret  =  object.REVERSE()

For class Matrix_flt

{Matrix_flt} ret  =  object.REVERSE()

For class Matrix_int

{Matrix_int} ret  =  object.REVERSE()

For class Matrix_sht

{Matrix_sht} ret  =  object.REVERSE()

For class Matrix_uch

{Matrix_uch} ret  =  object.REVERSE()

For class Matrix_bln

{Matrix_bln} ret  =  object.REVERSE()

Example:

->a

ans =

 no of row    : 3
 no of column : 3

 0:    1.00000    2.00000    3.00000
 1:    4.00000    5.00000    6.00000
 2:    7.00000    8.00000    9.00000


->b = a.reverse()
->b

ans =

 no of row    : 3
 no of column : 3

 0:    9.00000    8.00000    7.00000
 1:    6.00000    5.00000    4.00000
 2:    3.00000    2.00000    1.00000

See also (class function)

reshape

| HOME | BACK |


RGB

| HOME | BACK |

Purpose

To make an Image_rgb object from a matrix.  The colors of the output image are taken from the current color map, a 3-column matrix, by using values of elements of the calling matrix as an index to the color map.  The first color in the color map has an index of zero.

Any element having a value less than zero or greater than n-1, where n is the maximum number of color in the current color map, will be assigned a black color, red = 0, green = 0, blue = 0.

See details information of color map in command "set colormap".

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{Image_rgb} ret  =  object.RGB()

Example:

->A_rgb = A.rgb()

->

See also (class function)

rgbauto

| HOME | BACK |


RGBAUTO

| HOME | BACK |

Purpose

To make an Image_rgb object from a matrix.  The calling matrix will be stretched so that its values range from 0 to n-1, where n is the number of colors in the current color map.  In contrast to function "rgb", this function will make use of the full scale of the current color map.

See details information of color map in command "set colormap".

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{Image_rgb} ret  =  object.RGBAUTO()

Example:

->A_rgb = A.rgbauto()

->

See also (class function)

rgb

| HOME | BACK |


ROT180

| HOME | BACK |

Purpose

To rotate a matrix at angle of 180 degree.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{Matrix} ret  =  object.ROT180()

For class Matrix_flt

{Matrix_flt} ret  =  object.ROT180()

For class Matrix_int

{Matrix_int} ret  =  object.ROT180()

For class Matrix_sht

{Matrix_sht} ret  =  object.ROT180()

For class Matrix_uch

{Matrix_uch} ret  =  object.ROT180()

For class Matrix_bln

{Matrix_bln} ret  =  object.ROT180()

Example:

->A = [ 1 2 3; 4 5 6; 7 8 9]
->print A


no of row    : 3
no of column : 3

0:   1.00000   2.00000   3.00000
1:   4.00000   5.00000   6.00000
2:   7.00000   8.00000   9.00000


->B = A.rot180()
->print B


no of row    : 3
no of column : 3

0:   9.00000   8.00000   7.00000
1:   6.00000   5.00000   4.00000
2:   3.00000   2.00000   1.00000


->

See also (class function)

rot90l, rot90r, fliplr, flipud

| HOME | BACK |


ROT90L

| HOME | BACK |

Purpose

To rotate a matrix at angle of 90 degree to the left.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{Matrix} ret  =  object.ROT90L()

For class Matrix_flt

{Matrix_flt} ret  =  object.ROT90L()

For class Matrix_int

{Matrix_int} ret  =  object.ROT90L()

For class Matrix_sht

{Matrix_sht} ret  =  object.ROT90L()

For class Matrix_uch

{Matrix_uch} ret  =  object.ROT90L()

For class Matrix_bln

{Matrix_bln} ret  =  object.ROT90L()

Example:

->A = [ 1 2 3; 4 5 6; 7 8 9]
->print A


no of row    : 3
no of column : 3

0:   1.00000   2.00000   3.00000
1:   4.00000   5.00000   6.00000
2:   7.00000   8.00000   9.00000


->B = A.rot90l()
->print B


no of row    : 3
no of column : 3

0:   3.00000   6.00000   9.00000
1:   2.00000   5.00000   8.00000
2:   1.00000   4.00000   7.00000


->

See also (class function)

rot180, rot90r, fliplr, flipud

| HOME | BACK |


ROT90R

| HOME | BACK |

Purpose

To rotate a matrix at angle of 90 degree to the right.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

For class Matrix

{Matrix} ret  =  object.ROT90R()

For class Matrix_flt

{Matrix_flt} ret  =  object.ROT90R()

For class Matrix_int

{Matrix_int} ret  =  object.ROT90R()

For class Matrix_sht

{Matrix_sht} ret  =  object.ROT90R()

For class Matrix_uch

{Matrix_uch} ret  =  object.ROT90R()

For class Matrix_bln

{Matrix_bln} ret  =  object.ROT90R()

Example:

->A = [ 1 2 3; 4 5 6; 7 8 9]
->print A


no of row    : 3
no of column : 3

0:   1.00000   2.00000   3.00000
1:   4.00000   5.00000   6.00000
2:   7.00000   8.00000   9.00000


->B = A.rot90r()
->print B


no of row    : 3
no of column : 3

0:   7.00000   4.00000   1.00000
1:   8.00000   5.00000   2.00000
2:   9.00000   6.00000   3.00000


->

See also (class function)

rot180, rot90l, fliplr, flipud

| HOME | BACK |


ROUND

| HOME | BACK |

Purpose

To round all element values of a matrix.  Values whose decimal parts are larger than or equal to 0.5 will be round up.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{Matrix_int} ret  =  object.ROUND()

Example:

->a = [ 1.5 2.2 3; 4 5 6; 7.55 8.26 9.0]
->a

ans =

 no of row    : 3
 no of column : 3

 0:    1.50000    2.20000    3.00000
 1:    4.00000    5.00000    6.00000
 2:    7.55000    8.26000    9.00000

->b = a.round()
->b

ans =

 no of row    : 3
 no of column : 3

 0:    2    2    3
 1:    4    5    6
 2:    8    8    9

See also (class function)

fix

| HOME | BACK |


RREF

| HOME | BACK |

Purpose

To reduce to a Reduced row-echelon form matrix.

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{Matrix} ret  =  object.RREF()

Example:

->a = [ 1 2 3; 4 5 6; 7 8 9]
->b = a.rref()
->b

ans =

no of row    : 3
no of column : 3

0:    1.00000    0.00000   -1.00000
1:    0.00000    1.00000    2.00000
2:    0.00000    0.00000    0.00000



->

See also (class function)

rank, inv

| HOME | BACK |


RX

| HOME | BACK |

Purpose

To create a 3 by 3 rotation matrix of an rotation angle  about x-axis. 

The unit of rotation angles is the current unit set by command "set angle".  The structure of the matrix is as follows (a is an angle).

Rx(a) = | 1       0         0 |

        | 0    cos(a)   sin(a)|

        | 0   -sin(a)   cos(a)|

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{void} object.RX({double} argm1)

argm1 = rotation angle about x-axis 

Example:

->set angle "deg"
->A = Matrix()
->A.rx(20)
->print A


no of row    : 3
no of column : 3

0:   1.00000    0.00000    0.00000
1:   0.00000    0.93969    0.34202
2:   0.00000   -0.34202    0.93969


->

See also (class function)

ry, rz, rxyz

| HOME | BACK |


RXYZ

| HOME | BACK |

Purpose

To create a 3 by 3 rotation matrix,  such that Rxyz = Rz * Ry * Rx, where Rx, Ry, and Rz are rotation matrixs of an agle about x-axis, y-axis and z-axis respectively.

It is important to know that a different orders of  rotation angles give different rotation matrices.  Here the function Rxyz is created from first rotate about the x-axis, then the y-axis, and finally about the z-axis.

The unit of rotation angles is the current unit set by command "set angle".

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{void} object.RXYZ({double} argm1, {double} argm2, {double} argm3)

argm1 = rotation angle about x-axis 

argm2 = rotation angle about y-axis 

argm3 = rotation angle about z-axis 

Example:

->set angle "deg"
->A = Matrix()
->A.rxyz(10,20,30)
->print A


no of row    : 3
no of column : 3

0:   0.81380   0.54384  -0.20487
1:  -0.46985   0.82317   0.31880
2:   0.34202  -0.16318   0.92542


->

See also (class function)

rx, ry, rz

| HOME | BACK |


RY

| HOME | BACK |

Purpose

To create a 3 by 3 rotation matrix of an rotation angle  about y-axis. 

The unit of rotation angles is the current unit set by command "set angle".  The structure of the matrix is as follows (a is an angle).

Ry(a) = |cos(a)   0    -sin(a)|

        | 0       1        0  |

        |sin(a)   0     cos(a)|

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{void} object.RY({double} argm1)

argm1 = rotation angle about y-axis 

Example:

->set angle "deg"
->A = Matrix()
->A.ry(20)
->print A


no of row    : 3
no of column : 3

0:   0.93969   0.00000  -0.34202
1:   0.00000   1.00000   0.00000
2:   0.34202   0.00000   0.93969


->

See also (class function)

rx, rz, rxyz

| HOME | BACK |


RZ

| HOME | BACK |

Purpose

To create a 3 by 3 rotation matrix of an rotation angle  about z-axis. 

The unit of rotation angles is the current unit set by command "set angle".  The structure of the matrix is as follows (a is an angle).

Rz(a) = | cos(a)   sin(a)    0 |

        |-sin(a)   cos(a)    0 |

        |   0        0       1 |

Class

Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln

Usage

{void} object.RZ({double} argm1)

argm1 = rotation angle about z-axis 

Example:

->set angle "deg"
->A = Matrix()
->A.rz(20)
->print A


no of row    : 3
no of column : 3

0:   0.93969   0.34202   0.00000
1:  -0.34202   0.93969   0.00000
2:   0.00000   0.00000   1.00000


->

See also (class function)

rx, ry, rxyz

| HOME | BACK |