top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Universal Gravitation Calculator

Newton's Law Of Universal Gravitation Calculator

The law entails that objects with mass feel an attractive force that is proportional to their masses and inversely proportional to the square of the distance. Mathematically given as;

F = GMm/(r^2)

where F represents the force in Newtons, M and m represent the two masses in kilograms, and r represents the separation in meters. G represents the gravitational constant, which has a value of 6.674x10^-11N(m/kg)^2. Because of the magnitude of G, the gravitational force is very small unless large masses are involved.

G = 6.674e-11
#Taking the values of the masses involved
M = float(input('Enter the mass of the first object in kilograms: '))
m = float(input('Enter the mass of the second object in kilograms: '))

#Taking the input of the distance of separation between the two masses
r = float(input('Enter the distance of separation between the two masses in meters: '))

#Calculating the force
F = (G*M*m)/r**2

#Printing the force in newtons
print(f'The force that exists between the two objects is {F} Newtons'.format(F))

The code initializes a value for G. It takes the input of the masses of the two objects involved and converts them into float values. It then takes the distance between the two masses and converts that into a float value as well. It then computes the force between them. It then prints the value obtained to the user.


LINK TO GITHUB REPOSITORY WITH CODE:

0 comments

Recent Posts

See All

COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page