I'm sorry, but this is insane to do as you are doing. Solve fails because what you are doing makes no sense at all. (Do you want me to lie?) There is NO need to reinstall the symbolic toolbox.
You have sets of three points. Each set represents three points that lie in a plane (in 3 dimensions.) As it is, you then compute a normal vector using cross.
The normal vector DEFINES the plane. I'm not sure what it is that you need more than that. What are you trying to solve for?
P1 = rand(1,3)
P1 =
0.81472 0.90579 0.12699
P2 = rand(1,3)
P2 =
0.91338 0.63236 0.09754
P3 = rand(1,3)
P3 =
0.2785 0.54688 0.95751
normal = cross(P1-P2, P1-P3)
normal =
-0.23766 -0.066143 -0.18203
normal = normal/norm(normal)
normal =
-0.7752 -0.21574 -0.59374
(There really was no need to scale normal to have unit norm, but I did. In some computations it is necessary, so this is more a matter of habit.)
The elements of normal ARE the coefficients a,b,c that form the equation of a plsne. P1 is a point in the plane (or P2 or P3.)
dot(normal,P1)
ans =
-0.90239
So the equation of the plane that passes through those points is
syms x y z
vpa(normal*[x;y;z] == dot(normal,P1),5)
ans =
- 0.7752*x - 0.21574*y - 0.59374*z == -0.90239
(I used vpa because otherwise the coefficients are too long and hurt my eyes.)
In all of this, exactly what are you trying to solve for? There are infinitely many points in a plane. That equation defines them all.
Perhaps you are looking for a parametric form of the plane? There is NO need to use solve for that. In fact, it is a waste of CPU cycles.
nullspace = null(normal)
nullspace =
-0.21574 -0.59374
0.97378 -0.072158
-0.072158 0.80142
The columns of the null space of the normal vector will span the plane.
syms u v
vpa(P1 + [u v]*nullspace',5)
ans =
[ 0.81472 - 0.59374*v - 0.21574*u, 0.97378*u - 0.072158*v + 0.90579, 0.80142*v - 0.072158*u + 0.12699]
So ANY point in the plane is described parametrically by the above expression, for some value of u and v. This is as much as solve could give you.
You comment that you are looking for the coefficients on the right hand side, thus the values of d for each plane?
As I have written it, this is no more than
I still have no idea what it is you are trying to do. Somehow I'm not terribly confident that you do either.
Best Answer