当前位置:网站首页>SwiftUI Swift 内功之如何在 Swift 中进行自动三角函数计算
SwiftUI Swift 内功之如何在 Swift 中进行自动三角函数计算
2022-07-07 09:46:00 【知识大胖】
没有人喜欢数学,这是事实。那么我们能做些什么来完全消除它从我们的生活中呢?不,这不是机器人。也许有一天我也会写这些。谁知道!但就目前而言,您将不得不解决函数和公式。
准备好离开过去的计算器了吗?让我们看看如何为我们的项目简化三角函数。
原则
对于那些对三角学不太熟悉的人,让我引用另一个教程中的自己,就像一个绝对以自我为中心的书呆子(尽管实际上这只是懒惰):
基本上,在直角三角形中,您可以计算三角形边的长度,前提是您至少:
- 一个角度的度数(在我们的例子中,我用黄色突出显示的那个),
- 和大小三边之一(在我们的例子中,蓝色虚线)。
从图中可以看出,这个逻辑可以应用到我们中间按钮周围的一个不可见的圆圈中,通过用图中的公式计算 x 和 y 值来定义三个按钮(绿色)的位置。

这个理论对于任何涉及圆圈的架构都是有用的。例如,在那个教程中,我正在解释如何以圆心为起点确定图片中绿点的位置,以便我可以将它们作为三个UIButtons 位置的中心。
三角学告诉我们:
- sin θ = 对边 / 斜边
- cos θ = 相邻 / 斜边
- tan θ = 对边/相邻边
如果你看上面的图片,“θ”是黄色的角度,“x”是相邻的边&
边栏推荐
- Some opinions and code implementation of Siou loss: more powerful learning for bounding box regression zhora gevorgyan
- What development models did you know during the interview? Just read this one
- 关于测试人生的一站式发展建议
- STM32入门开发 编写DS18B20温度传感器驱动(读取环境温度、支持级联)
- MySQL安装常见报错处理大全
- Two week selection of tdengine community issues | phase II
- Using ENSP to do MPLS pseudo wire test
- 對比學習之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments
- Software design - "high cohesion and low coupling"
- 互联网协议
猜你喜欢

Electron adding SQLite database
![Drive HC based on de2115 development board_ SR04 ultrasonic ranging module [source code attached]](/img/ed/29d6bf21f857ec925bf425ad594e36.png)
Drive HC based on de2115 development board_ SR04 ultrasonic ranging module [source code attached]

Leetcode - interview question 17.24 maximum submatrix

Some opinions and code implementation of Siou loss: more powerful learning for bounding box regression zhora gevorgyan
![Verilog realizes nixie tube display driver [with source code]](/img/ad/be94912bedc738f4b5f97138db7352.png)
Verilog realizes nixie tube display driver [with source code]

There are so many factors that imprison you

La voie du succès de la R & D des entreprises Internet à l’échelle des milliers de personnes

高考作文,高频提及科技那些事儿……

关于SIoU《SIoU Loss: More Powerful Learning for Bounding Box Regression Zhora Gevorgyan 》的一些看法及代码实现

How much do you know about excel formula?
随机推荐
sql里,我想设置外键,为什么出现这个问题
QT implements the delete method of the container
The Oracle message permission under the local Navicat connection liunx is insufficient
RationalDMIS2022阵列工件测量
Leetcode - interview question 17.24 maximum submatrix
千人规模互联网公司研发效能成功之路
STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于SPI)
科普达人丨一文弄懂什么是云计算?
简单介绍一下闭包及它的一些应用场景
What is high cohesion and low coupling?
. Net Maui performance improvement
R语言可视化分面图、假设检验、多变量分组t检验、可视化多变量分组分面箱图(faceting boxplot)并添加显著性水平、添加抖动数据点(jitter points)
What is cloud computing?
Android 面试知识点
Cmu15445 (fall 2019) project 2 - hash table details
R語言使用magick包的image_mosaic函數和image_flatten函數把多張圖片堆疊在一起形成堆疊組合圖像(Stack layers on top of each other)
自律,提升自制力原来也有方法
使用MeterSphere让你的测试工作持续高效
Test the foundation of development, and teach you to prepare for a fully functional web platform environment
Verilog design responder [with source code]