当前位置:网站首页>计算由两点定义的线的角度
计算由两点定义的线的角度
2022-08-01 23:03:00 【紫微前端】
JavaScript version
// In radians
const radiansAngle = (p1, p2) => Math.atan2(p2.y - p1.y, p2.x - p1.x);
// In degrees
const degreesAngle = (p1, p2) => (Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180) / Math.PI;TypeScript version
interface Point {
x: number;
y: number;
}
const radiansAngle = (p1: Point, p2: Point): number => Math.atan2(p2.y - p1.y, p2.x - p1.x);
const degreesAngle = (p1: Point, p2: Point): number => (Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180) / Math.PI;边栏推荐
- D - Linear Probing- 并查集
- blender3.2.1 unit setting
- 【开源】Sentinel高性能高可用集群限流解决方案
- How to add a game character to a UE4 scene
- Prufer sequence
- 小程序毕设作品之微信美食菜谱小程序毕业设计成品(5)任务书
- 小程序毕设作品之微信美食菜谱小程序毕业设计成品(6)开题答辩PPT
- The must-have "fishing artifact" for programmers is here!
- [Recommended books] The first self-driving technology book
- Mini Program Graduation Works WeChat Food Recipe Mini Program Graduation Design Finished Product (8) Graduation Design Thesis Template
猜你喜欢

No more rolls!After joining ByteDance for a week, he ran decisively.

Prufer sequence

Postman 批量测试接口详细教程

小程序毕设作品之微信体育馆预约小程序毕业设计成品(3)后台功能

APP专项测试:流量测试

下载安装 vscode(含汉化、插件的推荐和安装)

Quarantine and downgrade

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

Flutter基础学习(一)Dart语言入门

关于ETL的两种架构(ETL架构和ELT架构)
随机推荐
2022/7/31
复现gallerycms字符长度限制短域名绕过
自建 Prometheus 采集腾讯云容器服务监控数据最佳实践
CF1703G Good Key, Bad Key
力扣第 304 场周赛复盘
NgRx Selector 的 Memoization 特性学习笔记
xctf攻防世界 Web高手进阶区 web2
域名重定向工具 —— SwitchHosts 实用教程
A. Doremy‘s IQ-- Codeforces Round #808 (Div. 1)
如何使用pywinauto和pyautogui将动漫小姐姐链接请回家
xctf attack and defense world web master advanced area webshell
联邦学习在金融领域的发展和应用
System availability: 3 9s, 4 9s in SRE's mouth... What is it?
选择合适的 DevOps 工具,从理解 DevOps 开始
【好书推荐】第一本无人驾驶技术书
No more rolls!After joining ByteDance for a week, he ran decisively.
vscode hide menu bar
用virtualenv和Virtualenvwrapper虚拟环境管理工具创建虚拟环境
如何理解 new (...args: any[]) => any
Deep learning Course2 first week Practical aspects of Deep Learning exercises