当前位置:网站首页>C, calculation code of parameter points of two-dimensional Bezier curve
C, calculation code of parameter points of two-dimensional Bezier curve
2022-04-23 12:34:00 【Deep confusion】
Bézier The algorithm is used for curve fitting and interpolation .
Interpolation is the numerical value calculated by a function or group of functions Completely through Given point .
Fitting is the numerical value calculated by a function or group of functions Try to pass Given point .
Here is given A two-dimensional Bézier Parameter point calculation code of curve fitting .
Different from another pronunciation close to Bessel interpolation algorithm (Bessel's interpolation) Ha ! Germany , The French .
class Point
{
double X;
double Y;
}
public Point GetBezierPoint(double t, Point p0, Point p1, Point p2, Point
p3)
{
double cx = 3 * (p1.X - p0.X);
double bx = 3 * (p2.X - p1.X) - cx;
double ax = p3.X - p0.X - cx - bx;
double cy = 3 * (p1.Y - p0.Y);
double by = 3 * (p2.Y - p1.Y) - cy;
double ay = p3.Y - p0.Y - cy - by;
double tCubed = t * t * t;
double tSquared = t * t;
double resultX = (ax * tCubed) + (bx * tSquared) + (cx * t) + p0.X;
double resultY = (ay * tCubed) + (by * tSquared) + (cy * t) + p0.Y;
return new Point((int)resultX, (int)resultY);
}
——————————————————————
POWER BY 315SOFT.COM &
TRUFFER.CN
版权声明
本文为[Deep confusion]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231226311048.html
边栏推荐
- [redis series] redis learning 13. Redis often asks simple interview questions
- 洛谷P3236 [HNOI2014]画框 题解
- 万事有你 未来可期 | ONES 2022校园招聘正式开启
- How to switch PHP version in Windows 2008 system
- 对称加密、证书加密
- Introduction to metalama 4 Use fabric to manipulate items or namespaces
- Here comes the detailed picture and text installation tutorial of H5 game
- c# 设置logo图标和快捷方式的图标
- 航芯技术分享 | ACM32 MCU安全特性概述
- How does sqlserver insert or update the number of weeks of the day instead of text
猜你喜欢
Idea setting copyright information
【vulnhub靶场】-dc2
航芯技术分享 | ACM32 MCU安全特性概述
远程桌面之终端服务器超出了最大允许连接数解决
S2-062 远程命令执行漏洞复现(cve-2021-31805)
VMware virtual machines export hard disk vmdk files using esxi
Nativeformysql connects to MySQL 8 prompt: 1251 - client does not support authentication protocol
Plato Farm-以柏拉图为目标的农场元宇宙游戏
万事有你 未来可期 | ONES 2022校园招聘正式开启
QT draw image
随机推荐
电脑系统卡如何解决?
One way ANOVA of SPSS
解锁OpenHarmony技术日!年度盛会,即将揭幕!
AI video cloud vs narrowband HD, who is the darling of the video era
数组---
Metalama简介4.使用Fabric操作项目或命名空间
Uni app native app cloud packaging integrated Aurora push (jg-jpush) detailed tutorial
On lambda powertools typescript
QT one process runs another
How to solve the computer system card?
5-minute NLP: text to text transfer transformer (T5) unified text to text task model
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
Outsourcing for five years, abandoned
Zigbee之CC2530最小系统及寄存器配置(1)
没有空闲服务器?导入 OVF 镜像快速体验 SmartX 超融合社区版
Message queuing overview
BUUCTF WEB [BJDCTF2020]ZJCTF,不过如此
STM32工程移植:不同型号芯片工程之间的移植:ZE到C8
软件测试对于减少程序BUG有多大帮助?
外包干了五年,废了...