From 8ca2da2019e317c03c6a625a44dec63a0cee2740 Mon Sep 17 00:00:00 2001 From: Jonathan Wehnert Date: Tue, 30 Jul 2024 21:46:56 +0000 Subject: [PATCH] Add function to calculate diameter to circle.py --- src/geometry/circle.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/geometry/circle.py b/src/geometry/circle.py index f8ae2ea..0a23b4a 100644 --- a/src/geometry/circle.py +++ b/src/geometry/circle.py @@ -35,3 +35,19 @@ def calculate_circ(r): """ circ = 2 * pi * r return circ + + +def calculate_diam(r): + """ + Calculate the diameter of a circle. + + Parameters + ---------- + r : float, the radius + + Returns + ------- + float : the diameter of the circle + """ + diam = 2 * r + return diam