当前位置:网站首页>Calculate the distance between two points
Calculate the distance between two points
2022-08-01 23:07:00 【Ziwei front end】
JavaScript version
const distance = (p1, p2) => Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));TypeScript version
interface Point {
x: number;
y: number;
}
const distance = (p1: Point, p2: Point): number => Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));边栏推荐
- img 响应式图片的实现(含srcset属性、sizes属性的使用方法,设备像素比详解)
- 编曲软件FL studio20.8中文版功能和作用
- E - Integer Sequence Fair
- y84.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十五)
- 还在纠结报表工具的选型么?来看看这个
- Deep learning Course2 first week Practical aspects of Deep Learning exercises
- excel split text into different rows
- SQL Server(设计数据库--存储过程--触发器)
- 访问控制台中的选定节点
- 文件查询匹配神器 【glob.js】 实用教程
猜你喜欢

TCP 可靠吗?为什么?

联邦学习在金融领域的发展和应用

PDF转Word有那么难吗?做一个文件转换器,都解决了

y84. Chapter 4 Prometheus Factory Monitoring System and Actual Combat -- Advanced Prometheus Alarm Mechanism (15)

JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method

10年稳定性保障经验总结,故障复盘要回答哪三大关键问题?|TakinTalks大咖分享

PHP算法之电话号码的字母组合

解决端口占用

解决yolov5训练时出现:“AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train ”

文件查询匹配神器 【glob.js】 实用教程
随机推荐
Graph Theory - Strongly Connected Component Condensation + Topological Sort
小程序毕设作品之微信美食菜谱小程序毕业设计成品(7)中期检查报告
联邦学习的框架搭建
将vim与系统剪贴板的交互使用
联邦学习在金融领域的发展和应用
域名重定向工具 —— SwitchHosts 实用教程
C#大型互联网平台管理框架源码:基于ASP.NET MVC+EF6+Bootstrap开发,支持多数据库
Small application project works WeChat stadium booking applet graduation design of the finished product (1) the development profile
避免使用 <b>、<i>、<s> 和 <u> 标签
计算两点之间的中点
excel change cell size
npm npm
excel remove all carriage return from a cell
JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method
CF1703G Good Key, Bad Key
Nacos配置中心之加载配置
prim生成树
SQL Server (design database--stored procedure--trigger)
E - Integer Sequence Fair
Flutter基础学习(一)Dart语言入门