How can I find a intersection of four ponits?
1 次查看(过去 30 天)
显示 更早的评论
I know
A(n)=[x(n),y(n)],
A(n+1)=[x(n+1),y(n+1)]
A(m)=[x(m),y(m)],
A(m+1)=[x(m+1),y(m+1)]
I want to find a intersection point of Line A(n)-A(n+1) and A(m)-A(m+1) The x-coordinate of point(x,y) between x(n), x(n+1), x(m),and x(m+1) The y-coordinate of point(x,y) between y(n), y(n+1), y(m),and y(m+1)
2 个评论
Walter Roberson
2017-11-18
Are you sure that the last two knowns are both A(m)? Perhaps the last one is to be A(m+1) ?
回答(2 个)
David Goodmanson
2017-11-18
编辑:David Goodmanson
2017-11-18
Hello Yoon, lots of possible expressions for this. Here is one that is pretty symmetric in the points. Let
a = [x(n),y(n)]'
b = [x(n+1),y(n+1)]'
c = [x(m),y(m)]'
d = [x(m+1),y(m+1)]'
so, four column vectors. then
M = [b-a,d-c]
p = (1/4)*(a+b+c+d + M*[1 0;0 -1]*(M\(c+d-a-b)))
0 个评论
Roger Stafford
2017-11-18
If A = [x1;y1] and B = [x2;y2] are coordinates of two points as column vectors on one of the lines with C = [x3;y3] and D = [x4;y4] as column vectors for two points on the other line, then the point P = [x;y] of the lines' intersection is:
TS = [B-A,C-D]\[C-A];
P = A+(B-A)*TS(1);
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!