Linear Transformation
Use the matrix to find four types of the linear transformation of
Calculation
1.Symmetric transformation to
(X'Y') = ( 10 -01) ( XY)
2.Symmetric transformation to
( X'Y') = ( -01 01 ) ( XY)
3.Similar transformation with ratio of similitude K around origin (Case 3)
(X'Y') = (K0 K0 ) ( XY )
4.Transformation revolving around only angle B at the origin (Case 4)
( X') = ( cos B | X) | ||
Y' | sin B | cos B | Y |
FLOWCHART |
| PROGRAMME LIST |
| Title : LINE TRN |
Start
Array declaration
Entry of coordinates (X,Y)
TYPE
Entry of type
s = 1 | Y |
| To label XSYMMETRY | |
| ||||
|
| |||
| N | Y |
|
|
s = 2 |
| To label YSYMMETRY | ||
|
| |||
| N | Y |
|
|
s = 3 |
| To label SYMRATIO | ||
|
| |||
| N | Y |
|
|
s = 4 |
| To label ROTATE | ||
|
| |||
| N |
|
|
|
|
|
|
| |
|
|
|
|
Declare array size, etc. matH(2,2), matD(2,1), matA(2,1)
Enter coordinates before transformation.
Type of transformation specified with no from 1 to 4.
Jumps to destination corresponding to entered number.
XSYMMETRY
Data set of
YSYMMETRY
{2, 2} dim(mat H) {2, 1} dim(mat D) {2, 1} dim(mat A) Print "Input POINT Input X
Input Y
X | mat D(1, 1) |
Y | mat D(2, 1) |
Label TYPE | |
Print "SELECT 1, 2, 3, 4 | |
Input S | |
ClrT | |
If S=1 Goto XSYMMETRY | |
If S=2 Goto YSYMMETRY | |
If S=3 Goto SIMRATIO | |
If S=4 Goto ROTATE | |
GotoTYPE | |
Label XSYMMETRY | |
1 | mat H(1, 1) |
0 | mat H(2, 1) |
0 | mat H(1, 2) |
mat H(2, 2) | |
Goto TRANS | |
Label YSYMMETRY | |
mat H(1, 1) | |
0 | mat H(2, 1) |
0 | mat H(1, 2) |
Label XSYMMETRY
Transformation data set
Label SIMRATIO
Entry of ratio of similitude
Data set of transformation
Label YSYMMETRY
Transformation data set
Label ROTATE
Entry of angle
Data set of transformation
Data set of
SIMRATIO
Data set of similar transformation Entry of ratio of similitude (R)
matH(1,1) = K, matH(1,2) = 0, matH(2,1) = 0, matH(2,2) = θ
Data set of transformation by revolving Entry of angle (A)
matH(1,1) = cos B, matH(2,1) = sin B, matH(1,2) =
1 | mat H(2, 2) |
Goto TRANS | |
Label SIMRATIO | |
Print "Input SIMILITUDE RATIO | |
Input R | |
R | K |
K | mat H(1, 1) |
0 | mat H(2, 1) |
0 | mat H(1, 2) |
θ | mat H(2, 2) |
Goto TRANS | |
Label ROTATE | |
Print "Input ANGLE | |
Input A | |
A | B |
cos B mat H(1, 1) | |
sin B mat H(2, 1) | |
Coordinate transformation
Display of coordinates after transformation
End
Matrix H multiplied by matrix D.
Coordinates displayed.
cos B mat H(2, 2) |
Label TRANS |
mat Hmat D mat A Print "mat A(1, 1) Print mat A(1, 1) Print "mat A(2, 1) Print mat A(2, 1)
End
14