当前位置:网站首页>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 &
边栏推荐
- Talk about SOC startup (x) kernel startup pilot knowledge
- 普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
- STM32F1与STM32CubeIDE编程实例-315M超再生无线遥控模块驱动
- [encapsulation of time format tool functions]
- Cmu15445 (fall 2019) project 2 - hash table details
- Unsupervised learning of visual features by contracting cluster assignments
- 【神经网络】卷积神经网络CNN【含Matlab源码 1932期】
- 自动化测试框架
- R语言使用quantile函数计算评分值的分位数(20%、40%、60%、80%)、使用逻辑操作符将对应的分位区间(quantile)编码为分类值生成新的字段、strsplit函数将学生的名和姓拆分
- 清华姚班程序员,网上征婚被骂?
猜你喜欢
Reasons for the failure of web side automation test
Solve the problem that vscode can only open two tabs
请查收.NET MAUI 的最新学习资源
.NET MAUI 性能提升
About the application of writing shell script JSON in JMeter
【神经网络】卷积神经网络CNN【含Matlab源码 1932期】
How to write test cases for test coupons?
【最短路】Acwing1128信使:floyd最短路
How much do you know about excel formula?
[system design] index monitoring and alarm system
随机推荐
electron添加SQLite数据库
SwiftUI 4 新功能之掌握 WeatherKit 和 Swift Charts
Talk about SOC startup (IX) adding a new board to uboot
聊聊SOC启动(十一) 内核初始化
简单介绍一下闭包及它的一些应用场景
Drive HC based on de2115 development board_ SR04 ultrasonic ranging module [source code attached]
In depth learning autumn recruitment interview questions collection (1)
STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于SPI)
'module 'object is not callable error
Cmu15445 (fall 2019) project 2 - hash table details
使用引用
Table replication in PostgreSQL
Creative information was surveyed by 2 institutions: greatdb database has been deployed in 9 places
EasyUI learn to organize notes
Audit migration
自律,提升自制力原来也有方法
Distributed database master-slave configuration (MySQL)
How to add aplayer music player in blog
SwiftUI Swift 内功之如何在 Swift 中进行自动三角函数计算
正在运行的Kubernetes集群想要调整Pod的网段地址