Method: Joules.centripetal_force_v1

Defined in:
lib/joules/circular_motion.rb

.centripetal_force_v1(mass, linear_velocity, radius) ⇒ Float

Note:

There is one other method for calculating centripetal force.

Calculates the centripetal force given mass, linear velocity, and radius.

Examples:

Joules.centripetal_force_v1(2000, 5.56, 2.1) #=> 29441.523809523802

Parameters:

  • mass (Int, Float)

    mass >= 0; mass is in kilograms

  • linear_velocity (Int, Float)

    linear_velocity is in metres per second

  • radius (Int, Float)

    radius >= 0; radius is in metres

Returns:

  • (Float)

    return value >= 0; return value is in newtons



112
113
114
115
116
117
118
# File 'lib/joules/circular_motion.rb', line 112

def centripetal_force_v1(mass, linear_velocity, radius)
  if radius.zero?
    raise ZeroDivisionError.new('divided by 0')
  else
    return (mass * (linear_velocity ** 2.0)) / radius
  end
end