Analytic Geometry in 3D
An Introduction to 3D Shapes
Prof. David Bernstein
James Madison University
Computer Science Department
bernstdh@jmu.edu
Points
In Cartesian Space:
A point in \mathbb{R}^{3} is an ordered triple
of numbers (called coordinates)
In Homogeneous Space:
A point is specified using four coordinates
Points (cont.)
From Cartesian to Homogeneous:
The Cartesian point (x,y,z) \in \mathbb{R}^{3}
becomes (x,y,z,1)
The Cartesian point (x,y) \in \mathbb{R}^{2}
becomes (x,y,0,1)
From Homogeneous to Cartesian:
The homogeneous point (x,y,z,w)
becomes the Cartesian point (x/w,y/w,z/w)if w is nonzero
Points (cont.)
Homogeneous Points without a Corresponding Cartesian Point:
When w = 0 the point is often said to be
"at infinity"
Limits:
Consider the sequence of points (1,2,0,1.000),
(1,2,0,0.100),(1,2,0,0.010),
(1,2,0,0.001),...
This sequence corresponds to the sequence of Cartesian
points (1,2,0),
(10,20,0),(100,200,0),
(1000,2000,0),...
This is a sequence of points along the line
y = 2x
Lines
Implicit Form:
A point and a perpendicular is not specific enough
Visualization:
Lines (cont.)
Parametric Form:
Given \bs{p} \in \mathbb{R}^{3} and
\bs{v} \in \mathbb{R}^{3},
the parametric form of a line is the set of points
given by \bs{p} + \lambda \bs{v}
Using Two Points:
As in 2D, we can use \bs{v} = \bs{q} - \bs{p}
for the line between \bs{p} and
\bs{q}
Lines (cont)
In 2D:
Two lines either intersect or are parallel
In 3D:
Can be skew (i.e., neither intersect nor are parallel)
Finding the itersection involves the solution of
a linear system with two equations and three unknowns
Planes
Definition:
Given a point \bs{p} \in \mathbb{R}^{3} and a
direction vector
\bs{n} \in \mathbb{R}^{3}
through \bs{p}, the set of
points x \in \mathbb{R}^{3} satisfying
\bs{n} \cdot (\bs{x} - \bs{p}) = 0
is called the plane
defined by \bs{p} and \bs{n}
Terminology:
This is called the implicit form of the plane
If || \bs{n} || = 1 then \bs{n} is called
the normal to the plane
Planes (cont.)
Parametric Form:
Given a point \bs{p} \in \mathbb{R}^{3} and
two direction vectors \bs{v} \mbox{ and }
\bs{w}, the parametric form of a plane is given by
\bs{p} + \lambda \bs{v} + \mu \bs{w}
Using Three Points:
Set \bs{v} = \bs{q} - \bs{p}
and \bs{w} = \bs{r} - \bs{p}
Planar Shapes
Triangles:
Are planar (i.e., lie in a single plane)
Other Shapes:
Shapes formed from four or more vertices may not
be planar (e.g., consider a folded piece of paper)
Halfspaces
Creation:
A plane creates two halfspaces
One Case:
\bs{n} \cdot (\bs{x} - \bs{p}) \gt 0
Another Case:
\bs{n} \cdot (\bs{x} - \bs{p}) \lt 0
Polyhedra
Definition:
The intersection of a finite number of halfspaces
Examples:
Tetrahedron (4 equilateral triangle faces)
Pentahedron (5 faces i.e., the square pyramid and the
triangular prism)
Spheres
Definition:
The set of all points within a
given radius, r, of a point, \bs{c}