当前位置:网站首页>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
边栏推荐
- flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
- Debug Jest test cases in VSCode, debug Jest test cases in VSCode, middle note basedir=$(dirname "$" (echo "$0" sed -e -e, s, \ \, / "-e").
- 万事有你 未来可期 | ONES 2022校园招聘正式开启
- 关于使用Go语言创建WebSocket服务浅谈
- Array---
- Outsourcing for five years, abandoned
- STM32CubeProgrammer基础使用说明
- Tips for installing MySQL service in windows11: Install / Remove of the Service denied
- 在 VSCode 中调试 Jest 的测试用例,VSCode调试Jest测试用例报错basedir=$(dirname “$(echo “$0“ | sed -e ‘s,\\,/,g‘)“)解决
- Qt一个进程运行另一个进程
猜你喜欢
九十八、freemarker框架报错 s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request
A graphic designer's fantasy world | ones characters
初探 Lambda Powertools TypeScript
电脑系统卡如何解决?
QT draw text
Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years
解锁OpenHarmony技术日!年度盛会,即将揭幕!
Step function of activation function
Qt一个进程运行另一个进程
QT draw image
随机推荐
QT redraw events and cuts
外包干了五年,废了...
uni-app 原生APP-本地打包集成极光推送(JG-JPUSH)详细教程
Basic software testing Day2 - Case Execution
A graphic designer's fantasy world | ones characters
Hard core parsing promise object (do you know these seven common APIs and seven key questions?)
RT-thread中关键词解释及部分API
Stm32cubeprogrammer basic instructions
基于卷积神经网络的遥感影像分类识别系统
STM32CubeProgrammer基础使用说明
Symmetric encryption, certificate encryption
Relu function of activation function
SynchronousQueue 源码解析
XinChaCha Trust SSL Organization Validated
flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
Idea code quality specification plug-in sonarlint
SQLserver怎么插入或更新当天的星期数,bit而不是文本
Interpretation 3 of gdpr series: how do European subsidiaries return data to domestic parent companies?
【Redis 系列】redis 学习十三,Redis 常问简单面试题
对话PostgreSQL作者Bruce:“转行”是为了更好地前行