当前位置:网站首页>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 &
边栏推荐
- SwiftUI Swift 内功之 Swift 中使用不透明类型的 5 个技巧
- [Yugong series] go teaching course 005 variables in July 2022
- 通过环境变量将 Pod 信息呈现给容器
- TDengine 社区问题双周精选 | 第二期
- Tsinghua Yaoban programmers, online marriage was scolded?
- electron添加SQLite数据库
- 互联网协议
- STM32F1与STM32CubeIDE编程实例-315M超再生无线遥控模块驱动
- Neural approvals to conversational AI (1)
- LeetCode - 面试题17.24 最大子矩阵
猜你喜欢

CMU15445 (Fall 2019) 之 Project#2 - Hash Table 详解
![[system design] index monitoring and alarm system](/img/8e/9c4c168f7f2b8e1f0786a5fe158544.png)
[system design] index monitoring and alarm system

聊聊SOC启动(六)uboot启动流程二

Flet教程之 19 VerticalDivider 分隔符组件 基础入门(教程含源码)

普通测试年薪15w,测试开发年薪30w+,二者差距在哪?

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

面试被问到了解哪些开发模型?看这一篇就够了

【神经网络】卷积神经网络CNN【含Matlab源码 1932期】

Web端自动化测试失败的原因

Talk about SOC startup (VII) uboot startup process III
随机推荐
. Net Maui performance improvement
关于SIoU《SIoU Loss: More Powerful Learning for Bounding Box Regression Zhora Gevorgyan 》的一些看法及代码实现
Poor math students who once dropped out of school won the fields award this year
STM32 entry development write DS18B20 temperature sensor driver (read ambient temperature, support cascade)
Two week selection of tdengine community issues | phase II
Reasons for the failure of web side automation test
R语言使用quantile函数计算评分值的分位数(20%、40%、60%、80%)、使用逻辑操作符将对应的分位区间(quantile)编码为分类值生成新的字段、strsplit函数将学生的名和姓拆分
博客搬家到知乎
Use metersphere to keep your testing work efficient
《论文阅读》Neural Approaches to Conversational AI(1)
【滤波跟踪】基于matlab扩展卡尔曼滤波EKF和无迹卡尔曼滤波UKF比较【含Matlab源码 1933期】
自律,提升自制力原来也有方法
网络协议 概念
Internet Protocol
关于在云服务器上(这里用腾讯云)安装mysql8.0并使本地可以远程连接的方法
科普达人丨一文弄懂什么是云计算?
EasyUI learn to organize notes
Cmu15445 (fall 2019) project 2 - hash table details
audit 移植
Neural approvals to conversational AI (1)