当前位置:网站首页>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 &
边栏推荐
- Design intelligent weighing system based on Huawei cloud IOT (STM32)
- sink 消费 到 MySQL, 数据库表里面已经设置了 自增主键, flink 里面,如何 操作?
- 0.96 inch IIC LCD driver based on stc8g1k08
- Talk about SOC startup (VII) uboot startup process III
- Various uses of vim are very practical. I learned and summarized them in my work
- electron添加SQLite数据库
- Table replication in PostgreSQL
- 互联网协议
- 【纹理特征提取】基于matlab局部二值模式LBP图像纹理特征提取【含Matlab源码 1931期】
- Stm32f1 and stm32subeide programming example -max7219 drives 8-bit 7-segment nixie tube (based on SPI)
猜你喜欢

自动化测试框架
![[system design] index monitoring and alarm system](/img/8e/9c4c168f7f2b8e1f0786a5fe158544.png)
[system design] index monitoring and alarm system

【系统设计】指标监控和告警系统

聊聊SOC启动(九) 为uboot 添加新的board

对比学习之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments

请查收.NET MAUI 的最新学习资源

相机标定(1): 单目相机标定及张正友标定基本原理

Distributed database master-slave configuration (MySQL)

The Oracle message permission under the local Navicat connection liunx is insufficient

一起探索云服务之云数据库
随机推荐
深度学习秋招面试题集锦(一)
通过环境变量将 Pod 信息呈现给容器
R语言可视化分面图、假设检验、多变量分组t检验、可视化多变量分组分面箱图(faceting boxplot)并添加显著性水平、添加抖动数据点(jitter points)
OneDNS助力高校行业网络安全
QT | multiple windows share a prompt box class
面试被问到了解哪些开发模型?看这一篇就够了
互联网协议
Briefly introduce closures and some application scenarios
Distributed database master-slave configuration (MySQL)
常用sql语句整理:mysql
请查收.NET MAUI 的最新学习资源
sql里,我想设置外键,为什么出现这个问题
【问道】编译原理
In depth learning autumn recruitment interview questions collection (1)
SwiftUI Swift 内功之如何在 Swift 中进行自动三角函数计算
R language uses the quantile function to calculate the quantile of the score value (20%, 40%, 60%, 80%), uses the logical operator to encode the corresponding quantile interval (quantile) into the cla
Enclosed please find. Net Maui's latest learning resources
一度辍学的数学差生,获得今年菲尔兹奖
Qt 实现容器的DELETE的方式
STM32入门开发 采用IIC硬件时序读写AT24C08(EEPROM)