Filter löschen
Filter löschen

rectangle intersect with line and display which line or point got intersect?

1 Ansicht (letzte 30 Tage)
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)
  20 Kommentare
Adam Danz
Adam Danz am 5 Jun. 2019
The solution probably isn't that complicated. You have to find the x value of the vertical lines; then, given that x value, find the y value on the blue line (interpolate if needed). The solution probably would have taken less time to write than the time spent going back and forth trying to understand your data. There has already been 20 comments on this and still, no data. We could exchange comments for the next few months and I still won't be able to help until you attach some data for me to work with.
You already produced a figure. That's impossible to do without data. So you have the data. You just need to save it to a mat file and attach it. Unfortunately I have other obligations today but I might have time to help you later (if there are data to work with).

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by