当前位置:网站首页>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
边栏推荐
- Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years
- Recommended programming AIDS: picture tool snipaste
- 在 VSCode 中调试 Jest 的测试用例,VSCode调试Jest测试用例报错basedir=$(dirname “$(echo “$0“ | sed -e ‘s,\\,/,g‘)“)解决
- 同态加密技术学习
- Lesson 24 analysis of classical problems
- VMware virtual machines export hard disk vmdk files using esxi
- STM32控制步进电机(ULN2003+28byj)
- Stm32cubeprogrammer basic instructions
- Next. JS static data generation and server-side rendering
- MySQL function - recursive function
猜你喜欢

Debug Jest test cases in VSCode, debug Jest test cases in VSCode, middle note basedir=$(dirname "$" (echo "$0" sed -e -e, s, \ \, / "-e").

worder字体网页字体对照表

The database navigator uses the default MySQL connection prompt: the server time zone value 'Ö Ð¹ ú±ê ×¼ ʱ ¼ ä’ is unrecognized or repres

同态加密技术学习

Win10 splash screen after startup

Tips for installing MySQL service in windows11: Install / Remove of the Service denied

Idea code quality specification plug-in sonarlint

SQL 练习(一)

How to expand the capacity of the server in the 100 million level traffic architecture? Well written!

IDEA 中 .properties文件的中文显示乱码问题的解决办法
随机推荐
S2-062 远程命令执行漏洞复现(cve-2021-31805)
AD20补充笔记3—快捷键+持续更新
Step function of activation function
The maximum number of remote desktop servers has been exceeded
SynchronousQueue 源码解析
What is a gateway
Here comes the detailed picture and text installation tutorial of H5 game
AI video cloud vs narrowband HD, who is the darling of the video era
How does sqlserver insert or update the number of weeks of the day instead of text
Array---
flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
SQL 练习(一)
One way ANOVA of SPSS
Tan Xiang, CEO of Kechuang · Pera software: the essence of zero trust is digital security. To B should also deeply study the user's mind
为什么hash%length==hash&(length-1)的前提是 length 是 2 的 n 次方
uni-app 原生APP-云打包集成极光推送(JG-JPUSH)详细教程
S2-062 remote command execution vulnerability recurrence (cve-2021-31805)
Next.js 静态数据生成以及服务端渲染的方式
VMware virtual machines export hard disk vmdk files using esxi
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]