当前位置:网站首页>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
边栏推荐
- Qt进程间通信
- Lesson 26 static member functions of classes
- Why is the premise of hash% length = = hash & (length-1) that length is the nth power of 2
- worder字体网页字体对照表
- 解锁OpenHarmony技术日!年度盛会,即将揭幕!
- 【每日一题】棋盘问题
- 关于使用Go语言创建WebSocket服务浅谈
- 天梯赛赛前练习
- mysql中 innoDB执行过程分析
- Introduction to metalama 4 Use fabric to manipulate items or namespaces
猜你喜欢
随机推荐
Array---
Markdown语法学习
Luogu p5540 [balkanoi2011] timeismoney | minimum product spanning tree problem solution
Uni app native app cloud packaging integrated Aurora push (jg-jpush) detailed tutorial
QT draw text
第二十五课 类的静态成员变量
Qt绘制图像
电脑系统卡如何解决?
Dialogue with Bruce, author of PostgreSQL: "changing careers" is to better move forward
编程辅助工具推荐:图片工具snipaste
[redis series] redis learning 13. Redis often asks simple interview questions
Solution of asynchronous clock metastability -- multi bit signal
SQL exercise (I)
Qt重绘事件与剪切
Idea code formatting plug-in save actions
实现一个盒子在父盒子中水平垂直居中的几种“姿势”
在 VSCode 中调试 Jest 的测试用例,VSCode调试Jest测试用例报错basedir=$(dirname “$(echo “$0“ | sed -e ‘s,\\,/,g‘)“)解决
Stacks and queues a
QT draw image
IDEA设置版权信息









