当前位置:网站首页>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
边栏推荐
- Markdown grammar learning
- SQL exercise (I)
- 没有空闲服务器?导入 OVF 镜像快速体验 SmartX 超融合社区版
- 如何防止网站被黑客入侵篡改
- STM32控制步进电机(ULN2003+28byj)
- What is a gateway
- Why is there a wrapper class? By the way, how to convert basic data types, wrapper classes and string classes?
- 九十八、freemarker框架报错 s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request
- box-sizing
- AI video cloud vs narrowband HD, who is the darling of the video era
猜你喜欢

Number of nodes of complete binary tree

A graphic designer's fantasy world | ones characters

CGC: contractual graph clustering for community detection and tracking

QT draw text

The maximum number of remote desktop servers has been exceeded

Next. JS static data generation and server-side rendering

Metalama简介4.使用Fabric操作项目或命名空间

Basic software testing Day2 - Case Execution

Running error: unable to find or load the main class com xxx. Application

Idea code quality specification plug-in sonarlint
随机推荐
BUUCTF WEB [BJDCTF2020]ZJCTF,不过如此
box-sizing
Metalama简介4.使用Fabric操作项目或命名空间
QT draw image
box-sizing
SSL证书退款说明
c# 设置logo图标和快捷方式的图标
31岁才转行程序员,目前34了,我来说说我的经历和一些感受吧...
MySQL函数-递归函数
AI 视频云 VS 窄带高清,谁是视频时代的宠儿
Why is there a wrapper class? By the way, how to convert basic data types, wrapper classes and string classes?
数组---
Labels and paths
栈和队列a
万事有你 未来可期 | ONES 2022校园招聘正式开启
免费试用一个月的服务器,并附上教程
MySQL function - recursive function
【Redis 系列】redis 学习十三,Redis 常问简单面试题
Introduction to metalama 4 Use fabric to manipulate items or namespaces
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]