当前位置:网站首页>Unity——Mathf. Similarities and differences between atan and atan2
Unity——Mathf. Similarities and differences between atan and atan2
2022-06-26 19:16:00 【DESIDERIO】
Catalog
identical
Atan and Atan2 Are all arctangent functions 
Such as : There are two points. point(x1,y1), and point(x2,y2), Then the angle calculation method of the slope formed by these two points is :
float angle = Atan((y2-y1) / (x2-x1));
float angle = Atan2( y2-y1, x2-x1 );
difference
1: Parameters are filled in in different ways .
public static float Atan2 (float y, float x);
public static float Atan (float f);
2:Atan2 The advantage is If x2-x1 be equal to 0 It can still be calculated , however Atan Function will cause program error .
3:Mathf.Atan() The range of returned values is [-π/2,π/2],Mathf.Atan() The range of returned values is [-π/2,π/2].
Reference resources
atan Function and atan2 A little difference between functions
边栏推荐
- 物联网协议的王者:MQTT
- Reading notes: process consulting III
- Interview key points that must be mastered index and affairs (with B-tree and b+ tree)
- Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
- Refresh the strong pointer assignment problem in the HP-UX system of Sanguan
- Installation and use of filebeat
- Invocation failed Unexpected end of file from server
- To: Apple CEO Cook: great ideas come from constantly rejecting the status quo
- 为什么我不推荐去SAP培训机构参加培训?
- 問題解决:虛擬機無法複制粘貼文件
猜你喜欢

Interview key points that must be mastered index and affairs (with B-tree and b+ tree)

Unit test of boot

Yujun product methodology

wm_ Concat() and group_ Concat() function

Convex hull problem

抖音实战~分享模块~复制短视频链接

Crawl Douban to read top250 and import it into SqList database (or excel table)

Installation and use of logstash

ARM裸板调试之串口打印及栈初步分析

微信小程序 uniapp 左滑 删除 带删除icon
随机推荐
Xlua get button registration click event of ugui
Kubernetes 资源拓扑感知调度优化
When does the mobile phone video roll off?
Tiktok practice ~ homepage video ~ pull-down refresh
To: seek truth from facts
Union, intersection and difference operations in SQL
【Kubernetes】Kubernetes 原理剖析与实战应用(更新中)
Handwritten numeral recognition based on tensorflow
JS mobile terminal touch screen event
Request method 'POST' not supported
Solidity - contract inheritance sub contract contains constructor errors and one contract calls the view function of another contract to charge gas fees
微服务版单点登陆系统(SSO)
Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
抖音实战~搜索页面~视频详情
Nftgamefi chain game system development detailed solution - chain game system development principle analysis
限流设计及实现
[kubernetes] kubernetes principle analysis and practical application (under update)
Publish message publishers and subscribe message subscribers of ROS
Tree array
Interview key points that must be mastered index and affairs (with B-tree and b+ tree)