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
31 lines
701 B
from math import *
|
|
|
|
def points (x,y):
|
|
"""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 l’entier 2 si le point est à l’intérieur d’un des demi-cercles et 3 sinon"""
|
|
|
|
milieu_de_terrain = 300
|
|
|
|
cote_a = int(x)
|
|
cote_b = 300 - int(y)
|
|
|
|
rd = (cote_a)**2 + (cote_b)**2
|
|
rd = sqrt(rd)
|
|
|
|
cote_a = 1000 - int(x)
|
|
|
|
rg = (cote_a)**2 + (cote_b)**2
|
|
rg = sqrt(rg)
|
|
|
|
if rd > 250 and rg >250:
|
|
return 3
|
|
else:
|
|
return 2
|
|
|
|
"""tests pour la fonction"""
|
|
"""
|
|
print(points (150,300))
|
|
print(points (500,300))
|
|
print(points (900,100))
|
|
print(points (750,400))
|
|
"""
|