当前位置:网站首页>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));边栏推荐
猜你喜欢

Prufer序列
SQL29 Calculate the average next day retention rate of users

程序员如何优雅地解决线上问题?

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

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

小程序毕设作品之微信美食菜谱小程序毕业设计成品(5)任务书

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

如何给 UE4 场景添加游戏角色

Quarantine and downgrade

美赞臣EDI 940仓库装运订单详解
随机推荐
毕业作业
使用Jenkins做持续集成,这个知识点必须要掌握
Flutter基础学习(一)Dart语言入门
Deep Learning Course2 Week 2 Optimization Algorithms Exercises
小程序毕设作品之微信体育馆预约小程序毕业设计成品(3)后台功能
论文解读(GSAT)《Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism》
检查点是否在矩形内
字符串——Trie
关于ETL的两种架构(ETL架构和ELT架构)
CAKE:一个用于多视图知识图谱补全的可扩展性常识感知框架
Nacos配置中心之加载配置
SRv6 L3VPN的工作原理
添加大量元素时使用 DocumentFragments
Chapter 12 End-User Task As Shell Scripts
Three, mysql storage engine - building database and table operation
解决yolov5训练时出现:“AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train ”
vscode hide menu bar
10年稳定性保障经验总结,故障复盘要回答哪三大关键问题?|TakinTalks大咖分享
E - Integer Sequence Fair
excel cell contian two words, seperated by a slash