Filter löschen
Filter löschen

can someone please solve the n no for polyshape object intersect with line-segment in intersect condition??

1 Ansicht (letzte 30 Tage)
clc
close all
clear variables
D = 164; %
[data]=xlsread('F:\Internship\Script3\layout.xlsx');
No.=data(:,1);
x = data(:,2);
y = data(:,3);
plot(x,y,'.');grid on
hold on
axis([-2000 5000 -2000 6500]);
axis equal
Dwy0 = numel(Dw);
Dwy = Dw(Dwy0);
B1x = data(:,2);
B2x = data(:,2)+2*7.*D;
B3x = data(:,2)+2*7.*D;
B4x = data(:,2);
B1y = data(:,3) + (D/2);
B2y = data(:,3) + (Dwy/2);
B3y = data(:,3) - (Dwy/2);
B4y = data(:,3) - (D/2);
rng default
xv = [B3x,B4x,B1x,B2x];% 4 points coordinates for wake effect
yv = [B3y,B4y,B1y,B2y];
plot(xv,yv,'b.')
C1x = B1x-0.1;
C4x = B4x-0.1;
C1y = B1y-0.1;
C4y = B4y-0.1;
x2v = [C1x,C4x];%coordinates of lines (the rotor diameter)
y2v = [C1y,C4y];
plot(x2v,y2v,'r.')
poly0 = polyshape([B3x B4x B1x B2x],[B3y B4y B1y B2y]);
lineseg0 = [C1x C1y ; C4x C4y];
hold on
[in,out] = intersect(poly0,lineseg0)
plot(poly0)
hold on
% if [in(:,1),in(:,2)]
% disp('yes')
% elseif[in1(:,1),in1(:,2)]
% disp('Yes1')
% else
% end
plot(in(:,1),in(:,2),'b',out(:,1),out(:,2),'r')
% legend('Polygon','Inside','Outside','Location','NorthWest')

Antworten (0)

Kategorien

Mehr zu Elementary Polygons finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by