Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ marp 01.md && open 01.html
|10| Иваело Кръстев | [Ivaelo](https://github.com/Ivaelo) | | |
|11| Ивайло Димов | [IvailoDimov](https://github.com/IvailoDimov) | | |
|12| Ивайло Генчев | [Squidfishrl](https://github.com/Squidfishrl) | | |
|13| Иван Станчев | [IvanStanchev](https://github.com/IvanStanchev) | | |
|13| Иван Станчев | [IvanStanchev](https://github.com/IvanStanchev) | 🍬🍬 | |
|14| Йордан Христов | [dachkata555](https://github.com/dachkata555) | | |
|15| Калин Георгиев | [kgeorgiev77](https://github.com/kgeorgiev77) | 🍬 | |
|16| Кристиан Косев | [Grozdi](https://github.com/Grozdi) | | |
Expand Down
1 change: 0 additions & 1 deletion homeworks/05_Vladimir_Aleksiev/01_check_circles.py

This file was deleted.

37 changes: 37 additions & 0 deletions homeworks/14_Ivan_Stanchev/01_check_circles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from math import sqrt

def check_circles(c1_center, c1_radius, c2_center, c2_radius):
x1, y1 = c1_center
x2, y2 = c2_center
distance = sqrt((x1-x2)**2 + (y1-y2)**2)
sum_of_radii = c1_radius + c2_radius

#MATCHING
if(c1_center == c2_center and c1_radius == c2_radius):
return "MATCHING"

# TOUCHING
if d == sum_of_radii:
return "TOUCHING"
elif d < sum_of_radii:

# CONTAINING
if d + c2_radius <= c1_radius:
return "First circle contains second one"

elif d + c1_radius <= c2_radius:
return "Second circle contains first one"

# INTERSECTING
else:
return "INTERSECTING"
# NO_COMMON
elif d > sum_of_radii:
return "NO_COMMON"

elif d < sum_of_radii:
if d + c2_radius <= c1_radius:
return "Circle one contains circle two"
elif d + c1_radius <= c2_radius:
return "Circle two contains circle one"