MATLAB Answers

0

how to plot random points in airfoil wing

Asked by rakesh maled on 13 Jun 2019
Latest activity Commented on by rakesh maled on 20 Jun 2019
Accepted Answer by KSSV
I want to plot random points on the airfoil wing of naca 4415. How can i approach this problem. I want these points in order to run an optimizations for locating points of a fixtures? please help

  4 Comments

Show 1 older comment
@kalyan
my question is i have an airfoil wing and i want to locate random points say like around 100 random points but with in the dimension of the airfoil. I want this points inorder to place locators , supporting units and clampers for a fixture.
hi rakesh,
are the points on the surface of the wing or inside the cross section?
Hi David,
the points are on the surface of the wing.

Sign in to comment.

Products


Release

R2018a

1 Answer

Answer by KSSV
on 14 Jun 2019
 Accepted Answer

Check this demo example. I have coded it keeping in mind how your data is. It is like you are provided with upper and lower curve of foil.
[X,Y,Z] = cylinder(1) ;
n = size(X,2) ;
m = 10 ;
t = linspace(0,1,m) ;
L = zeros(3,m,n) ;
% Draw line between points
for i = 1:n
P1 = [X(1,i) Y(1,i) Z(1,i)]' ;
P2 = [X(2,i) Y(2,i) Z(2,i)]' ;
L(:,:,i) = P1+(P2-P1).*t ;
end
XX = squeeze(L(1,:,:)) ;
YY = squeeze(L(2,:,:)) ;
ZZ = squeeze(L(3,:,:)) ;
% Select random p points
p = 100 ;
idx = randperm(numel(XX),p) ;
% display
surf(X,Y,Z)
hold on
plot3(XX(idx),YY(idx),ZZ(idx),'.r')

  1 Comment

Thanks KSSV,
will surely try the code given by you.

Sign in to comment.