Method: Joules.kinetic_energy_v1

Defined in:
lib/joules/energy_work_power.rb

.kinetic_energy_v1(mass, velocity) ⇒ Float

Note:

There is one other method for calculating kinetic energy.

Calculates the kinetic energy given mass and velocity.

Examples:

Joules.kinetic_energy_v1(500, 22) #=> 121000.0

Parameters:

  • mass (Int, Float)

    mass >= 0; mass is in kilograms

  • velocity (Int, Float)

    velocity is in metres per second

Returns:

  • (Float)

    return value >= 0; return value is in joules



52
53
54
# File 'lib/joules/energy_work_power.rb', line 52

def kinetic_energy_v1(mass, velocity)
  return 0.5 * mass * (velocity ** 2)
end