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
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
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)))

Roger Stafford
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);
  1 个评论
Yoon Chang Jeon
Yoon Chang Jeon 2017-11-19
Thanks! But It's result over range (x1 - x2) (x3 - x4), (y1 - y2) (y3 - y4). How can I find a result inside range?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Rubik's Cube 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!