当前位置:网站首页>Swiftui swift internal skill how to perform automatic trigonometric function calculation in swift
Swiftui swift internal skill how to perform automatic trigonometric function calculation in swift
2022-07-07 11:45:00 【Knowledge fatness】
No one likes math , This is the truth . So what can we do to completely eliminate it from our lives ? No , This is not a robot . Maybe one day I will write these . Who knows ! But for now , You will have to solve functions and formulas .
Are you ready to leave the past calculator ? Let's see how to simplify trigonometric functions for our project .
principle
For those who are not familiar with trigonometry , Let me quote myself from another tutorial , Like an absolutely self-centered nerd ( Although it's actually just laziness ):
Basically , In a right triangle , You can calculate the length of the triangle side , The premise is that you at least :
- The degree of an angle ( In our case , The one I highlighted in yellow ),
- And one of the three sides of size ( In our case , Blue dotted line ).
As you can see from the diagram , This logic can be applied to an invisible circle around our middle button , By using the formula in the figure x and y Value to define three buttons ( green ) The location of .

This theory is useful for any structure involving circles . for example , In that tutorial , I'm explaining how to determine the position of the green dot in the picture from the center of the circle , So that I can treat them as three UIButtons The center of the position .
Trigonometry tells us :
- sin θ = Opposite side / hypotenuse
- cos θ = adjacent / hypotenuse
- tan θ = Opposite side / Adjacent edge
If you look at the picture above ,“θ” It's a yellow angle ,“x” Is an adjacent edge &
边栏推荐
- 【最短路】ACwing 1127. 香甜的黄油(堆优化的dijsktra或spfa)
- Le Cluster kubernets en cours d'exécution veut ajuster l'adresse du segment réseau du pod
- 聊聊SOC启动(十) 内核启动先导知识
- What is cloud computing?
- 禁锢自己的因素,原来有这么多
- ‘module‘ object is not callable错误
- STM32入门开发 NEC红外线协议解码(超低成本无线传输方案)
- SwiftUI 4 新功能之掌握 WeatherKit 和 Swift Charts
- Two week selection of tdengine community issues | phase II
- 常用sql语句整理:mysql
猜你喜欢
![Verilog design responder [with source code]](/img/91/6359a2f3fa0045b4a88956a475488c.png)
Verilog design responder [with source code]

electron添加SQLite数据库

Solve the problem that vscode can only open two tabs

Automated testing framework

OneDNS助力高校行业网络安全

使用MeterSphere让你的测试工作持续高效

Half of the people don't know the difference between for and foreach???

聊聊SOC启动(六)uboot启动流程二

Activity lifecycle

聊聊SOC启动(九) 为uboot 添加新的board
随机推荐
科普达人丨一文弄懂什么是云计算?
Talk about SOC startup (x) kernel startup pilot knowledge
Unsupervised learning of visual features by contracting cluster assignments
STM32F1与STM32CubeIDE编程实例-315M超再生无线遥控模块驱动
竟然有一半的人不知道 for 与 foreach 的区别???
Onedns helps college industry network security
聊聊SOC启动(七) uboot启动流程三
Apprentissage comparatif non supervisé des caractéristiques visuelles par les assignations de groupes de contrôle
QT | multiple windows share a prompt box class
清华姚班程序员,网上征婚被骂?
R语言使用quantile函数计算评分值的分位数(20%、40%、60%、80%)、使用逻辑操作符将对应的分位区间(quantile)编码为分类值生成新的字段、strsplit函数将学生的名和姓拆分
0.96 inch IIC LCD driver based on stc8g1k08
Internet Protocol
正在運行的Kubernetes集群想要調整Pod的網段地址
相机标定(2): 单目相机标定总结
自律,提升自制力原来也有方法
通过环境变量将 Pod 信息呈现给容器
SwiftUI Swift 内功之如何在 Swift 中进行自动三角函数计算
Technology sharing | packet capturing analysis TCP protocol
Software design - "high cohesion and low coupling"