 # The Plane through 3 Points The equation of a Plane through 3 given points A, B, C. New [P3points.mp] Maple procedure using LinearAlgebra. > a := vector(3): b := vector(3): c:=vector(3):
 The normal vector to the plane will be given by

> n := crossprod(b-a,c-a);

```       n := [ (b - a) (c - a) - (b - a) (c - a),

(b - a) (c - a) - (b - a) (c - a),

(b - a) (c - a) - (b - a) (c - a) ]
```

 and to compute the equation of the plane we do

> r := vector([x,y,z]):
> innerprod(n, r-a);

```   - b a x - a c x + b c x + b a x + a c x

- b c x + a c y + b a y - a c y - b c y

+ b c y - b a y - b c z + b c z - b a z

- a c z + b a z + a c z - b c a

+ b c a + b c a + b c a - b c a

- b c a
```

 In order to "collect" terms in x, y and z we write,

> collect(",[x,y,z]);

```(b c - b a - a c - b c + b a + a c) x

+ (b c - b a - a c - b c + b a + a c) y

+ (b c - b a - a c - b c + b a + a c) z

- b c a - b c a + b c a + b c a

+ b c a - b c a
```

 The equation of the plane is then given by the previous expression = 0. It is more convenient to pack the above commands into a maple procedure as follows:

> P3points := proc(a,b,c)
> local ex1,ex2,n,_x,_y,_z,r;
> n := crossprod(b-a,c-a);
> r := vector([_x,_y,_z]);
> ex1 := innerprod(n,r-a);
> ex2 := collect(ex1,[_x,_y,_z]);
> ex2 = 0
> end;

 Let's test it,

> P3points([0,0,-8],[0,4,0],[8,0,0]);

```                        32 _x + 64 _y - 32 _z - 256 = 0
```

 OK this is the answer but to show how you can use maple to re-organize the way an equation looks we load the very useful "isolate" command with,

> readlib(isolate):

> isolate(P3points([0,0,-8],[0,4,0],[8,0,0]),- 256);

```                         -256 = - 32 _x - 64 _y + 32 _z
```

 Do you see how -256 was isolated on the right? We can also divide the whole equation through by 32 with,

> "/32;

```
-8 = - _x - 2 _y + _z
```

 and now let's flip the rhs and lhs with,

> isolate(",rhs("));

```
- _x - 2 _y + _z = -8

```

 Multiply through by (-1)....

> "*(-1);

```
_x + 2 _y - _z = 8

```

 one more example,

> P3points([1,1,-2],[-1,1,0],[0,2,2]);

```
- 2 _x - 8 + 6 _y - 2 _z = 0

```

> "/(-8);
```
1/4 _x + 1 - 3/4 _y + 1/4 _z = 0

```

 sorry I just wanted to divide by (-2), but not a big deal... just do

> "*4;

```
_x + 4 - 3 _y + _z = 0

```

> isolate(",4);
```
4 = - _x + 3 _y - _z

```

 and flip it around...

> isolate(",rhs("));

```
- _x + 3 _y - _z = 4

```

Link to the commands in this file
Carlos Rodriguez <carlos@math.albany.edu>
Last modified: Wed Oct 23 10:56:54 EDT 1996