当前位置:网站首页>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));边栏推荐
- PostgreSQL 基础--常用命令
- excel remove all carriage return from a cell
- SRv6 L3VPN的工作原理
- When solving yolov5 training: "AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train"
- 1. @Component注解的原理剖析
- Wechat Gymnasium Reservation Mini Program Graduation Design Finished Work Mini Program Graduation Design Finished Product (2) Mini Program Function
- 计算由两点定义的线的角度
- 牛客多校4 A.Task Computing 思维
- npm npm
- 2022/7/31
猜你喜欢

访问控制台中的选定节点

简单3D渲染器的制作

Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D Solution

Ten years after graduation, financial freedom: those things that are more important than hard work, no one will ever teach you

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

力扣第 304 场周赛复盘

13、学习MySQL 分组

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

npm包【详解】(内含npm包的开发、发布、安装、更新、搜索、卸载、查看、版本号更新规则、package.json详解等)

联邦学习的框架搭建
随机推荐
数据库表设计规则
TCP 可靠吗?为什么?
加载字体时避免隐藏文本
RxJs SwitchMapTo 操作符之移花接木
从0到1:图文投票小程序设计与研发笔记
xctf attack and defense world web master advanced area webshell
Use Jenkins for continuous integration, this knowledge point must be mastered
y84.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十五)
Prufer序列
Chapter 11 Working with Dates and Times
excel change cell size
visual studio code multiple editing
cmd指令
(Translation) How the contrasting color of the button guides the user's actions
Background project Express-Mysql-Vue3-TS-Pinia page layout-sidebar menu
CAKE:一个用于多视图知识图谱补全的可扩展性常识感知框架
移动端人脸风格化技术的应用
1391D. 505 状压dp
文件查询匹配神器 【glob.js】 实用教程
论文解读(GSAT)《Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism》