Finding coordinates of a fourth point from 3 known points of fixed distance in 3D?
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens

I have three moving points that are tracked through time A(x,y,z), B(x,y,z) and C(x,y,z) through 150 frames (150 x 3). There is a fourth point that can be located in one frame (x,y,z) but not the others. If this fourth point is at a fixed distance from the other three is there a simple way to find the coordinates for this point in all 149 other frames. Intersection of three spheres has been recommended but I cannot find any functions that match this problem.
3 commentaires
Réponses (1)
Rik
le 6 Fév 2018
I don't get any errors for the code below. Note that there may be two solutions and that this code returns the result in the form of [x y z 1]. It also reports its precision, which is fairly close to machine precision, if you take the input magnitude into account.
A = [1673.7 85.1 279];
B = [1579.4 51.2 279];
C = [1674.4 86.7 249];
X = [1718.3 36.9 246.3];
%Pythagoras: dist^2=deltaX^2+deltaY^2+deltaZ^2
AX=sqrt(sum(diff([A(:),X(:)],1,2).^2));
BX=sqrt(sum(diff([B(:),X(:)],1,2).^2));
CX=sqrt(sum(diff([C(:),X(:)],1,2).^2));
%loop for each pair of (A,B,C):
result=interx(A,B,C,AX,BX,CX)
%result is [x y z 1] of the intersection (of which there may be two)
1 commentaire
Rik
le 19 Fév 2018
Did this solve your issue? If not, feel free to post your remaining questions here as a comment. If it did, please mark it as accepted answer.
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!