色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

Python已知xy坐標(biāo)怎么批量計(jì)算兩點(diǎn)距離

Python已知xy坐標(biāo)怎么批量計(jì)算兩點(diǎn)距離?

exp1:

x = [1,2,3,4,5,6,7,8,9]

res = []

for x1, x2 in zip(x[:-1], x[1:]):

res.append(math.sqrt(x1*x1+x2*x2))

-------

exp2:

x = [1,2,3,4,5,6,7,8,9]

res = []

res = map(lambda x1,x2: math.sqrt(x1*x1-x2*x2), x[:-1], x[1:])

----------------------

java 從map取值,Python已知xy坐標(biāo)怎么批量計(jì)算兩點(diǎn)距離