当前位置:网站首页>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 &
边栏推荐
- Table replication in PostgreSQL
- [encapsulation of time format tool functions]
- Suggestions on one-stop development of testing life
- TDengine 社区问题双周精选 | 第二期
- Some opinions and code implementation of Siou loss: more powerful learning for bounding box regression zhora gevorgyan
- 测试优惠券要怎么写测试用例?
- 简单介绍一下闭包及它的一些应用场景
- VIM command mode and input mode switching
- R语言使用quantile函数计算评分值的分位数(20%、40%、60%、80%)、使用逻辑操作符将对应的分位区间(quantile)编码为分类值生成新的字段、strsplit函数将学生的名和姓拆分
- Flet教程之 19 VerticalDivider 分隔符组件 基础入门(教程含源码)
猜你喜欢

MySQL安装常见报错处理大全

STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于SPI)

Automated testing framework

LeetCode - 面试题17.24 最大子矩阵

Learning notes | data Xiaobai uses dataease to make a large data screen

正在运行的Kubernetes集群想要调整Pod的网段地址

Le Cluster kubernets en cours d'exécution veut ajuster l'adresse du segment réseau du pod

一起探索云服务之云数据库

禁锢自己的因素,原来有这么多

总结了200道经典的机器学习面试题(附参考答案)
随机推荐
自动化测试框架
总结了200道经典的机器学习面试题(附参考答案)
STM32 entry development NEC infrared protocol decoding (ultra low cost wireless transmission scheme)
大佬们有没有人遇到过 flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取
The road to success in R & D efficiency of 1000 person Internet companies
Talk about SOC startup (x) kernel startup pilot knowledge
There are ways to improve self-discipline and self-control
相机标定(2): 单目相机标定总结
About how to install mysql8.0 on the cloud server (Tencent cloud here) and enable local remote connection
Programming examples of stm32f1 and stm32subeide -315m super regenerative wireless remote control module drive
VIM command mode and input mode switching
0.96 inch IIC LCD driver based on stc8g1k08
Audit migration
【神经网络】卷积神经网络CNN【含Matlab源码 1932期】
正在运行的Kubernetes集群想要调整Pod的网段地址
Case study of Jinshan API translation function based on retrofit framework
Distributed database master-slave configuration (MySQL)
【最短路】ACwing 1127. 香甜的黄油(堆优化的dijsktra或spfa)
Drive HC based on de2115 development board_ SR04 ultrasonic ranging module [source code attached]
La voie du succès de la R & D des entreprises Internet à l’échelle des milliers de personnes