フィルターのクリア

Rectangle intersection or Overlap

8 ビュー (過去 30 日間)
Prakash Choudhary
Prakash Choudhary 2019 年 6 月 4 日
コメント済み: Prakash Choudhary 2019 年 6 月 5 日
can some one help me to write the code for rectangle overlap for N rectangles ?? or for rectangle intersection?

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 6 月 4 日
編集済み: KALYAN ACHARJYA 2019 年 6 月 4 日
num=input('Number of Rantangle');
for i=1:num
rectangle('Position',[i i+1 2*i 3*i]);
%.....................^..^..^....^ set as per your requirements
hold on;
end
  4 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 6 月 5 日
can some one help me to write the code for rectangle overlap for N rectangles ??
Prakash Choudhary
Prakash Choudhary 2019 年 6 月 5 日
Intersection doesnt work properly for rectangle with line
Dwy0 = 200;
Dwy = 100;
B1x = data(:,2);
B2x = data(:,2)+4*7.*D;
B3x = data(:,2)+4*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);
xv = [B3x,B4x,B1x,B2x];
yv = [B3y,B4y,B1y,B2y];
x2v = [B4x B1x];
y2v = [B4y B1y];
AA=intersect([xv,yv],[x2v,y2v])
plot(AA,'b.')
hold on;grid on
plot(xv,yv,'.')
% plot(x2v,y2v)
data(:,2) random x coordinates n mumbers n=20 for now
data(:,3) random y coordinates n numbers n=20 for now
but the intersction part rectangle xv,yv with x2v,y2v is not working properly
i want to simulate if the rectangle intersect (xv,yv) to linesegments (x2v,y2v) the line segments shows in the results.

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

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by