projet basket arno theo mathis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
701 B

from math import *
3 weeks ago
def points (x,y):
2 weeks ago
"""fonction points prenant en paramètres deux entiers x et y (les coordonnées du point où a eu lieu l’action)
et qui renvoie lentier 2 si le point est à lintérieur dun des demi-cercles et 3 sinon"""
milieu_de_terrain = 300
2 weeks ago
cote_a = int(x)
cote_b = 300 - int(y)
3 weeks ago
2 weeks ago
rd = (cote_a)**2 + (cote_b)**2
rd = sqrt(rd)
cote_a = 1000 - int(x)
2 weeks ago
rg = (cote_a)**2 + (cote_b)**2
rg = sqrt(rg)
2 weeks ago
if rd > 250 and rg >250:
3 weeks ago
return 3
else:
return 2
2 weeks ago
"""tests pour la fonction"""
"""
2 weeks ago
print(points (150,300))
print(points (500,300))
print(points (900,100))
print(points (750,400))
"""