CSC274b
Spring 1998
Ileana Streinu
Cinderella exercises and basic implementation drills
Part 1: Cinderella
The purpose of these exercises is to allow you to
become familiar with Cinderella. Deadline: Tuesday Feb. 15, before class.
Save the Cinderella exercises as files on your computer. Next
time, I'll show you how to convert them to html pages and link
them from the web page in your account.
To run Cinderella in the lab (McConnell 104):
- Log on (using the class account) on any of the SGI
workstations in McC 104.
- At the Unix prompt, type Cinderella& (with capital C).
- You can save the files in your 274b-xx account.
- You can also try to run it from Exceed, on any of the Windows
machines in McC 104 or Burton basement - but I have not tested
this feature and I cannot guarantee that it works without glitches.
To do:
- Do the construction for the false proof of "all triangles are
isosceles" and see what was wrong with the picture I had on the
blackboard:
- Draw a triangle ABC.
- Construct the angular bisector a of vertex A.
- Take the median point M of the opposite side BC.
- Construct the perpendicular h on BC through point M.
- Construct the intersection point D of a and h.
- Take the perpendicular DE from D onto AB and DF from D onto
AC.
- Think of, and be prepared to answer the question:
what was wrong with the "proof"?
- Explore Cinderella's features. Learn how to compute areas of polygons,
lengths of segments, draw circles.
- Draw a triangle, compute its area, move one of its vertices
and watch the area change. When does the sign change?
- Draw a polygon, compute its area. Then move its vertices
(allowing self intersections of the egdes), and watch how the
area changes. Can you tell when it becomes negative?
- Draw a few points in a new Cinderella window, them go to
the Views menu and select Spherical view. A new window will pop up,
showing you a sphere with images of these points on it. Play with the
controls of the Spherical View window to view them better. Move
the points in the original window, see what happens in the
Spherical View window.
On Tuesday I will use the spherical view model to explain why the
formula for computing the area looks as it does. Later we will
need to refer to this model when discussing duality. So play with
it, to become familiar with it.
Part 2: implementation drills
In class, I explained how to use the sign of the determinant to
decide whether two segments (given by their 4 endpoints) cross or
not.
Using a programming language of your choice (C, C++, Java), write
a function to implement this test. Write a small program to call
this function on 2-3 data sets. Use Cinderella to get values for
the coordinates of the points in these data sets
(i.e., draw 4 points in Cinderella,
then look into the Construction window to see what their
coordinates are). The advantage of this way of getting the points
is that you can see whether the segments cross or not - and thus
you can test the correctness of your code.
However, since this is NOT a programming class, I do not
expect you to fully debug this code: just do your best to get it
as close to a running program as possible. Print the source code
and hand in a copy of it to me, in class, on Tuesday.
Extra credit problem
Show with an example that the 3-coloring proof does not hold for
polygons with holes. I.e. find a polygon with a hole, and a
triangulation of it, so that when you start 3-coloring the
vertices you will be forced to use a 4th color at some point
(probably, when going around a cycle in the dual graph of the
triangulation :-)).
No strict deadline for submitting an answer to this problem, but
you should probably work on it in the following 2 weeks, as
later we'll move on to new topics.
Last modified February 10, 2000.