当前位置:网站首页>Calculate the midpoint between two points
Calculate the midpoint between two points
2022-08-01 23:07:00 【Ziwei front end】
JavaScript version
const midpoint = (p1, p2) => [(p1.x + p2.x) / 2, (p1.y + p2.y) / 2];
TypeScript version
interface Point {
x: number;
y: number;
}
const midpoint = (p1: Point, p2: Point): number[] => [(p1.x + p2.x) / 2, (p1.y + p2.y) / 2];
边栏推荐
猜你喜欢
随机推荐
JS prototype hasOwnProperty in 加方法 原型终点 继承 重写父类方法
联邦学习入门
APP专项测试:流量测试
计算由两点定义的线的角度
IDEA常用插件
联邦学习在金融领域的发展和应用
系统可用性:SRE口中的3个9,4个9...到底是个什么东西?
A. Doremy‘s IQ-- Codeforces Round #808 (Div. 1)
perspectiveTransform warpPerspective getPerspectiveTransform findHomography
解决端口占用
Wechat Gymnasium Reservation Mini Program Graduation Design Finished Work Mini Program Graduation Design Finished Product (2) Mini Program Function
Chapter 19 Tips and Traps: Common Goofs for Novices
RxJs SwitchMapTo 操作符之移花接木
13、学习MySQL 分组
CF1703G Good Key, Bad Key
C#大型互联网平台管理框架源码:基于ASP.NET MVC+EF6+Bootstrap开发,支持多数据库
还在纠结报表工具的选型么?来看看这个
xctf attack and defense world web master advanced area webshell
xss相关知识点以及从 XSS Payload 学习浏览器解码
Jmeter是什么