Gravity is a force that attracts objects with mass towards each other. Newton's law of universal gravitation states that the gravitational force between two objects is directly proportional to the product of their masses and inversely proportional to the square of the distance between them. The gravitational constant was experimentally determined by Henry Cavendish. Gravitational potential energy is the energy an object gains due to its position in a gravitational field and depends on the object's mass, the acceleration due to gravity, and its height. Elastic potential energy is the energy stored when an object is stretched or compressed.