当前位置:网站首页>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));边栏推荐
猜你喜欢
随机推荐
xctf攻防世界 Web高手进阶区 web2
小程序毕设作品之微信体育馆预约小程序毕业设计成品(2)小程序功能
vscode hide menu bar
How to use pywinauto and pyautogui to link the anime lady and sister please go home
IDEA常用插件
SQL Server(设计数据库--存储过程--触发器)
excel vertical to horizontal
Three, mysql storage engine - building database and table operation
npm npm
联邦学习的框架搭建
Small application project works WeChat stadium booking applet graduation design of the finished product (1) the development profile
PAM Palindromic Automata
华为无线设备配置双链路冷备份(AP指定配置方式)
excel change cell size
Additional Features for Scripting
(Translation) How the contrasting color of the button guides the user's actions
PHP算法之最接近的三数之和
程序员如何优雅地解决线上问题?
别看了,这就是你的题呀
Oracle 数据库设置为只读及读写








