-
贝塞尔曲线算法
构建三次贝塞尔曲线 C0,......,Cn-1 中
参数形式,Ci 由
(xi(t),yi(t)) = (a0(i) + a1 (i) * t + a2 (i) * t ^2 + a3 (i) * t ^3,
b0(i) + b1 (i) * t + b2 (i) * t ^2 + b3(i)*t^3)
0 为 < = t < = 1 由左终结点 (x(i),y(i)),
离开了 guidepoint (x+(i),y+(i))、 右端点 (x(i+1),y(i+1)) 和
右 guidepoint (为每个 i x-(i+1),y-(i+1)) = 0,1,......,n-1 ;
输入的 n,((x(i),y(i)),我 = 0,...,n),
((x+(i),y+(i)),我 = 0,...,n-1),
((x-(i),y-(i)),我 = 1,...,n)。
输出系数 (a0(i)、 a1(i)、 a2(i)、 a3(i)、
b0(i)、 b1(i)、 b2(i)、 b3(i)、 我 = 0,...,n-1)。
- 2022-02-16 09:27:40下载
- 积分:1
-
apriori算法C++实现
资源描述数据挖掘中的关联规则发现算法——apriori的c++实现。数据输入是在窗口中输入,根据提示即可。注意事项:1.除了最后的阈值设定为小树(小于1大于0),其余全部为整数。中间事务的输入用空格隔开。建议3个以内。
- 2022-07-17 19:28:10下载
- 积分:1
-
jpeg source code
JPEG组织官方JPEG算法源代码,内含编码和解码,包括JPEG, JPEG2000, BMP, PNM等等格式的编解码,精度准确,经过实际编译测试,代码可用。
- 2023-09-07 13:55:06下载
- 积分:1
-
蚁群算法解决TSP旅游商问题
function [R_best,L_best,L_ave,Shortest_Route,Shortest_Length]=ACATSP(C,NC_max,m,Alpha,Beta,Rho,Q)%%-------------------------------------------------------------------------%% 主要符号说明%% C n个城市的坐标,n×2的矩阵%% NC_max 最大迭代次数%% m 蚂蚁个数%% Alpha 表征信息素重要程度的参数%% Beta 表征启发式因子重要程度的参数%% Rho 信息素蒸发系数%% Q 信息素增加强度系数%% R_best 各代最佳路线%% L_best 各代最佳路线的长度%%========================================================================= %%第一步:变量初始化n=size(C,1);%n表示问题的规模(城市个数)D=zeros(n,n);%D表示完全图的赋权邻接矩阵for i=1:nfor j=1:nif i~=jD(i,j)=((C(i,1)-C(j,1))^2+(C(i,2)-C(j,2))^2)^0.5;elseD(i,j)=eps; %i=j时不计算,应该为0,但后面的启发因子要取倒数,用eps(浮点相对精度)表示endD(j,i)=D(i,j); %对称矩阵endend%{1.C就是城市坐标 x y城市1 0
- 2022-08-25 13:59:52下载
- 积分:1
-
The cart with an inverted pendulum, shown below, is "bumped" with an impulse
f...
The cart with an inverted pendulum, shown below, is "bumped" with an impulse
force, F. Determine the dynamic equations of motion for the system, and lin
earize about the pendulum s angle, theta = Pi (in other words, assume that p
endulum does not move more than a few degrees away from the vertical, chosen
to be at an angle of Pi). Find a controller to satisfy all of the design re
quirements given below.
-The cart with an inverted pendulum, shown below, is "bumped" with an impulse force, F. Determine the dynamic equations of motion for the system, and lin earize about the pendulum s angle, theta = Pi (in other words, assume that p endulum does not move more than a few degrees away from the vertical, chosen to be at an angle of Pi). Find a controller to satisfy all of the design re quirements given below.
- 2022-03-17 02:37:20下载
- 积分:1
-
基于粒子群算法的PID控制器
粒子群算法与 Simulink 模型之间连接的桥梁是粒子(即 PID 控制器参数)和该粒子对应的适
应值(即控制系统的性能指标)。优化过程如下:PSO 产生粒子群(可以是初始化粒子群,也可以是更新后的粒子群),将该粒子群中的粒子依次赋值给 PID 控制器的参数 Kp、Ki、Kd,然后运行控制系统的Simulink 模型,得到该组参数对应的性能指标,该性能指标传递到 PSO中作为该粒子的适应值,最后判断是否可以退出算法。
- 2023-03-31 13:00:03下载
- 积分:1
-
Lifitime tracer.
*****************************************************
Example...
Lifitime tracer.
*** *** *** *** *** *** *** *** *****
Example:
#include
void foo()
{
TRACE_LIFETIME
usleep(100000)
}
void main()
{
foo()
}
*** *** *** *** *** *** *** *** ***
See lifetimes.log:
FUNC: void foo(), AV TTL: 00000xxxxx us (main.cpp, 000xxx)
TTL: 00000xxxxx us (THREAD ID: 0000xxxx)
******************************************************
Explanation of newly created lifetimes.log:
FUNC - function, whose lifetime we measured
AV TTL - mean (average) spent time of all functions calls
TTL - time spent on each function call
THREAD ID - thread that called a function.
*****************************************************
Description:
- was written for QT project
- multithreaded support (Loki::Singleton has multithreaded sync support)
****************************************************
Dependencies:
- QT
- Loki (A. Alexandrescu)
-Lifitime tracer.
****************************************************
- 2022-02-13 17:25:56下载
- 积分:1
-
简单好用的hog源码
hog的matlab代码实现。将RGB图像直接转换为灰度图像,省略了三线性差值的步骤。一个cell为8*8像素区域,采用9个Bin的直方图描述,每个block包含2*2个cell。整幅图像包含扫描窗口数目:水平:(width-block)/(overlap*2*8)+1.
- 2022-11-16 11:15:04下载
- 积分:1
-
基本矩阵运算 : +
基本矩阵运算 : + - *, power, transpose, trace, determinant, minor, matrix of minor, cofactor, matrix of cofactor, adjoint, inverse, gauss, gaussjordan, linear transformation, LU decomposition , Gram-Schmidt process, similarity. b) Basic vectors functions : norm, distance, innerproduct,coldim, rowdim, rank, nullity. *-basic matrix calculation :-*, power, transpose, trace, determinant, minor, matrix of minor, cofactor, the matrix of cofactor, adjoint, inverse, Gauss, gaussjordan, linear transformation, LU decomposition, Gram-Schmidt process, the similarity. B ) Basic vectors functions : norm, distance, innerproduct, coldim, rowdim, rank, nullity.*
- 2022-07-09 08:21:12下载
- 积分:1
-
基于颜色的人脸检测
face detection based on color
- 2023-05-05 19:25:03下载
- 积分:1