Making lines between data points smoother.

2 ビュー (過去 30 日間)
Michael Neal
Michael Neal 2012 年 5 月 1 日
Hey guys, My friend and I are developing a tool that plots the shape of a propeller when the user inputs the pitch at 10 segments of the blade. We are generating the plots with a large number of data points. Our goal is to make a set of data points flow between the 10 segments defined by the user. The issue is that we were using the polynomial best fit to the highest degree but it freaks out if the pitches differ too much. Are there any ways to make the parts of the blade connect in a more ideal manner?
  1 件のコメント
Richard Brown
Richard Brown 2012 年 5 月 1 日
Are the lines in 2D or 3D?

サインインしてコメントする。

回答 (1 件)

Geoff
Geoff 2012 年 5 月 1 日
Perhaps you're looking for something like spline. I believe the entire notion of splines was invented by a boat-builder. =)
% Approximate a circle.
A = 0:30:360;
x = cosd(A);
y = sind(A);
% Represent the data as splines
sx = spline(A,x);
sy = spline(A,y);
% Interpolate the splines at 1-degree intervals
S = 0:360;
xx = ppval(sx,S);
yy = ppval(sy,S);
% Display the before and after
plot(x, y, 'r.-.');
hold on;
plot(xx,yy);
hold off;
legend('Original', 'Interpolated');
  1 件のコメント
Geoff
Geoff 2012 年 5 月 1 日
Note: This approach works in any number of dimensions.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSplines についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by