Merge pull request #17 from openwfm/restructure
[notebooks.git] / ros / ellipse-nb.tex
blob306063be12cae4ea8358d24534516ade2b958b5e
1 \documentclass{article}
2 \usepackage{ametsoc}
3 \usepackage{amsfonts}
4 \usepackage{amssymb}
5 \usepackage{graphicx}
6 \bibliographystyle{ametsoc}
7 \begin{document}
8 Write the equation of an ellipse with horizontal axis $a$ and vertical axis
9 $b$ in parametric form
11 \left[
12 \begin{array}
13 [c]{c}
14 x\\
16 \end{array}
17 \right] =\left[
18 \begin{array}
19 [c]{c}
20 a\cos s\\
21 b\sin s
22 \end{array}
23 \right] .
25 Rotate by the angle $\theta\in(-\pi,\pi]$ clockwise:
27 \left[
28 \begin{array}
29 [c]{c}
30 x\\
32 \end{array}
33 \right] =\left[
34 \begin{array}
35 [c]{cc}
36 \cos\theta & \sin\theta\\
37 -\sin\theta & \cos\theta
38 \end{array}
39 \right] \left[
40 \begin{array}
41 [c]{c}
42 a\cos s\\
43 b\sin s
44 \end{array}
45 \right] .
47 Multiplying out we get
49 \left[
50 \begin{array}
51 [c]{c}
52 x\\
54 \end{array}
55 \right] =\left[
56 \begin{array}
57 [c]{c}
58 a\cos\theta\cos s+b\sin\theta\sin s\\
59 -a\sin\theta\cos s+b\cos\theta\sin s
60 \end{array}
61 \right] .
63 Move the center vertically so that the point at distance $c$ from the bottom
64 vertex on the $b$ axis is at $y=0$,
66 \left[
67 \begin{array}
68 [c]{c}
69 x\\
71 \end{array}
72 \right] =\left[
73 \begin{array}
74 [c]{c}
75 a\cos\theta\cos s+b\sin\theta\sin s\\
76 -a\sin\theta\cos s+b\cos\theta\sin s+(b-c)\cos\theta
77 \end{array}
78 \right]
80 This is the equation of the ellipse from the figure. The rate of spread in the
81 direction of the normal equivalent to the ellipse is the distance of the
82 horizontal lines at $y=0$ and tangent to the top of the rotated shifted
83 ellipse
85 R=\max_{s}-a\sin\theta\cos s+b\cos\theta\sin s+(b-c)\cos\theta
87 The find the highest point, set
89 y^{\prime}\left( s\right) =\frac{\partial}{\partial s}\left( -a\sin
90 \theta\cos s+b\cos\theta\sin s+(b-c)\cos\theta\right) =0
92 which gives
94 a\sin\theta\sin s+b\cos\theta\cos s=0
96 We can either divide by $\sin\theta\neq0$,
98 \frac{\sin s}{\cos s}+\frac{b}{a}\frac{\cos\theta}{\sin\theta}=0,
100 and compute $s$ from
102 s=-\arctan\left( \frac{b\cos\theta}{a\sin\theta}\right)
104 Using the arctan2 function in numpy
106 s=-\mathop{arctan2}\left( b\cos\theta,a\sin\theta\right)
108 gives the correct result even for $\sin\theta=0.$ In any case, we get two solutions, $s$
109 and $s+\pi$, substitute in the equation of the ellipse
111 y=-a\sin\theta\cos s+b\cos\theta\sin s+\left( b-c\right) \cos\theta
113 and take the larger value:
115 R=\max\left\{ u,-u\right\} +c\cos\theta,\quad u=-a\sin\theta\cos
116 s+b\cos\theta\sin s.
120 \nocite{Mandel-2009-DAW}
121 \bibliography{
122 /Users/jmandel/daseminar/references/bigdata.bib,
123 /Users/jmandel/daseminar/references/by_Aime.bib,
124 /Users/jmandel/daseminar/references/epi.bib,
125 /Users/jmandel/daseminar/references/extra.bib,
126 /Users/jmandel/daseminar/references/geo.bib,
127 /Users/jmandel/daseminar/references/jm.bib,
128 /Users/jmandel/daseminar/references/ml.bib,
129 /Users/jmandel/daseminar/references/other.bib,
130 /Users/jmandel/daseminar/references/quad-jm.bib,
131 /Users/jmandel/daseminar/references/slides.bib,
132 /Users/jmandel/daseminar/references/spdes.bib
135 \end{document}