当前位置:网站首页>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 draw image
- How to switch PHP version in Windows 2008 system
- 5分钟NLP:Text-To-Text Transfer Transformer (T5)统一的文本到文本任务模型
- On using go language to create websocket service
- Plato Farm-以柏拉图为目标的农场元宇宙游戏
- 欣旺达宣布电池产品涨价 此前获“蔚小理”投资超10亿
- 网络信息安全之零信任
- SQLserver怎么插入或更新当天的星期数,bit而不是文本
- Qt一个进程运行另一个进程
- Recommended programming AIDS: picture tool snipaste
猜你喜欢
VMware virtual machines export hard disk vmdk files using esxi
Worder font page font comparison table
NativeForMySQL 连接MySQL8 提示:1251- Client does not support authentication protocol
【vulnhub靶场】-dc2
VMware虚拟机使用esxi 导出硬盘vmdk文件
同态加密技术学习
IDEA 代码格式化插件Save Actions
天梯赛赛前练习
Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years
On lambda powertools typescript
随机推荐
软件测试对于减少程序BUG有多大帮助?
天梯赛赛前练习
Fabric 1.0 source code analysis (33) implementation of peer channel command and subcommand
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
Introduction to metalama 4 Use fabric to manipulate items or namespaces
一个平面设计师的异想世界|ONES 人物
外包干了五年,废了...
Idea code quality specification plug-in sonarlint
Why is the premise of hash% length = = hash & (length-1) that length is the nth power of 2
Lesson 23 temporary objects
网络信息安全之零信任
QT interprocess communication
传统企业如何应对数字化转型?这些书给你答案
CGC: contractual graph clustering for community detection and tracking
对称加密、证书加密
What is a gateway
第二十三课 临时对象
Outsourcing for five years, abandoned
uni-app 原生APP-云打包集成极光推送(JG-JPUSH)详细教程
对话PostgreSQL作者Bruce:“转行”是为了更好地前行