当前位置:网站首页>计算由两点定义的线的角度
计算由两点定义的线的角度
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;边栏推荐
- PAM 回文自动机
- 线上故障排查方案
- JS prototype hasOwnProperty in 加方法 原型终点 继承 重写父类方法
- excel edit a cell without double clicking
- APP专项测试:流量测试
- 03、GO语言变量定义、函数
- 还在纠结报表工具的选型么?来看看这个
- Interpretation of the paper (GSAT) "Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism"
- [Recommended books] The first self-driving technology book
- bat 之 特殊字符&转义
猜你喜欢
随机推荐
三、mysql 存储引擎-建库建表操作
1391D. 505 状压dp
vscode hide menu bar
如何给 UE4 场景添加游戏角色
【SeaTunnel】从一个数据集成组件演化成企业级的服务
牛客多校4 A.Task Computing 思维
excel remove all carriage return from a cell
How to add a game character to a UE4 scene
移动端人脸风格化技术的应用
毕业作业
【参营经历贴】2022网安夏令营
编曲软件FL studio20.8中文版功能和作用
xss相关知识点以及从 XSS Payload 学习浏览器解码
JS prototype hasOwnProperty in 加方法 原型终点 继承 重写父类方法
ROS2初级知识(8):Launching启动多节点
bat 之 特殊字符&转义
小程序毕设作品之微信美食菜谱小程序毕业设计成品(5)任务书
别看了,这就是你的题呀
联邦学习的框架搭建
Prufer sequence









