Linear Transformation
Use the matrix to find four types of the linear transformation of
Calculation
1.Symmetric transformation to x-axis (Case 1)
(X'Y') = (10
2.Symmetric transformation to y-axis (Case 2)
(X'Y') =
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 | |
(Y') = (sin B | cos B ) ( Y ) |
FLOWCHART |
| PROGRAMME LIST |
|
| (MATRIX MODE) |
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
| |
|
|
|
|
|
|
| |
Label XSYMMETRY |
|
| Label YSYMMETRY |
| |||
|
|
|
|
|
| ||
Transformation data set |
|
| Transformation data set |
| |||
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Label SIMRATIO |
|
| Label ROTATE |
| |||
|
|
|
|
|
| ||
Entry of ratio of similitude |
|
| Entry of angle |
| |||
|
|
|
|
| |||
Data set of transformation |
|
| Data set of transformation |
|
Coordinate transformation
Display of coordinates after transformation
End
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
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) =
Matrix H multiplied by matrix D.
Coordinates displayed.
Title : LINE TRNS
{2, 2} dim(mat H) {2, 1} dim(mat D) {2, 1} dim(mat A) Print "Input POINT Input X
Input Y
Xmat D(1, 1)
Ymat 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)
0 mat H(2, 1)
0 mat H(1, 2)
1 mat H(2, 2) Goto TRANS Label SIMRATIO
Print "Input SIMILITUDE RATIO Input R
RK
Kmat 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
AB
cos B mat H(1, 1) sin B mat H(2, 1)
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