This is a VERY BASIC demonstration of the Coriolis effect. The Coriolis effect seems very obvious in a demonstration like this. If you take an object and let it fall on the earth, it doesn't actually fall in a straight line. If you're standing on earth and watch a rocket with negligible external forces acting on it, day after day you'll see it spinning around you - "contradicting" newton's law of inertia. The reason that there's no actual contradiction is because your frame of reference isn't an inertial frame (an inertial frame is one where an object with no forces acting on it will move in a straight line). You're in an accelerated/rotating frame, and so newton's laws need some modifications.
If you drop a ball near earth's surface, taking one second to hit the ground, the ball looks like its traveled down in a straight line, but it actually has traveled about 400 meters! (at the equator) The resulting path - in any inertial frame - looks like an arc, not a straight line. If you were to drop a ball very slowly (using pulleys or something) or from very high up, the Coriolis forces would become more noticeable. Coriolis forces are imaginary forces - like the centrifugal force. They're only valid in a rotating frame of reference, and they also always deflect particles, meaning they act perpendicular to (and proportional to) the velocity. I just wrote this snippet to see it in action and maybe expand on it later.
Eventually I want to do an earth simulation with 3d particles on earth's surface.
global ballx as float
global bally as float
global ballvx as float
global ballvy as float
global rot as float
ballvx=.1
ballvy=.1
rot=0
ballx=50
global timestep as float
timestep=.1
do
drawAll()
ballx=ballx+ballvx*timestep
bally=bally+ballvy*timestep
rot=rot+.1*timestep
updatePhysics()
sync
loop
end
function updatePhysics()
ballvy=ballvy-.01*timestep
d#=sqrt(ballx*ballx+bally*bally)
dirx#=ballx/d#
diry#=bally/d#
if d#>100
ballx=dirx#*99.99
bally=diry#*99.99
dprod#=dirx#*ballvx+diry#*ballvy
ballvx=ballvx-2*dprod#*dirx#
ballvy=ballvy-2*dprod#*diry#
endif
endfunction
function drawAll()
box 0,0,400,20,rgb(0,0,0),rgb(0,0,0),rgb(0,0,0),rgb(0,0,0)
text 0,0,"Angle: "+str$(wrapvalue(rot))
center text 100,75,"Inertial:"
center text 300,75,"Rotating:"
dot ballx+100,200-bally
c#=cos(rot)
s#=sin(rot)
dot ballx*c#-bally*s#+300,200-(ballx*s#+bally*c#)
endfunction