CS 553 -- Winter Quarter 2009

Project #6: Hyperbolic Geometry

80 Points

Due: February 6


This page was last updated: January 22, 2009


Requirements:

  1. Put this project number and your name in the title bar.

  2. Using hyperbolic geometry, draw a map of the United States.

  3. Allow the user to interactively translate the map.

  4. Use a GLUI "spinner" to change the value of K.

  5. Toggle between polar and Cartesian hyperbolic transformations with a checkbox.

  6. Display lists are usually desirable, but in this case they get you nothing because you must perform a non-linear transformation on the geometry.

The Hyperbolic Geometry Equation:

For each Cartesian coordinate pair (x,y):

  1. Translate the original x,y by the current translation amount to create a new x,y. Do this by adding the translation values to create a new x.y. Don't do it with glTranslatef( ).

  2. Compute the new x,y polar coordinate radius, r.

  3. Do not use atan2( ) to get the polar coordinate angle. Instead, get just the cosine and sine of that angle by dividing:
    costheta = x/r
    sintheta = y/r

  4. Perform the hyberbolic transform on the polar coordinate radius to produce r'.

  5. Use that cosine and sine to convert from polar coordinates back to Cartesian.
    x' = r' * (x/r) = x/(r+K)
    y' = r' * (y/r) = y/(r+K)

  6. Plot that new (x',y') point.

  7. For Cartesian, use:
    x' = x / sqrt( x*x + K*K )
    y' = y / sqrt( y*y + K*K )

Reading and Storing the United States Data

Suggestions:

+5 Points Extra Credit:

Break each line segment into many line segments so that long straight lines appear curved as shown here:


x = (1.-t) * x0  +  t * x1
y = (1.-t) * y0  +  t * y1

               0. <= t <= 1.

Grading:

Item Points
Draw a USA-looking map 10
Draw a correct Polar USA map 20
Draw a correct Cartesian USA map 20
Translation 10
Change K with a GLUI spinner 20
Extra Credit 5
Potential Total 85

Corvallis: