Graphics Practice



A shrinking Ellipse

The program ellipse.c calculates a trajectory following a rotating and shrinking ellipse.
  1. Compile and run the program, storing the data in a file see
  2. Plot the original ellipse
  3. Plot the shrinking ellipse
  4. Plot both the original ellipse together with the rotating and shrinking one
Modify the program to add a translation to the motion at 45 degrees from the x-axis. Use the same velocity in x and y directions, namely vx=vy=v=2.5/N, where N is the number ot time steps. Use the loop index itself as the time t. Plot the resulting trajectory.

Mountain Top

Write a program to calculate a deformed bell function

F(x,y) = exp( -x^2 - 2 y^2 )

on a 150x150 numerical grid within a domain x=[-2.5,2.5] and y=[-2.5,2.5] and output the results on stdout..
  1. Use gnuplot to plot the resulting surface
  2. Add a contour plot to the surface plot
  3. Plot the contour plot by itself
  4. Make a colored image based on this function
Add the calculation of a plane to your C code. Use

plane(x,y)=0.5 + 0.1 x - 0.05 y

Use gnuplot to plot together the bell AND the plane as surfaces.