Point that lies on the angle bisector.
Show older comments
Hey all. This is my problem, I hope somebody is gonna solve it. :p Let's suppose to work in the three dimensional space. We have three different point: 'P1', 'P2' and 'P3'. For example ..
% P1 = [0 10000 0];
% P2 = [0 0 1];
% P3 = [100 0 0];
Of course, we can obtain the angle of the triangle given by the three points. Let's focus on the angle of the endpoint 'P1':
% seg2 = [(P2(1)-P1(1)),(P2(2)-P1(2)),(P2(3)-P1(3))];
% seg3 = [(P3(1)-P1(1)),(P3(2)-P1(2)),(P3(3)-P1(3))];
% u2 = seg2/norm(seg2);
% u3 = seg3/norm(seg3);
% Ang = acos(dot(u2,u3));
What I need is to get the coordinates of the point that lies on the angle bisector. We want that the distance between this point and 'P1' is '(R2+R3)/2' where ..
% R2 = norm(P2-P1);
% R3 = norm(P3-P1);
I don't know how to get this coordinates. I mean, I can do it in the two dimensional space .. but not in three dim. Anybody? :D
1 Comment
Roger Stafford
on 9 Nov 2013
By the way,
Ang = atan2(norm(cross(seg2,seg3)),dot(seg2,seg3));
is more accurate than acos(dot(u2,u3)) for seg2 and seg3 which are nearly parallel or nearly in opposite directions.
Answers (2)
Emiliano
on 9 Nov 2013
0 votes
Roger Stafford
on 9 Nov 2013
R2 = norm(P2-P1);
R3 = norm(P3-P1);
T = (P2-P1)/R2+(P3-P1)/R3;
P0 = P1+T/norm(T)*(R2+R3)/2; % <-- P0 is the desired point
This works unless P2-P1 and P3-P1 point in opposite directions, in which case there is no unique solution.
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!