Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JavaScript function called gravitationalPull which will calculate and return the gravitational attraction between two objects.with the following header: function gravitationalPull (m1, m2, s) The equation
JavaScript function called gravitationalPull which will calculate and return the gravitational attraction between two objects.with the following header:
function gravitationalPull (m1, m2, s)
The equation to use is:
Where:
is the gravitational attraction (the value to be returned) (Newtons)
are the masses of the two objects (kg)
is the distance between the two objects (meters)
is the gravitational constant, 6.67408 10-11(m3kg-1s-2)
var G = 6.67408e-11;
function gravitationalPull (m1, m2, s)
{
var retval = (G * m1 * m2) / (s * s);
return retval;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started