Method: Joules.power_v2

Defined in:
lib/joules/energy_work_power.rb

.power_v2(force, velocity, angle = 0) ⇒ Float

Note:

There are four other methods for calculating power.

Calculates the power given force, velocity, and angle.

Examples:

Joules.power_v2(42, 2.3) #=> 96.6

Parameters:

  • force (Int, Float)

    force is in newtons

  • velocity (Int, Float)

    velocity is in meters per second

  • angle (Int, Float) (defaults to: 0)

    angle is in degrees

Returns:

  • (Float)

    return value is in watts



102
103
104
# File 'lib/joules/energy_work_power.rb', line 102

def power_v2(force, velocity, angle = 0)
  return force * velocity * Math.cos(to_radians(angle))
end