Graphics Practice
A shrinking Ellipse
The program
ellipse.c
calculates a trajectory following
a rotating and shrinking ellipse.
- Compile and run the program, storing the data in a file see
- Plot the original ellipse
- Plot the shrinking ellipse
- 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..
- Use gnuplot to plot the resulting surface
- Add a contour plot to the surface plot
- Plot the contour plot by itself
- 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.