RSS

(root)/iphone/common : 61 : notes/notes.tex

To get this branch, use:
bzr branch /browse/iphone/common

« back to all changes in this revision

Viewing changes to notes/notes.tex

Dömötör Gulyás
2010-01-18 09:03:51
Revision ID: dognotdog@gmail.com-20100118080351-ib2knxvk4w8ssw3h
made common a nested tree

Show diffs side-by-side

added added

removed removed

1
 
\documentclass[12pt,a4paper,oneside,openany]{article}
2
 
\usepackage[squaren]{SIunits}
3
 
%% LaTeX Preamble - Common packages
4
 
%\usepackage[german]{babel}
5
 
\usepackage{setspace}
6
 
 
7
 
\usepackage[utf8]{inputenc} % Any characters can be typed directly from the keyboard, eg √©√ß√±
8
 
\usepackage{textcomp} % provide lots of new symbols
9
 
\usepackage{graphicx}  % Add graphics capabilities
10
 
\usepackage{flafter}  % Don't place floats before their definition
11
 
%\usepackage{topcapt}   % Define \topcaption for placing captions above tables (not in gwTeX)
12
 
\usepackage{natbib} % use author/date bibliographic citations
13
 
\usepackage{subfigure}
14
 
 
15
 
\usepackage{amsmath,amssymb}  % Better maths support & more symbols
16
 
\usepackage{bm}  % Define \bm{} to use bold math fonts
17
 
 
18
 
\usepackage[usenames,dvipsnames]{color} 
19
 
 
20
 
\usepackage[pdftex,bookmarks,colorlinks,breaklinks]{hyperref}  % PDF hyperlinks, with coloured links
21
 
%\definecolor{dullmagenta}{rgb}{0.4,0,0.4}   % #660066
22
 
%\definecolor{darkblue}{rgb}{0,0,0.4}
23
 
%\hypersetup{linkcolor=red,citecolor=blue,filecolor=blue,urlcolor=blue} % coloured links
24
 
\hypersetup{linkcolor=black,citecolor=black,filecolor=black,urlcolor=black} % black links, for print output
25
 
 
26
 
\usepackage{memhfixc}  % remove conflict between the memoir class & hyperref
27
 
% \usepackage[activate]{pdfcprot}  % Turn on margin kerning (not in gwTeX)
28
 
%\usepackage{pdfsync}  % enable tex source and pdf output syncronicity
29
 
 
30
 
\usepackage{listings}
31
 
\usepackage{nomencl}
32
 
 
33
 
\usepackage{anysize}
34
 
\marginsize{3cm}{3cm}{3cm}{3cm}
35
 
 
36
 
\onehalfspacing
37
 
 
38
 
\makenomenclature
39
 
\def\nomlabel#1{\textbf{#1}\hfil}
40
 
 
41
 
\newcommand{\Parameters}{\subsection*{Parameters}}
42
 
\newcommand{\ReturnValue}{\subsection*{Return Value}}
43
 
\newcommand{\Description}{\subsection*{Description}}
44
 
