-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstruct.max
101 lines (72 loc) · 4.63 KB
/
construct.max
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
x:1;
y:1;
z:1;
eqns : [ (a41+1)*x= a41*x + a42*y + a43*z + 1,
(a42+1)*y= a41*x + a42*y + a43*z + 1,
(a43+1)*z= a41*x + a42*y + a43*z + 1 ];
solve( eqns,[a41,a42,a43] );
a41= (z+y-x-1)/(2*x),
a42= (z-y+x-1)/(2*y),
a43=-(z-y-x+1)/(2*z)
eqns : [ (a41+a44)*x= a41*x + a42*y + a43*z + a44,
(a42+a44)*y= a41*x + a42*y + a43*z + a44,
(a43+a44)*z= a41*x + a42*y + a43*z + a44 ];
solve( eqns,[a41,a42,a43,a44] );
-----
A: matrix (
[ a_x1, a_y1, 1, 0 , 0, 0, -a_x1 * b_x1 , -a_y1 * b_x1, - b_x1 ],
[ a_x2, a_y2, 1, 0 , 0, 0, -a_x2 * b_x2 , -a_y2 * b_x2, - b_x2 ],
[ a_x3, a_y3, 1, 0 , 0, 0, -a_x3 * b_x3 , -a_y3 * b_x3, - b_x3 ],
[ a_x4, a_y4, 1, 0 , 0, 0, -a_x4 * b_x4 , -a_y4 * b_x4, - b_x4 ],
[ 0, 0, 0, a_x1 , a_y1, 1, -a_x1 * b_y1 , -a_y1 * b_y1, - b_y1 ],
[ 0, 0, 0, a_x2 , a_y2, 1, -a_x2 * b_y2 , -a_y2 * b_y2, - b_y2 ],
[ 0, 0, 0, a_x3 , a_y3, 1, -a_x3 * b_y3 , -a_y3 * b_y3, - b_y3 ],
[ 0, 0, 0, a_x4 , a_y4, 1, -a_x4 * b_y4 , -a_y4 * b_y4, - b_y4 ]
);
transpose( A ). A;
-----
eqns : [ a02/1=0,
a12/1=0,
(a00+a02)/(a20+1) = 1,
(a10+a12)/(a20+1) = 0,
(a01+a02)/(a21+1) = 0,
(a11+a12)/(a21+1) = 1,
(a00+a01+a02)/(a20+a21+1) = b3x,
(a10+a11+a12)/(a20+a21+1) = b3y
];
solve( eqns,[a00,a01,a02, a10,a11,a12, a20,a21 ] );
---
eqns : [ a02/1=b0x,
a12/1=b0y,
(a00+a02)/(a20+1) = b1x,
(a10+a12)/(a20+1) = b1y,
(a01+a02)/(a21+1) = b2x,
(a11+a12)/(a21+1) = b2y,
(a00+a01+a02)/(a20+a21+1) = b3x,
(a10+a11+a12)/(a20+a21+1) = b3y
];
solve( eqns,[a00,a01,a02, a10,a11,a12, a20,a21 ] );
---
eqns : [
a_x1 * h_11 + a_y1 * h_12 + 1 * h_13 + 0 * h_21 + 0 * h_22 + 0 * h_23 + ( -a_x1 * b_x1 ) * h_31 + ( -a_y1 * b_x1 ) * h_32 + ( - b_x1 ) * 1 = 0,
0 * h_11 + 0 * h_12 + 0 * h_13 + a_x1 * h_21 + a_y1 * h_22 + 1 * h_23 + ( -a_x1 * b_y1 ) * h_31 + ( -a_y1 * b_y1 ) * h_32 + ( - b_y1 ) * 1 = 0,
a_x2 * h_11 + a_y2 * h_12 + 1 * h_13 + 0 * h_21 + 0 * h_22 + 0 * h_23 + ( -a_x2 * b_x2 ) * h_31 + ( -a_y2 * b_x2 ) * h_32 + ( - b_x2 ) * 1 = 0,
0 * h_11 + 0 * h_12 + 0 * h_13 + a_x2 * h_21 + a_y2 * h_22 + 1 * h_23 + ( -a_x2 * b_y2 ) * h_31 + ( -a_y2 * b_y2 ) * h_32 + ( - b_y2 ) * 1 = 0,
a_x3 * h_11 + a_y3 * h_12 + 1 * h_13 + 0 * h_21 + 0 * h_22 + 0 * h_23 + ( -a_x3 * b_x3 ) * h_31 + ( -a_y3 * b_x3 ) * h_32 + ( - b_x3 ) * 1 = 0,
0 * h_11 + 0 * h_12 + 0 * h_13 + a_x3 * h_21 + a_y3 * h_22 + 1 * h_23 + ( -a_x3 * b_y3 ) * h_31 + ( -a_y3 * b_y3 ) * h_32 + ( - b_y3 ) * 1 = 0,
a_x4 * h_11 + a_y4 * h_12 + 1 * h_13 + 0 * h_21 + 0 * h_22 + 0 * h_23 + ( -a_x4 * b_x4 ) * h_31 + ( -a_y4 * b_x4 ) * h_32 + ( - b_x4 ) * 1 = 0,
0 * h_11 + 0 * h_12 + 0 * h_13 + a_x4 * h_21 + a_y4 * h_22 + 1 * h_23 + ( -a_x4 * b_y4 ) * h_31 + ( -a_y4 * b_y4 ) * h_32 + ( - b_y4 ) * 1 = 0
];
solve( eqns,[ h_11, h_12, h_13, h_21, h_22, h_23, h_31, h_32 ] );
---
eqns : [
a_x1 * h_11 + a_y1 * h_12 + 1 * h_13 + 0 * h_21 + 0 * h_22 + 0 * h_23 + ( -a_x1 * b_x1 ) * h_31 + ( -a_y1 * b_x1 ) * h_32 + ( - b_x1 ) * h_33 = 0,
0 * h_11 + 0 * h_12 + 0 * h_13 + a_x1 * h_21 + a_y1 * h_22 + 1 * h_23 + ( -a_x1 * b_y1 ) * h_31 + ( -a_y1 * b_y1 ) * h_32 + ( - b_y1 ) * h_33 = 0,
a_x2 * h_11 + a_y2 * h_12 + 1 * h_13 + 0 * h_21 + 0 * h_22 + 0 * h_23 + ( -a_x2 * b_x2 ) * h_31 + ( -a_y2 * b_x2 ) * h_32 + ( - b_x2 ) * h_33 = 0,
0 * h_11 + 0 * h_12 + 0 * h_13 + a_x2 * h_21 + a_y2 * h_22 + 1 * h_23 + ( -a_x2 * b_y2 ) * h_31 + ( -a_y2 * b_y2 ) * h_32 + ( - b_y2 ) * h_33 = 0,
a_x3 * h_11 + a_y3 * h_12 + 1 * h_13 + 0 * h_21 + 0 * h_22 + 0 * h_23 + ( -a_x3 * b_x3 ) * h_31 + ( -a_y3 * b_x3 ) * h_32 + ( - b_x3 ) * h_33 = 0,
0 * h_11 + 0 * h_12 + 0 * h_13 + a_x3 * h_21 + a_y3 * h_22 + 1 * h_23 + ( -a_x3 * b_y3 ) * h_31 + ( -a_y3 * b_y3 ) * h_32 + ( - b_y3 ) * h_33 = 0,
a_x4 * h_11 + a_y4 * h_12 + 1 * h_13 + 0 * h_21 + 0 * h_22 + 0 * h_23 + ( -a_x4 * b_x4 ) * h_31 + ( -a_y4 * b_x4 ) * h_32 + ( - b_x4 ) * h_33 = 0,
0 * h_11 + 0 * h_12 + 0 * h_13 + a_x4 * h_21 + a_y4 * h_22 + 1 * h_23 + ( -a_x4 * b_y4 ) * h_31 + ( -a_y4 * b_y4 ) * h_32 + ( - b_y4 ) * h_33 = 0
];
solve( eqns,[ h_11, h_12, h_13, h_21, h_22, h_23, h_31, h_32, h_33 ] );