当前位置:网站首页>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 &
边栏推荐
- Solve the problem that vscode can only open two tabs
- STM32 entry development write DS18B20 temperature sensor driver (read ambient temperature, support cascade)
- Onedns helps college industry network security
- 【最短路】ACwing 1127. 香甜的黄油(堆优化的dijsktra或spfa)
- 《论文阅读》Neural Approaches to Conversational AI(1)
- 面试被问到了解哪些开发模型?看这一篇就够了
- [encapsulation of time format tool functions]
- 正在運行的Kubernetes集群想要調整Pod的網段地址
- 聊聊SOC启动(十一) 内核初始化
- Web端自动化测试失败的原因
猜你喜欢
科普达人丨一文弄懂什么是云计算?
聊聊SOC启动(九) 为uboot 添加新的board
相机标定(2): 单目相机标定总结
基于华为云IOT设计智能称重系统(STM32)
请查收.NET MAUI 的最新学习资源
Talk about SOC startup (IX) adding a new board to uboot
Programming examples of stm32f1 and stm32subeide -315m super regenerative wireless remote control module drive
正在運行的Kubernetes集群想要調整Pod的網段地址
.NET MAUI 性能提升
Nuclear boat (I): when "male mothers" come into reality, can the biotechnology revolution liberate women?
随机推荐
Common SQL statement collation: MySQL
STM32 entry development uses IIC hardware timing to read and write AT24C08 (EEPROM)
‘module‘ object is not callable错误
Verilog realizes nixie tube display driver [with source code]
博客搬家到知乎
相机标定(1): 单目相机标定及张正友标定基本原理
QT | multiple windows share a prompt box class
什么是高内聚、低耦合?
Distributed database master-slave configuration (MySQL)
QT implements the delete method of the container
SwiftUI Swift 内功之 Swift 中使用不透明类型的 5 个技巧
一起探索云服务之云数据库
audit 移植
Qt|多个窗口共有一个提示框类
Poor math students who once dropped out of school won the fields award this year
Design intelligent weighing system based on Huawei cloud IOT (STM32)
正在运行的Kubernetes集群想要调整Pod的网段地址
Case study of Jinshan API translation function based on retrofit framework
Have you ever met flick Oracle CDC, read a table without update operation, and read it repeatedly every ten seconds
The database synchronization tool dbsync adds support for mongodb and es