\newcommand{\ClassName}[1]{{\tt #1}}
45
 
\newcommand{\ReturnType}[1]{{\tt (#1)}}
46
 
\newcommand{\Function}[1]{{\tt #1()}}
47
 
\newcommand{\Self}{{\tt self}}
48
 
 
49
 
\newcommand{\ud}{\ensuremath{\mathrm{d}}}
50
 
\newcommand{\vx}{\ensuremath{\boldsymbol{x}}}
51
 
\newcommand{\vv}{\ensuremath{\boldsymbol{v}}}
52
 
\newcommand{\va}{\ensuremath{\boldsymbol{a}}}
53
 
\newcommand{\vf}{\ensuremath{\boldsymbol{f}}}
54
 
\newcommand{\mM}{\ensuremath{\boldsymbol{M}}}
55
 
\newcommand{\mW}{\ensuremath{\boldsymbol{W}}}
56
 
\newcommand{\mJ}{\ensuremath{\boldsymbol{J}}}
57
 
\newcommand{\vq}{\ensuremath{\boldsymbol{q}}}
58
 
\newcommand{\vC}{\ensuremath{\boldsymbol{C}}}
59
 
\newcommand{\vQ}{\ensuremath{\boldsymbol{Q}}}
60
 
\newcommand{\vlambda}{\ensuremath{\boldsymbol{\lambda}}}
61
 
\newcommand{\vd}{\ensuremath{\boldsymbol{d}}}
62
 
\newcommand{\mI}{\ensuremath{\boldsymbol{I}}}
63
 
\newcommand{\vc}{\ensuremath{\boldsymbol{c}}}
64
 
\newcommand{\vr}{\ensuremath{\boldsymbol{r}}}
65
 
\newcommand{\vF}{\ensuremath{\boldsymbol{F}}}
66
 
\newcommand{\vtau}{\ensuremath{\boldsymbol{\tau}}}
67
 
\newcommand{\valpha}{\ensuremath{\boldsymbol{\alpha}}}
68
 
 
69
 
\newtheorem{mydef}{Definition}
70
 
 
71
 
 
72
 
\lstset{numbers=left,basicstyle=\footnotesize,numberstyle=\tiny,tabsize=4,breaklines=true}
73
 
 
74
 
\long\def\symbolfootnote[#1]#2{\begingroup%
75
 
\def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
76
 
 
77
 
 
78
 
\begin{document}
79
 
 
80
 
\tableofcontents
81
 
 
82
 
\listoffigures
83
 
 
84
 
\section{Bezier}
85
 
 
86
 
\begin{eqnarray*}
87
 
P_{01} &=& P_0 \cdot (1-t) + P_1 \cdot t \\
88
 
P_{12} &=& P_1 \cdot (1-t) + P_2 \cdot t \\
89
 
P_{23} &=& P_2 \cdot (1-t) + P_3 \cdot t \\
90
 
P_{02} &=& P_{01} \cdot (1-t) + P_{12} \cdot t \\
91
 
  &=& \left( P_0 \cdot (1-t) + P_1 \cdot t \right) \cdot (1-t) + \left( P_1 \cdot (1-t) + P_2 \cdot t \right) \cdot t \\
92
 
  &=& P_0 \cdot \left( 1-t \right) ^2 + 2 \cdot P_1 \cdot t \cdot \left( 1-t \right) + P_2 \cdot t ^2 \\
93
 
P_{13}  &=& P_1 \cdot \left( 1-t \right) ^2 + 2 \cdot P_2 \cdot t \cdot \left( 1-t \right) + P_3 \cdot t ^2 \\
94
 
P(t) &=& P_{02} \cdot ( 1 -t ) + P_{13} \cdot t \\
95
 
 &=& ( 1 -t ) ^3 P_0 + 3 \cdot  t \cdot ( 1 -t ) ^2 P_1 + 3 \cdot  t^2 \cdot ( 1 -t ) P_2 + t ^3 P_3 \\
96
 
\frac{d}{dt}P(t) &=& - 3  (1-t)^2 P_0 + 3 \cdot \left( (1-t)^2 - 2t (1-t) \right) P_1\\
97
 
 && + 3 \left( 2t(1-t) - t^2\right) P_2  + 3 t^2 P_3 \\
98
 
 &=& - 3 (1-t)^2 P_0 + 3 \left( -4t +3t^2 \right) P_1 + 3 \left( 2t - 3 t^2\right) P_2 + 3 t^2 P_3 \\
99
 
\frac{d^2}{dt^2}P(t) &=& 6 (1-t) P_0 + 3 \left( -4 +6t \right) P_1 + 3 \left( 2 - 6 t\right) P_2 + 6 t P_3 \\
100
 
 &=& (6-6t) P_0 + \left( 18t - 12 \right) P_1 + \left( 6 - 18 t\right) P_2 + 6 t P_3 \\
101
 
 &=& 6\left( (1-t) P_0 + \left( 3t - 2 \right) P_1 + \left( 1 - 3 t\right) P_2 + t P_3 \right) \\
102
 
\kappa &=& \frac{x'y'' -y'x''}{(x'^2+y'^2)^{3/2}} \\
103
 
x'y'' &=& 6 \left( -3(1-t)^3 x_0y_0 + (3t-2)(9t^2-12t)x_1y_1\right. 
104
 
\end{eqnarray*}
105
 
 
106
 
\section{Pinch Zoom}
107
 
 
108
 
Zooming the canvas, the point exactly between the two fingers should stay between the two fingers. That point is $T$ in canvas space, and $T'$ in screen space. $T$ must remain stationary between two touches, in both screen and canvas space. The zoom center $Z$ is the point on which the screen is centered. It is $0,0$ in screen space.
109
 
 
110
 
$r = r - z$ is the offset of view center and pinch center in canvas space. In order for $t$ to remain stationary, $z_{c} = t - t\Delta f_z$. However, this doesn't account for the movement of $t'$ from one event to the next. $\Delta t' = t'_n - t'_{n-1}$, and $\Delta t =  f_z \cdot \Delta t'$. Therefore, to account for parallel motion, 
111
 
\begin{eqnarray*}
112
 
z_{c} &=& t - \Delta f_z \cdot r + \Delta t \\
113
 
z_{c} &=& t - \Delta f_z \cdot r + f_z \cdot (t'_n - t'_{n-1}) \\
114
 
\end{eqnarray*}
115
 
 
116
 
The same procedure can also be written in terms of coordinate system transforms. $M$ is the current canvas transformation, accounting for the zoom factor and the zoom center.
117
 
$$M_n = Z_n S_n Z_n^{-1}$$
118
 
What is know is that $$ M_n c = M_{n+1} c $$ where $c$ is the center of the pinch.
119
 
 
120
 
\begin{eqnarray*}
121
 
c_n' &=& z_n + f_{n} (c-z_n) \\
122
 
c_{n+1}' &=& z_{n+1} + f_{n+1} (c-z_{n+1}) \\
123
 
c_{n+1}' - c_n' &=& \Delta t' \\
124
 
\Delta t' &=& z_{n+1} + f_{n+1} (c-z_{n+1}) - z_n - f_{n} (c-z_n) \\
125
 
\Delta t' &=& (1 - f_{n+1} ) z_{n+1} + f_{n+1} c- z_n - f_{n} (c-z_n) \\
126
 
z_{n+1} &=& \frac {\Delta t' - f_{n+1} c + z_n + f_{n} (c-z_n)}{1 - f_{n+1}} \\
127
 
z_{n+1} &=& \frac {\Delta t' - f_{n+1} c + (1-f_n)z_n + f_{n} c}{1 - f_{n+1}} \\
128
 
z_{n+1} &=& \frac {\Delta t' + (f_n - f_{n+1}) c + (1-f_n)z_n}{1 - f_{n+1}} \\
129
 
z_{n+1} &=& \frac {\Delta t' + (f_n - s f_{n}) c + (1-f_n)z_n}{1 - s f_{n}} \\
130
 
z_{n+1} &=& \frac {\Delta t' + (1 - s) f_{n} c + (1-f_n)z_n}{1 - s f_{n}} \\
131
 
\end{eqnarray*}
132
 
 
133
 
 
134
 
%\printnomenclature
135
 
 
136
 
%\bibliographystyle{plaindin}
137
 
%\bibliography{simtools}
138
 
 
139
 
\end{document}
140
 
 

Loggerhead 1.17 is a web-based interface for Bazaar branches