Distance fields

advertisement
Distance fields
for high school
geometry
(work in progress)
Mark Sawula
Peddie School
17 Apr 10
http://gamma.cs.unc.edu/DIFI/images/HugoVolRenderWireframe.png
Outline
•
•
•
•
•
•
•
Context
How I became interested
What is a scalar field?
What is a distance field?
Distance fields: Points
Distance fields: Lines
Distance fields: Points &
Lines
• Closing
http://www.imgfsr.com/sitebuilder/images/fig4.5c-256x256.png
Context
Content
•Euclidean geometry
•Analytic geometry
•Transformational
geometry
Pedagogy
•Problem-based
(Exeter-style)
•Student-centered
Geometry Honors
Articulation
•Develop algebra skills
•Bridge to Algebra II
topics (eg, locus)
•Lay foundation for
Precalculus & Calculus
topics
Technology
•Laptops
•Geogebra
•Wiki (as website)
“Other Goals”
•Develop mathematical
maturity
•Develop problemsolving capabilities
How I became interested in
Distance Fields (2006)
What is a scalar field?
• A ‘(s)calar field associates
a scalar value to every
point in a space.’
(http://en.wikipedia.org/wiki/Scalar_field)
• One example of a scalar
field is a topographic map.
The elevation is assigned
to every point on the map.
• Contour lines connect
points at the same
elevation.
• You can ask the usual
good questions related to
the spacing of contour
lines.
http://nationalmap.gov/images/park_city_ut_large.jpg
What is a scalar field? (2)
• A slope field is actually an
example of a vector field
rather than a scalar field.
Each point is associated
with a direction and a
magnitude rather than
just a scalar.
• Nonetheless, working
with scalar fields should
lay groundwork for later
work with slope fields.
http://mathworld.wolfram.com/images/epsgif/SlopeField_700.gif
What is a distance field?
http://users.cs.cf.ac.uk/Paul.Rosin/venice.gif
http://users.cs.cf.ac.uk/Paul.Rosin/venice-edge.gif
http://users.cs.cf.ac.uk/Paul.Rosin/res-dtL.gif
• A distance field is a scalar field in which the
scalar is the distance to an object or set of
objects (or points).
• Distance fields are used in image processing.
What is a distance field? (2)
From Wikipedia (http://en.wikipedia.org/wiki/Distance_transform):
•
•
•
•
•
•
•
A distance transform, also known as distance map or distance field, is a
derived representation of a digital image. The choice of the term depends
on the point of view on the object in question: whether the initial image is
transformed into another representation, or it is simply endowed with an
additional map or field.
The map labels each pixel of the image with the distance to the
nearest obstacle pixel. A most common type of obstacle pixel is a boundary
pixel in a binary image. See the image for an example of a chessboard
distance transform on a binary image.
Usually the transform/map is qualified with the chosen metric. For
example, one may speak of Manhattan distance transform, if the
underlying metric is Manhattan distance. Common metrics are:
Euclidean distance
Taxicab geometry, also known as City block distance orManhattan distance.
Chessboard distance
Applications are digital image processing (e.g., blurring
effects,skeletonizing), motion planning in robotics, and even pathfinding.
Distance fields: Points (1)
The picture to the right shows a
‘distance field’, regions in which the
distance to something red is
indicated by a shade of green.
Locations that are very far from
anything red are shaded dark green;
locations that are very close to
something red are nearly white. The
figure to the right has a single red
dot in the center. Every other
location is a different shade of green
based upon how far away it is from
the center dot. All of the locations
that are the same distance from the
center dot will be the same color.
What shape will all the locations that
are the same color make? Why?
Distance fields: Points (2)
•Suppose the coordinates of the red point are (2,-3). What is the
equation of the contour line for all points a distance of 5 away?
•What is true of all of the points inside the orange circle? What
is true of all of the points outside the orange circle?
Distance fields: Points (3)
5. The figure to the right shows the
previous distance field with a few
changes. Suppose that C=(5,8) and that
N=(t+4,t). Find the length of NC.
6. (continuation) Consider your answer to
#5 as a function which takes a value of t
as an input and outputs the length of NC.
Produce a graph of this function. You
may use Geogebra, a graphing calculator,
or just pencil and paper. What sort of
shape is this?
7. (continuation) Using your answer to #6, find the point on line AB that is closest to
point C.
8. (continuation) Without using coordinate geometry, how would you describe the
location of the point on line AB closest to C? Does your answer to #7 satisfy your
description? Why should this be true?
Distance fields: Points (4)
5. The figure to the right shows the
previous distance field with a few changes.
Suppose that C=(5,8) and that N=(t+4,t).
Find the length of NC.
Distance fields: Points (5)
Distance fields: Points (6)
Distance fields: Points (7)
You can discover using analytic
geometry or Euclidean geometry
that the shortest distance is along
a perpendicular to the line
through the point.
Distance fields give you a way to
connect that distance with the
radius of a tangent circle,
foreshadowing a circle theorem
that typically occurs later in the
curriculum.
Distance fields: Points (8)
Now consider the case
of a distance field
where the objects are
two points. What are
the different shapes of
possible contour lines?
Distance fields: Points (9)
The image above was created
using Maple. Thanks, Tim!
•Under what circumstances do you get each shape of contour?
•Explore regions of the plane created by contour lines? Relate contour of both
points to contours of each point using Venn diagram-like reasoning.
Distance fields: Points (10)
What’s up with this
line down the middle?
Is it a contour?
Suppose the two points
are (2,7) and (-8,3).
What is the “line down
the middle of the
picture”?
Distance fields: Points (11)
You can also import the problem to
GeoGebra or Sketchpad (or use paper!) and
check to see that the “ghost line” is the
perpendicular bisector of the segment
connecting the two points.
Distance fields: Points (12)
Distance fields: Points (13)
In the distance field
graph for 3 points,
depicted at left, what
shape are the contour
lines? the boundaries?
What is true of the
regions determined by
the boundaries? What
is true of the
intersection point of
the boundaries?
Distance fields: Points (14)
•What shape are the
contour lines?
•Where are the
boundaries?
•What is true of the
regions determined by
the boundaries?
•What is true of the
intersection point of
the boundaries?
Distance fields: Points (15)
The Maple version of
the image.
Distance fields: Points (16)
For the points D = (-2,3), E = (3,4), and F = (2,-1), find a point that is equidistant
to all three. Do this first using algebra and coordinate geometry, then confirm
with Geogebra. How can you be sure that your answer was correct?
Distance fields: Points (17)
When a distance field has several 'red' points, you get a structure like the ones below.
Notice that each of the boundaries is made up of points equidistant to two red points.
For each boundary, you should be able to identify which red points. Not only are they
the closest ones to the boundary, but the boundary is also the perpendicular bisector of
the segment between the two points.
Distance fields: Points (18)
http://upload.wikimedia.org/wikipedia/commons/thumb/2
/20/Coloured_Voronoi_2D.svg/220pxColoured_Voronoi_2D.svg.png
If you were to draw only
the 'red' points and the
boundaries, you would
have what is called a
Voronoi diagram, named
after the Ukrainian
mathematician, Georgy
Voronoy (1868-1908).
Applications of Voronoi
diagrams can be found in
astronomy, chemistry,
biology, and computer
science.
Distance fields: Points (19)
Go to http://home.dti.net/crispy/Voronoi.html and play
the Voronoi game! Pull down the ‘File ‘ tab and switch to
the “Info” tab.
See if you can beat the
various computer
opponents.
•Which is the easiest?
•Which is the hardest?
•How can you make a
move that changes only one
polygon? Give an example.
•How can you make a
move that changes more
than one polygon? Give an
example.
Distance fields: Points (20)
Let’s Play!
Distance fields: Points (21)
Another useful applet is
VoroGlide:
http://www.pi6.fernunihagen.de/GeomLab/VoroGl
ide/index.html.en
http://www.pi6.fernunihagen.de/GeomLab/VoroGlide/inde
x.html.en
•how many boundaries can
meet at one point? how do
you make that happen?
•what kinds of
quadrilaterals have
boundaries that meet at one
point?
Distance fields: Points (22)
Sketch the Voronoi diagram for the four points above.
Distance fields: Points (23)
Here are the points with the perpendicular bisectors drawn.
Distance fields: Points (24)
Alternate way of looking at concurrence of
perpendicular bisectors. Why can’t this happen?
Distance fields: Lines (1)
What is a distance field for
a straight line?
What do the contour lines
look like?
Distance fields: Lines (2)
What is a distance field for
a two straight lines?
What do the contour lines
look like?
What are those “ghost
lines”?
Distance fields: Lines (3)
What is a distance field
for a triangle?
What do the contour
lines inside the triangle
look like? What do the
contour lines outside
the triangle look like?
What are those “ghost
lines”?
Distance fields: Point & Line
“I will never
look at
parabolas
the same
way again.”
--student
Next steps
•Write this up!
•Classify quadrilaterals
•Any other ideas?
Download