当前位置:网站首页>Flutter draws animation effects of wave movement, curves and line graphs
Flutter draws animation effects of wave movement, curves and line graphs
2022-07-05 13:10:00 【Ma Nong on the island】
brief introduction
Last one use Flutter Of Canvas Draw some interesting graphics We introduced the use of CustomPaint Draw custom shapes , You can see the mathematical calculation method of plane drawing with graphics , We can draw the desired shape . In this article, we will introduce the drawing of line graphics , And combine it with Animation The common wave effect is realized . Through this article , You can see that :
- The drawing of sinusoids
- Use two sinusoids plus
Animation
Realize wave dynamic effect - General drawing method of curve
- Line drawing
Here's the final rendering , Next, let's introduce one by one .
Sine curve drawing
For sinusoids , The formula is defined as follows :
For drawing on the screen , Because the points on the screen are discrete , Therefore, it is actually sampling the sinusoidal curve , As long as the sampling interval is dense enough , The effect drawn is difficult to distinguish with the naked eye. It is drawn through connecting lines between discrete points . therefore , To draw a sinusoidal curve is to connect the points of the sinusoidal curve in turn . The following is the implementation code drawn ,waveHeight
Is the amplitude of the sine curve , Here we draw a period with a screen width , So what we use is 2 * pi * i / size.width
.
边栏推荐
- MySQL splits strings for conditional queries
- Asemi rectifier bridge hd06 parameters, hd06 pictures, hd06 applications
- How to choose note taking software? Comparison and evaluation of notion, flowus and WOLAI
- 蜀天梦图×微言科技丨达梦图数据库朋友圈+1
- leetcode:221. 最大正方形【dp状态转移的精髓】
- HiEngine:可媲美本地的云原生内存数据库引擎
- Navigation property and entityset usage in SAP segw transaction code
- ##无监控,不运维,以下是监控里常用的脚本监控
- 初次使用腾讯云,解决只能使用webshell连接,不能使用ssh连接。
- Actual combat simulation │ JWT login authentication
猜你喜欢
SAP UI5 DynamicPage 控件介绍
What is the difference between Bi software in the domestic market
Principle and performance analysis of lepton lossless compression
SAP SEGW 事物码里的 ABAP Editor
How to protect user privacy without password authentication?
How to realize batch sending when fishing
Changing JS code has no effect
自然语言处理系列(一)入门概述
Navigation property and entityset usage in SAP segw transaction code
【服务器数据恢复】某品牌服务器存储raid5数据恢复案例
随机推荐
Principle and configuration of RSTP protocol
155. Minimum stack
关于 SAP UI5 floating footer 显示与否的单步调试以及使用 SAP UI5 的收益
uni-app开发语音识别app,讲究的就是简单快速。
同事半个月都没搞懂selenium,我半个小时就给他整明白!顺手秀了一波爬淘宝的操作[通俗易懂]
SAE international strategic investment geometry partner
数据泄露怎么办?'华生·K'7招消灭安全威胁
Sorry, we can't open xxxxx Docx, because there is a problem with the content (repackaging problem)
使用 jMeter 对 SAP Spartacus 进行并发性能测试
简单上手的页面请求和解析案例
关于 SAP UI5 getSAPLogonLanguage is not a function 的错误消息以及 API 版本的讨论
JXL notes
#从源头解决# 自定义头文件在VS上出现“无法打开源文件“XX.h“的问题
Rocky基础命令3
PyCharm安装第三方库图解
Hundred days to complete the open source task of the domestic database opengauss -- openguass minimalist version 3.0.0 installation tutorial
Compile kernel modules separately
RHCSA8
A specific example of ABAP type and EDM type mapping in SAP segw transaction code
Shi Zhenzhen's 2021 summary and 2022 outlook | colorful eggs at the end of the article