当前位置:网站首页>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
边栏推荐
- 航芯技术分享 | ACM32 MCU安全特性概述
- QT draw image
- On lambda powertools typescript
- uni-app 原生APP-云打包集成极光推送(JG-JPUSH)详细教程
- Uni app native app cloud packaging integrated Aurora push (jg-jpush) detailed tutorial
- 九十八、freemarker框架报错 s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request
- Tips for installing MySQL service in windows11: Install / Remove of the Service denied
- Realize several "Postures" in which a box is horizontally and vertically centered in the parent box
- How to expand the capacity of the server in the 100 million level traffic architecture? Well written!
- Number of nodes of complete binary tree
猜你喜欢

面了一圈,整理了这套面试题。。

QT draw image

Zigbee之CC2530最小系统及寄存器配置(1)

Qt绘制文字

Idea setting copyright information

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

SPSS之单因素方差分析

mysql中 innoDB执行过程分析

Worder font page font comparison table

Please help me see what this is, mysql5 5. Thanks
随机推荐
实现一个盒子在父盒子中水平垂直居中的几种“姿势”
Metalama简介4.使用Fabric操作项目或命名空间
【vulnhub靶场】-dc2
MySQL函数-递归函数
Stacks and queues a
Number of nodes of complete binary tree
flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
Qt绘制图像
Introduction to metalama 4 Use fabric to manipulate items or namespaces
SynchronousQueue 源码解析
SQL exercise (I)
Symmetric encryption, certificate encryption
Uni app native app cloud packaging integrated Aurora push (jg-jpush) detailed tutorial
How do traditional enterprises cope with digital transformation? These books give you the answer
BUUCTF WEB [BJDCTF2020]ZJCTF,不过如此
Why is the premise of hash% length = = hash & (length-1) that length is the nth power of 2
Pagoda panel command line help tutorial (including resetting password)
Qt进程间通信
S2-062 remote command execution vulnerability recurrence (cve-2021-31805)
软件测试基础DAY2-用例执行