lsp format
This commit is contained in:
parent
f2f443fdf8
commit
0b6f70d683
@ -1,12 +1,15 @@
|
||||
from math import sqrt
|
||||
|
||||
|
||||
def print_arr(*arr):
|
||||
for i in arr:
|
||||
print(i)
|
||||
|
||||
|
||||
def calc_dist(pto1, pto2):
|
||||
return sqrt(((pto2[0] - pto1[0]) ** 2) + ((pto2[1] - pto1[1]) ** 2))
|
||||
|
||||
|
||||
def menor_dist(*args):
|
||||
largo = range(len(args[0]))
|
||||
for pto_ini in largo:
|
||||
@ -23,8 +26,12 @@ def menor_dist(*args):
|
||||
menor = dists_orden[1]
|
||||
# índice de la menor distancia
|
||||
imd = dists.index(menor)
|
||||
print(f"Para el punto ({x1},{y1}), el punto más",
|
||||
f"cercano está a {dists[imd]:.2f} en ({args[0][imd]},{args[1][imd]})")
|
||||
print(
|
||||
f"Para el punto ({x1},{y1}), el punto más",
|
||||
f"cercano está a {dists[imd]:.2f} en",
|
||||
f"({args[0][imd]},{args[1][imd]})"
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
largo = 10
|
||||
|
Loading…
Reference in New Issue
Block a user