EJSS Earth and Moon Model by paco remixed by lookang.
https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_model_EarthAndMoon3Dwee/EarthAndMoon3Dwee_Simulation.html
Description:
The Moon completes its orbit around the Earth in approximately 27.32 days (a sidereal month). In this model, we assume the Moon to orbit about the center of the Earth. By this assumption, the Moon is at a distance of about 385000 km from the center of the Earth, which corresponds to about 60 Earth radii. With a mean orbital velocity of 1.023 km/s,[1] The Moon orbit is modeled to be a perfect circular motion orbit, a close approximation the real Moon's orbit. The model also assume the Moon to move on the Earth's equatorial plane.
The equations of motion are:
The equations of rotation are:
Equations used to calculate physics quantities are:
The model used
        so after 360 δt 
        steps, 
      
        To calculate period T,  
      
        therefore, 
      
        For collision detection, i used
      
        For largely visualization purposes, 
      for example in the model versus in the world,
        where k=0.58x10−4 
        to achieve comparable period T=27.3 
        days
      
        and velocity of moon is 
      changes made:
        added realistic numbers in the model
      
        added better graphics from creative commons or public domain
        pictures
      
        added plane of Moon's rotational plane
      
        added control and sliders to suit my usual design ideas
      Activities:
        set the velocity to zero and play the simulation, is it as you
        expected it to observe? What is the physics concepts that can be
        used to explain this?
      
