distance_affichage.py
Programme Python de l'Interros des Lycées
t, r = 0, 0.01
a = float(input('a = '))
b = float(input('b = '))
c = float(input('c = '))
m = float(input('m = '))
n = float(input('n = '))
p = float(input('p = '))
x = float(input('x = '))
y = float(input('y = '))
z = float(input('z = '))
I = (x-a)**2 + (y-b)**2 + (z-c)**2
D = (x-a-r*m)**2 + (y-b-r*n)**2 + (z-c-r*p)**2
if D > I:
r = -r
D = (x-a-r*m)**2 + (y-b-r*n)**2
+ (z-c-r*p)**2
while D < I:
t = t + r
I = D
D = (x-a-t*m)**2 + (y-b-t*n)**2
+ (z-c-t*p)**2
print(I**0.5)