当前位置:网站首页>计算由两点定义的线的角度
计算由两点定义的线的角度
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;边栏推荐
猜你喜欢

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

Prufer sequence

研发团队数字化转型实践

E - Integer Sequence Fair

力扣第 304 场周赛复盘

从0到100:招生报名小程序开发笔记

域名重定向工具 —— SwitchHosts 实用教程

罗克韦尔AB PLC RSLogix5000中的比较指令使用方法介绍

13、学习MySQL 分组

JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method
随机推荐
Oracle 数据库设置为只读及读写
PAM 回文自动机
联邦学习的框架搭建
Create virtual environments with virtualenv and Virtualenvwrapper virtual environment management tools
When solving yolov5 training: "AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train"
使用Jenkins做持续集成,这个知识点必须要掌握
PHP算法之有效的括号
基于JAX的激活函数、softmax函数和交叉熵函数
ping no reply
PHP算法之电话号码的字母组合
Chapter 11 Working with Dates and Times
下载安装 vscode(含汉化、插件的推荐和安装)
复现gallerycms字符长度限制短域名绕过
excel change cell size
xctf attack and defense world web master advanced area web2
PHP算法之最接近的三数之和
如何给 UE4 场景添加游戏角色
简单3D渲染器的制作
小程序毕设作品之微信美食菜谱小程序毕业设计成品(8)毕业设计论文模板
【C补充】链表专题 - 单向链表