이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
rectangle intersect with line and display which line or point got intersect?
조회 수: 6 (최근 30일)
이전 댓글 표시
Prakash Choudhary
2019년 6월 4일
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
Prakash Choudhary
2019년 6월 5일
In this code how can i show that the line x2v,y2v intersected by the rectangle and its for n rectangle with n lines the realtion between that i cant be able to display in here or simulate this thing!!!
Prakash Choudhary
2019년 6월 5일
data(:,2) is x coordinates for N numbers
data(:,3) is y coordinates for N numbers
sir!!! you can consider random points and the code will give you the rectangle and line segments but the intersect part is not satisfying to me so i need help SOS!!!
Adam Danz
2019년 6월 5일
Yes, we could generate our own fake data to help you solve your problem. But there's always a risk that the data we generate in the dark aren't similar enough to your actual data and that leads to a lot of wasted time and a lot of unnecessary dialogue. So it's your responsibility to produce some kind of data for people to work with that reproduces the problem.
Prakash Choudhary
2019년 6월 5일
Yes sir but how can i attach the xlfile here i can just copy the coordinates here
xaxis yaxis
0 1148
1100 0
480 287
1300 700
220 2500
800 1600
2000 1100
1600 2000
2500 0
1000 3000
0 3500
480 4000
2250 2500
1600 3500
2500 4000
2900 560
3400 1600
2900 3000
4000 287
3700 2000
Adam Danz
2019년 6월 5일
There we go; we can work with that. However,
- your 'data' matrix has 3 columns so we're missing a column of data
- We're also missing the value of 'D'.
Prakash Choudhary
2019년 6월 5일
Sorry for That The value of D=200 however i missed to mention that before
Prakash Choudhary
2019년 6월 5일
and the value of x2v,y2v however is same come from the rectangle one side lines
Adam Danz
2019년 6월 5일
편집: Adam Danz
2019년 6월 5일
Ok, what about the 3rd column of 'data'?
" how can i show that the line x2v,y2v intersected by the rectangle"
x2v and y2v are both [20 x 2] matrices so they will produce two lines. And what rectangle do you expect those two lines to intersect?
I might be helpful to include an image of the intersection.
Prakash Choudhary
2019년 6월 5일
i atteched the picture which can help you to understand my situation for the rectangle intersect.
Adam Danz
2019년 6월 5일
I don't see any rectangles nor do I see any intersections.
Are you asking for the coordinates where the orange vertcial line that is circled and labeled "2" would intersect the blue lines if it extended vertically?
I can't help without reproducible code and that still hasn't been provided.
Prakash Choudhary
2019년 6월 5일
yes i want to know that coordinates where it overlaps/ intersect the 2 or 3 by 1
Prakash Choudhary
2019년 6월 5일
and its more like a polyshape object i consider as a rectangle because it made of a four different points
Adam Danz
2019년 6월 5일
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).
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)