当前位置:网站首页>C#,二维贝塞尔拟合曲线(Bézier Curve)参数点的计算代码
C#,二维贝塞尔拟合曲线(Bézier Curve)参数点的计算代码
2022-04-23 12:26:00 【深度混淆】
Bézier 算法用于曲线的拟合与插值。
插值是一个或一组函数计算的数值完全经过给定的点。
拟合是一个或一组函数计算的数值尽量路过给定的点。
这里给出 二维 Bézier 曲线拟合的参数点计算代码。
区别于另外一种读音接近的贝塞耳插值算法(Bessel's interpolation)哈!德国,法国。
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
版权声明
本文为[深度混淆]所创,转载请带上原文链接,感谢
https://blog.csdn.net/beijinghorn/article/details/124267707
边栏推荐
- Qt绘制图像
- 栈和队列a
- Why is the premise of hash% length = = hash & (length-1) that length is the nth power of 2
- Worder font page font comparison table
- Xinwangda announced that the price of battery products had been increased, and the investment of "weixiaoli" exceeded 1 billion
- Everything can be expected in the future | one 2022 campus recruitment officially opened
- Idea database navigator plug-in
- Lesson 23 temporary objects
- IDEA 数据库插件Database Navigator 插件
- Fabric 1.0源代码分析(33) Peer #peer channel命令及子命令实现
猜你喜欢
Tips for installing MySQL service in windows11: Install / Remove of the Service denied
软件测试基础DAY2-用例执行
VMware virtual machines export hard disk vmdk files using esxi
Relu function of activation function
Dialogue with Bruce, author of PostgreSQL: "changing careers" is to better move forward
Pre competition practice of TIANTI competition
面了一圈,整理了这套面试题。。
STM32控制步进电机(ULN2003+28byj)
Plato Farm-以柏拉图为目标的农场元宇宙游戏
A graphic designer's fantasy world | ones characters
随机推荐
How do traditional enterprises cope with digital transformation? These books give you the answer
Lesson 26 static member functions of classes
Fabric 1.0 source code analysis (33) implementation of peer channel command and subcommand
The database navigator uses the default MySQL connection prompt: the server time zone value 'Ö Ð¹ ú±ê ×¼ ʱ ¼ ä’ is unrecognized or repres
第二十三课 临时对象
【unity笔记】L4Unity中的基础光照
Qt绘制图像
Pre competition practice of TIANTI competition
对话PostgreSQL作者Bruce:“转行”是为了更好地前行
Force buckle - 70 climb stairs
Introduction to metalama 4 Use fabric to manipulate items or namespaces
What is a gateway
Win10 splash screen after startup
软银愿景基金进军Web3安全行业 领投CertiK 6000万美元新一轮投资
[wechat applet] Z-index is invalid
异步时钟亚稳态 的解决方案——多bit信号
电脑系统卡如何解决?
One way ANOVA of SPSS
远程桌面之终端服务器超出了最大允许连接数解决
编程辅助工具推荐:图片工具snipaste