|
 |
 |
William
Scott Rickman
Math Fun
Bouncing Beach Ball: (Requirements: Trigonometry, DPGraph)
|
Ball:
1. We'll use the rectangular command in DPGraph. Its syntax is
rectangular(x,y,z)
where x,y,z are the coordinates of the points to plot.
2. Then, we'll use a spherical transformation. Spherical
coordinates are:
r=distance from origin
θ=horizontal angle from x-axis.
Ф=angle off z-axis.

It can be shown that the transformation to rectangular
coordinates are
x=r cos(θ) sin(Ф)
y=r sin(θ) sin(Ф)
z=r cos(Ф).
3. In DPGraph we have 2 parameters of U and V. We'll use U as θ,
and V as Ф. So U will run from 0 to 2π,and
V from 0 to π. Also, we'll
graph in a viewing box of -4 to 4 for x, y and z. So our setup
commands will be:
graph3d.box := true
graph3d.mesh := true
graph3d.view := front
graph3d.perspective := true
graph3d.resolution := 30
graph3d.highlight := 1
graph3d.shading := 0
graph3d.contrast := .5
graph3d.transparency := 0
graph3d.color := blue
graph3d.minimumx := -4
graph3d.maximumx :=4
graph3d.minimumy := -4
graph3d.maximumy := 4
graph3d.minimumz := -4
graph3d.maximumz := 4
GRAPH3D.STEPSU := 20
GRAPH3D.STEPSV := 20
GRAPH3D.MINIMUMU := 0
GRAPH3D.MAXIMUMU := 2*PI
GRAPH3D.MINIMUMV := 0
GRAPH3D.MAXIMUMV :=PI
4. Now putting the transformations into the rectangular command
using U and V for θ and Ф respectively and r=1, we get
graph3d((rectangular(cos(U)*sin(V),sin(U)*sin(V),cos(V)))).
The Ball |
|
Rotating Ball:
1. To make the ball rotate add the variable time to U. To help
see the coordinates I'm going to start breaking the command
between coordinates.
graph3d((rectangular(
cos(U+time)*sin(V),
sin(U+time)*sin(V),
cos(V)))).
The Rotating Ball |
|
Sliding Ball:
1. To make the ball side we need to move the center of the
sphere from -3 to 3 along the x axis.
2. Sin(time) will go from -1 to 1 in a smooth curve, but it
would look better to have the ball bouncing off the sides. So
arcsin(sin(time)) would look better since y=arcsin(sin(time))
oscillates like y=sin(time), but moves straight from max to min.

3. arcsin(sin(time)) would go from -π/2
to π/2. To make it go from
-3 to 3 multiply by 6/π.
4. Finally since this is a shift in x, add this to the x
coordinate. Note, in DPGraph arcsin(x)=asin(x).
graph3d((rectangular(
cos(U+time)*sin(V)+6*asin(sin(time))/pi,
sin(U+time)*sin(V),
cos(V))))
The Sliding Ball |
|
Bouncing Ball:
1. Since falling bodies fall in parabolas, we will want the
center of the ball to move on a parabola with vertex at (0,0,3)
and passing though (-3,0,-3) and (-3,0,3). The parabola
z=3-(2/3)x2 will do this.
2. Note the x is given by 6arcsin(sin(time))/π
. So
z=3-(2/3)(6arcsin(sin(time))/π)2
3. This gets added to the z coordinate.
graph3d((rectangular(
cos(U+time)*sin(V)+6*asin(sin(time))/pi,
sin(U+time)*sin(V),
cos(V)+3-(2/3)*(6*asin(sin(time))/PI)^2)))
The Bouncing Ball |
|
Bouncing Beach Ball:
1. The ball is blue because of the command
graph3d.color := blue
This can be changed to an expression of x,y,z,U, or V.
2. Since most beach balls have multi-colored panels going around
it, change this command to
graph3d.color := U/2/PI
This will make the color values range from 0 to 1, and cause the
to change with the horizontal angle.
The Bouncing Beach Ball |
Last
Edited on
12/17/2009
EMAIL:rickmanw@seminolestate.edu
Take
Me Back
Rickman
Home
Seminole State
Math Student Website
Seminole State
Math Home
Seminole State
Home
Disclaimer
Copyright
2009
|