THE FINAL COUNTDOWN
[ipdf/sam.git] / notes.nb
1 (* Content-type: application/vnd.wolfram.mathematica *)
2
3 (*** Wolfram Notebook File ***)
4 (* http://www.wolfram.com/nb *)
5
6 (* CreatedBy='Mathematica 9.0' *)
7
8 (*CacheID: 234*)
9 (* Internal cache information:
10 NotebookFileLineBreakTest
11 NotebookFileLineBreakTest
12 NotebookDataPosition[       157,          7]
13 NotebookDataLength[      8384,        285]
14 NotebookOptionsPosition[      7404,        248]
15 NotebookOutlinePosition[      7739,        263]
16 CellTagsIndexPosition[      7696,        260]
17 WindowFrame->Normal*)
18
19 (* Beginning of Notebook Content *)
20 Notebook[{
21 Cell[TextData[{
22  "The view \[OpenCurlyDoubleQuote]scale about point\[CloseCurlyDoubleQuote] \
23 transformation\nmx, my is mouse coordinates ",
24  StyleBox["relative to the view",
25   FontSlant->"Italic"],
26  "\nx, y, w, h are current view coordinates ",
27  StyleBox["relative to the document",
28   FontSlant->"Italic"],
29  "\nX, Y, W, H are transformed coordinates\nThis operation cannot be \
30 represented as a 2D matrix operation..."
31 }], "Text",
32  CellChangeTimes->{{3.621645547391625*^9, 3.621645590446886*^9}, {
33   3.621645788609687*^9, 3.621645803583606*^9}}],
34
35 Cell[BoxData[{
36  RowBox[{
37   RowBox[{"vx", " ", "=", " ", 
38    RowBox[{
39     RowBox[{"w", " ", "*", "mx"}], " ", "+", " ", "x"}]}], 
40   ";"}], "\[IndentingNewLine]", 
41  RowBox[{
42   RowBox[{"vy", " ", "=", " ", 
43    RowBox[{
44     RowBox[{"h", " ", "*", " ", "my"}], " ", "+", " ", "y"}]}], 
45   ";"}], "\[IndentingNewLine]", 
46  RowBox[{
47   RowBox[{"top", " ", "=", " ", 
48    RowBox[{"vy", " ", "-", " ", "y"}]}], ";"}], "\[IndentingNewLine]", 
49  RowBox[{
50   RowBox[{"left", " ", "=", " ", 
51    RowBox[{"vx", " ", "-", " ", "x"}]}], ";"}], "\[IndentingNewLine]", 
52  RowBox[{
53   RowBox[{"top", " ", "=", " ", 
54    RowBox[{"top", "*", "s"}]}], ";"}], "\[IndentingNewLine]", 
55  RowBox[{
56   RowBox[{"left", " ", "=", " ", 
57    RowBox[{"left", " ", "*", " ", "s"}]}], ";"}], "\[IndentingNewLine]", 
58  RowBox[{
59   RowBox[{"X", " ", "=", " ", 
60    RowBox[{"vx", " ", "-", " ", "left"}]}], ";"}], "\[IndentingNewLine]", 
61  RowBox[{
62   RowBox[{"Y", " ", "=", " ", 
63    RowBox[{"vy", " ", "-", " ", "top"}]}], ";"}], "\[IndentingNewLine]", 
64  RowBox[{
65   RowBox[{"W", " ", "=", " ", 
66    RowBox[{"w", "*", "s"}]}], ";"}], "\[IndentingNewLine]", 
67  RowBox[{
68   RowBox[{"H", " ", "=", " ", 
69    RowBox[{"h", "*", "s"}]}], ";"}]}], "Input",
70  CellChangeTimes->{{3.621644450038117*^9, 3.621644517724819*^9}, {
71   3.6216455001839314`*^9, 3.6216455061448193`*^9}}],
72
73 Cell[CellGroupData[{
74
75 Cell[BoxData[
76  RowBox[{"xy1", " ", "=", " ", 
77   RowBox[{"{", 
78    RowBox[{
79     RowBox[{"{", 
80      RowBox[{"x", ",", "y"}], "}"}], ",", 
81     RowBox[{"{", 
82      RowBox[{"x", "+", "w"}], "}"}], ",", 
83     RowBox[{"{", 
84      RowBox[{"y", "+", "h"}], "}"}]}], "}"}]}]], "Input",
85  CellChangeTimes->{{3.621645646537537*^9, 3.621645677183116*^9}}],
86
87 Cell[BoxData[
88  RowBox[{"{", 
89   RowBox[{
90    RowBox[{"{", 
91     RowBox[{"x", ",", "y"}], "}"}], ",", 
92    RowBox[{"{", 
93     RowBox[{"w", "+", "x"}], "}"}], ",", 
94    RowBox[{"{", 
95     RowBox[{"h", "+", "y"}], "}"}]}], "}"}]], "Output",
96  CellChangeTimes->{3.62164567753369*^9}]
97 }, Open  ]],
98
99 Cell[CellGroupData[{
100
101 Cell[BoxData[
102  RowBox[{"xy2", " ", "=", " ", 
103   RowBox[{"FullSimplify", "[", 
104    RowBox[{"{", 
105     RowBox[{"X", ",", " ", "Y", ",", " ", 
106      RowBox[{"X", "+", "W"}], ",", " ", 
107      RowBox[{"Y", "+", "H"}]}], "}"}], "]"}]}]], "Input",
108  CellChangeTimes->{{3.62164452159755*^9, 3.621644525242661*^9}, {
109   3.621645606946629*^9, 3.621645623731018*^9}, {3.6216456891302*^9, 
110   3.621645689867572*^9}}],
111
112 Cell[BoxData[
113  RowBox[{"{", 
114   RowBox[{
115    RowBox[{
116     RowBox[{"mx", " ", 
117      RowBox[{"(", 
118       RowBox[{"w", "-", 
119        RowBox[{"s", " ", "w"}]}], ")"}]}], "+", "x"}], ",", 
120    RowBox[{
121     RowBox[{"h", " ", 
122      RowBox[{"(", 
123       RowBox[{"my", "-", 
124        RowBox[{"my", " ", "s"}]}], ")"}]}], "+", "y"}], ",", 
125    RowBox[{
126     RowBox[{
127      RowBox[{"(", 
128       RowBox[{"mx", "+", "s", "-", 
129        RowBox[{"mx", " ", "s"}]}], ")"}], " ", "w"}], "+", "x"}], ",", 
130    RowBox[{
131     RowBox[{"h", " ", 
132      RowBox[{"(", 
133       RowBox[{"my", "+", "s", "-", 
134        RowBox[{"my", " ", "s"}]}], ")"}]}], "+", "y"}]}], "}"}]], "Output",
135  CellChangeTimes->{
136   3.621644525784692*^9, {3.621645598921043*^9, 3.62164562472651*^9}, {
137    3.621645679592589*^9, 3.6216456913785887`*^9}}]
138 }, Open  ]],
139
140 Cell[CellGroupData[{
141
142 Cell[BoxData[
143  RowBox[{"xywh2", " ", "=", " ", 
144   RowBox[{"FullSimplify", "[", 
145    RowBox[{"{", 
146     RowBox[{"X", ",", " ", "Y", ",", " ", "W", ",", "H"}], "}"}], 
147    "]"}]}]], "Input",
148  CellChangeTimes->{{3.621645929284232*^9, 3.621645939176342*^9}}],
149
150 Cell[BoxData[
151  RowBox[{"{", 
152   RowBox[{
153    RowBox[{
154     RowBox[{"mx", " ", 
155      RowBox[{"(", 
156       RowBox[{"w", "-", 
157        RowBox[{"s", " ", "w"}]}], ")"}]}], "+", "x"}], ",", 
158    RowBox[{
159     RowBox[{"h", " ", 
160      RowBox[{"(", 
161       RowBox[{"my", "-", 
162        RowBox[{"my", " ", "s"}]}], ")"}]}], "+", "y"}], ",", 
163    RowBox[{"s", " ", "w"}], ",", 
164    RowBox[{"h", " ", "s"}]}], "}"}]], "Output",
165  CellChangeTimes->{3.621645939693961*^9}]
166 }, Open  ]],
167
168 Cell[TextData[{
169  "For primitives in document,\nV X \[Rule] V X + S[V X - ",
170  Cell[BoxData[
171   FormBox[
172    RowBox[{
173     SubscriptBox["X", "0"], "]"}], TraditionalForm]],
174   FormatType->"TraditionalForm"],
175  "\nV is view matrix, S is scale matrix"
176 }], "Text",
177  CellChangeTimes->{{3.62164641213169*^9, 3.62164647339319*^9}}],
178
179 Cell[BoxData[
180  RowBox[{
181   RowBox[{"(*", 
182    RowBox[{"TODO", ":", " ", 
183     RowBox[{"Express", " ", "as", " ", "a", " ", "matrix", " ", 
184      RowBox[{"operation", "?"}]}]}], "*)"}], "\[IndentingNewLine]"}]], "Input",\
185
186  CellChangeTimes->{{3.6216459415176992`*^9, 3.621645948934423*^9}, {
187   3.6216463980527067`*^9, 3.6216464053607597`*^9}}],
188
189 Cell[BoxData[
190  RowBox[{"ClearAll", "[", 
191   RowBox[{"Evaluate", "[", 
192    RowBox[{
193     RowBox[{"Context", "[", "]"}], "<>", "\"\<*\>\""}], "]"}], "]"}]], "Input"],
194
195 Cell["Floating point operations", "Text",
196  CellChangeTimes->{{3.621665522093079*^9, 3.6216655239496813`*^9}}],
197
198 Cell[BoxData[
199  RowBox[{"FullSimplify", "[", 
200   RowBox[{"m1", " ", 
201    SuperscriptBox["B", "e1"], " ", "*", " ", "m2", " ", 
202    SuperscriptBox["B", "e2"]}], "]"}]], "Input",
203  CellChangeTimes->{{3.621665107840431*^9, 3.6216651376842957`*^9}}],
204
205 Cell[BoxData[
206  RowBox[{
207   SuperscriptBox["B", 
208    RowBox[{"e1", "+", "e2"}]], " ", "m1", " ", "m2"}]], "Input",
209  CellChangeTimes->{{3.62166519824517*^9, 3.62166520820506*^9}}],
210
211 Cell[BoxData[
212  RowBox[{
213   SuperscriptBox["B", 
214    RowBox[{"e1", "+", "e2"}]], " ", "m1", " ", "m2"}]], "Output",
215  CellChangeTimes->{{3.621665204836622*^9, 3.621665208534109*^9}}],
216
217 Cell[CellGroupData[{
218
219 Cell[BoxData[
220  RowBox[{"FullSimplify", "[", 
221   RowBox[{"Solve", "[", 
222    RowBox[{
223     RowBox[{
224      RowBox[{
225       RowBox[{"m1", " ", 
226        SuperscriptBox["B", "e1"]}], " ", "+", " ", 
227       RowBox[{"m2", " ", 
228        SuperscriptBox["B", "e2"]}]}], " ", "\[Equal]", " ", 
229      RowBox[{"m3", " ", 
230       SuperscriptBox["B", "e1"]}]}], ",", " ", "m3"}], "]"}], "]"}]], "Input",\
231
232  CellChangeTimes->{
233   3.621665148857037*^9, {3.621665392367518*^9, 3.62166542126152*^9}}],
234
235 Cell[BoxData[
236  RowBox[{"{", 
237   RowBox[{"{", 
238    RowBox[{"m3", "\[Rule]", 
239     RowBox[{"m1", "+", 
240      RowBox[{
241       SuperscriptBox["B", 
242        RowBox[{
243         RowBox[{"-", "e1"}], "+", "e2"}]], " ", "m2"}]}]}], "}"}], 
244   "}"}]], "Output",
245  CellChangeTimes->{
246   3.621665149470646*^9, {3.621665400108696*^9, 3.621665421774309*^9}}]
247 }, Open  ]]
248 },
249 WindowSize->{740, 575},
250 WindowMargins->{{Automatic, 79}, {Automatic, 0}},
251 FrontEndVersion->"9.0 for Linux x86 (64-bit) (February 7, 2013)",
252 StyleDefinitions->"Default.nb"
253 ]
254 (* End of Notebook Content *)
255
256 (* Internal cache information *)
257 (*CellTagsOutline
258 CellTagsIndex->{}
259 *)
260 (*CellTagsIndex
261 CellTagsIndex->{}
262 *)
263 (*NotebookFileOutline
264 Notebook[{
265 Cell[557, 20, 546, 12, 110, "Text"],
266 Cell[1106, 34, 1309, 36, 231, "Input"],
267 Cell[CellGroupData[{
268 Cell[2440, 74, 337, 10, 32, "Input"],
269 Cell[2780, 86, 271, 9, 32, "Output"]
270 }, Open  ]],
271 Cell[CellGroupData[{
272 Cell[3088, 100, 397, 9, 32, "Input"],
273 Cell[3488, 111, 782, 25, 32, "Output"]
274 }, Open  ]],
275 Cell[CellGroupData[{
276 Cell[4307, 141, 251, 6, 32, "Input"],
277 Cell[4561, 149, 446, 15, 32, "Output"]
278 }, Open  ]],
279 Cell[5022, 167, 318, 9, 71, "Text"],
280 Cell[5343, 178, 338, 8, 55, "Input"],
281 Cell[5684, 188, 160, 4, 32, "Input"],
282 Cell[5847, 194, 109, 1, 30, "Text"],
283 Cell[5959, 197, 240, 5, 35, "Input"],
284 Cell[6202, 204, 175, 4, 32, "Input"],
285 Cell[6380, 210, 178, 4, 32, "Output"],
286 Cell[CellGroupData[{
287 Cell[6583, 218, 469, 14, 35, "Input"],
288 Cell[7055, 234, 333, 11, 35, "Output"]
289 }, Open  ]]
290 }
291 ]
292 *)
293
294 (* End of internal cache information *)

UCC git Repository :: git.ucc.asn.au