我试图为一个问题解一个距离公式,但是,我希望答案是surd形式的 python代码如下:
import math
#taking values of x and y
px1=int(input("What is value of px1?: "))
py1=int(input("What is value of py1?: "))
qx2=int(input("What is value of pqx2?: "))
qy2=int(input("What is value of qy2?: "))
#formula for the distance
formula = ((qx2-px1)**2+(qy2-py1)**2)
i = int(math.sqrt(formula) )
print(i)
目前没有回答
相关问题 更多 >
编程相关推荐