clear; close all;
p1 = [3 2 -1];
p2 = [1 3 -2];
p3 = [3 -1 -4];
p4 = [0 0 -2];
syms x y z a b c r
f = (x-a)^2 + (y-b)^2 + (z-c)^2 == r^2;
f1 = subs(f, [x, y, z], p1);
f2 = subs(f, [x, y, z], p2);
f3 = subs(f, [x, y, z], p3);
f4 = subs(f, [x, y, z], p4);
F = [f1; f2; f3; f4];
assume([a, b, c], 'real')
assume(r, 'positive')
sol = solve(F, [a, b, c, r]);
sol.a
sol.b
sol.c
sol.r
1 Comment
Yoshio (view profile)
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/488641-#comment_762415
Sign in to comment.