-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGeometry.tex
58 lines (43 loc) · 2.07 KB
/
Geometry.tex
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
% ============================================= %
% %
% Geometry %
% %
% ============================================= %
\chapter{Geometry}
\chapterinfo{}
%------------------------------
\section{Line Intersection}
%\sectioninfo{}
The following programs are used to find the intersection between two lines
using parametric equations. The time solved through the system of parametric
equations is important depending on the lines. Some things to note are the
following:\\
\indent Line Segment : $t \ge 0 $ and $t \le 1$ \\
\indent Infinite Line : $t \in \Re$ \\
\indent Ray : $t \ge 0$ \\
\lstinputlisting[language=C++,label=samplecode,caption=Line Intersection (C++)]{Code/LineIntersection.txt}
%------------------------------
\section{Point/Vector Class}
%\sectioninfo{}
\lstinputlisting[language=Java,label=samplecode,caption=Point/Vector Class (Java)]{Code/PointVector.txt}
%------------------------------
\section{Circle Class}
%\sectioninfo{}
\lstinputlisting[language=Java,label=samplecode,caption=Circle Class (Java)]{Code/Circle.txt}
%------------------------------
\section{Minimum Enclosing Circle Algorithm}
%\sectioninfo{}
\lstinputlisting[language=Java,label=samplecode,caption=Minimum Enclosing Circle (Java)]{Code/MinimumEnclosingCircle.txt}
%------------------------------
\section{Andrew's Algorithm (Convex Hull)}
%\sectioninfo{}
\lstinputlisting[language=Java,label=samplecode,caption=Convex Hull (Java)]{Code/ConvexHull.txt}
%------------------------------
\section{Longitude and Latitude}
%\sectioninfo{}
{\bf Problem} : What is the spherical/geographical distance between two cities $p$
and $q$ on earth with radius $r$, denoted by $(p\_lat,p\_long)$ to $(q\_lat,q\_long)$.
All coordinates are in radians. (i.e. convert $[-180..180]$ range of longitude
and $[-90..90]$ range of latitudes to $[-\pi..\pi]$ respectively.
\lstinputlisting[language=Java,label=samplecode,caption=Latitude and Longitude Conversion (Java)]{Code/LongitudeLatitude.txt}
%------------------------------