Method: Joules.arc_length

Defined in:
lib/joules/geometry.rb

.arc_length(radius, central_angle) ⇒ Float

Calculates the arc length of a circle given radius and central angle.

Examples:

Joules.arc_length(12, (Math::PI/4)) #=> 9.42477796076938

Parameters:

  • radius (Int, Float)

    radius >= 0; radius is in a unit of length

  • central_angle (Int, Float)

    central_angle >= 0; central_angle is in radians

Returns:

  • (Float)

    return value >= 0; return value has the same units as radius



25
26
27
# File 'lib/joules/geometry.rb', line 25

def arc_length(radius, central_angle)
  return radius * central_angle.to_f
end