《python语言程序设计》2018版第6章第20题几何问题,显示角 使用distance函数计算两点之间的距离

python 复制代码
def distance(x1, y1, x2, y2):
    x1, y1 = eval(input("Enter x1 and y1 for point1: "))
    x2, y2 = eval(input("Enter x2 and y2 for point2: "))

    distance_t = ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) ** 0.5

    print("The distance between the two points is", distance_t)
相关推荐
hhzz3 分钟前
【YOLO 入门到精通 11】进阶任务实战:分割、姿态、OBB 与深度估计
人工智能·python·yolo·计算机视觉·目标跟踪
顽疲42 分钟前
Java vue 养老系统源码详解:入住核算单 live-check 缴费入账与预交金收据实践
java·vue.js·python·java 养老·springboot 养老·vue养老
Sand(ContextGate)44 分钟前
从开发者调试工具到消费级 App:一个 AI 电商导购项目的 C 端改造与 6 个连环踩坑实录
开发语言·人工智能·python·ai·langchain
外收内放1 小时前
数据分析(DataFrame与series)
python·学习·数据分析
Want5951 小时前
Python太极八卦图
开发语言·python
川石课堂软件测试1 小时前
自动化测试|持续集成Git使用详解
git·python·jmeter·mysql·ci/cd·容器·kubernetes
饕餮争锋2 小时前
python开发工具uv简介
开发语言·python·uv
znx9392 小时前
量化交易:用理性穿越市场混沌的修行之路
人工智能·python·机器学习·期魔方
兔子零10242 小时前
FastAPI 零基础入门教程:写过 Node.js,就能轻松学会 Python 后端开发(一)
前端·后端·python
Marst Code2 小时前
上位机开发日记 · 第 12 篇 · 测试:设备模拟器是核心资产
python