Skip to content

madfanat/cicd

Repository files navigation

Math formulas used in the solutions

Area

  • Circle: S = πR²
  • Rectangle: S = ab
  • Square: S = a²

Perimeter

  • Circle: P = 2πR
  • Rectangle: P = 2a + 2b
  • Square: P = 4a

Functions

circle.py

area(r)

  • Uses math.pi as an approximate value of π
  • Takes r (float) - the circle radius length
  • Returnes the area of a circle with given radius length (float)
  • Example: print(area(1)) -> 3.141592653589793

perimeter(r)

  • Uses math.pi as an approximate value of π
  • Takes r (float) - the circle radius length
  • Returnes the perimeter of a circle with given radius length(float)
  • Example: print(perimeter(1)) -> 6.283185307179586

rectangle.py

area(a, b)

  • Takes a, b (float) - the rectangle width and height lengths
  • Returnes the area of a rectangle with given side lengths (float)
  • Example: print(area(2.1, 3)) -> 6.3

perimeter(a, b)

  • Takes a, b (float) - the rectangle width and height lengths
  • Returnes the perimeter of a rectangle with given side lengths (float)
  • Example: print(perimeter(2.1, 3)) -> 10.2

square.py

area(a)

  • Takes a (float) - the square side length
  • Returnes the area of a square with given side (float)
  • Example: print(area(1.5)) -> 2.25

perimeter(a)

  • Takes a (float) - the square side length
  • Returnes the perimeter of a square with given side length (float)
  • Example: print(perimeter(1.5)) -> 6

triangle.py

area(a, h)

  • Takes a, h (float) - the triangle side and the corresponding height lengths
  • Returnes the area of a triangle with given side and height (float)
  • Example: print(area(2, 1.5)) -> 1.5

perimeter(a, b, c)

  • Takes a, b, c (float) - the triangle side lengths
  • Returnes the perimeter of a triangle with given side lengths(float)
  • Example: print(perimeter(1.1, 2.2, 3)) -> 6.3

Commits history

  • 8ba9aeb L-03: Circle and square added
  • d078c8d (origin/main, origin/HEAD, main) L-03: Docs added
  • d080c78 L-04: Triangle added
  • 51c40eb L-04: Doc updated for triangle
  • d76db2a L-04: Add calculate.py
  • b5b0fae (origin/develop) L-04: Update docs for calculate.py
  • 3049431 (origin/feature) L-04: Add rectangle.py
  • 6adb962 L-03: Docs added
  • 438b89a L-05: Add user agreement
  • 86edb1c (origin/release) L-05: Update Docs. Add user agreement info
  • 23b27d3 Add rectangle.py
  • 4cd1e7e Add triangle.py
  • 3c44b58 Fix rectangle.py perimeter calculation
  • 938d676 Add docs in circle.py
  • 3258879 Add docs in rectangle.py
  • 6f1b417 Add docs in square.py
  • d8c1774 Add docs in triangle.py
  • 3efdb90 Add docs for all fuctions and a commit history
  • 0ce8a55 (HEAD -> new_features_501729) Fixed docs for triangle.py
  • 47a40cf (HEAD -> new_features_501729) Uodate commit history
  • 3efdb90 Add docs for all fuctions and a commit history
  • f378591 Make the documentation clear

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages