Find coordinates point M

9 Ansichten (letzte 30 Tage)
help_me
help_me am 12 Dez. 2017
Beantwortet: help_me am 15 Dez. 2017
I need to find the coordinates of point M. Has anyone got any idea of how to find them?
Thanks in advance
  2 Kommentare
David Goodmanson
David Goodmanson am 15 Dez. 2017
If you put A = [Ax Ay 0], same style for B and P, then
u = cross([0 0 1],B-A);
u = u/norm(u);
is a unit vector in the direction perpendicular to the line AB. From there you should be able to construct the vector from P to M and find M.
Jim Riggs
Jim Riggs am 15 Dez. 2017
Bearbeitet: Jim Riggs am 15 Dez. 2017
This is a good idea.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jim Riggs
Jim Riggs am 15 Dez. 2017
Bearbeitet: Jim Riggs am 15 Dez. 2017
See attachment.
The symbolic solution will be very messy and require quite a lot of algebra. If you have the symbolic math toolbox, Matlab can do this.
I like David Goodmanson's idea. Using his approach I get:
Ax = ; Ay = ;
Bx = ; By = ;
k = ; % This is a fraction (from 0 to 1) Makes sure that P lies on AB
Px = k*(Bx-Ax);
Py = k*(By-Ay);
d0 = ;
% Calculate distance from P to B
dPB = sqrt((Bx-Px)^2+(By-Py)^2);
Mx = Px - dPB/dPB^2*(By-Py)*d0;
My = Py - (Bx-Px)/(By-Py)*(Mx-Px);
See the attachment (2) for the derivation.
With this approach, d0 is a signed quantity. If you set d0 to a negative value, M will be on the opposite side of line AB.

Weitere Antworten (1)

help_me
help_me am 15 Dez. 2017
Thanks guys, you've been very helpful!
Keep up the good work! :)

Kategorien

Mehr zu Mathematics 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