Method: Tasks::Task.task_24

Defined in:
lib/tasks.rb

.task_24(x1:, x2:, y1:, y2:) ⇒ Object



109
110
111
112
113
114
# File 'lib/tasks.rb', line 109

def task_24(x1:, x2:, y1:, y2:)
  diff_x = x1 - x2
  diff_y = y1 - y2
  result = Math.sqrt(diff_x**2 + diff_y**2)
  result.round(2)
end