## Osx Grapher 3D

Visualizing a 3D plane

Inverting a 3D plane

### Visualizing a 3D plane

Planes are often represented with a normal (nx,ny,nz) and a distance (d).Plane equation: ax + by + cz + d = 0

where 'a', 'b', 'c' are the x/y/z components of the normal and 'd' is the distance to move away from the origin along its normal (when d=0 the plane contains the origin)

**example**

given normal(-1,0,0) and distance=-2.9 (which happens to be an axis aligned plane)

filling it into the plane equation gives:

-1*x + 0*y + 0*z + -2.9 = 0

-1*x - 2.9 = 0

-1 * x = 2.9

x = -2.9

so whatever value we chose for y and z, the matching x will be -2.9

The normal is pointing towards the "negative x-axis", which means:

the "positive halfspace is on the left side of the plane"

the "negative halfspace is on the right side of the plane"

You can visualize that under osx with the "grapher" tool

### Inverting a 3D plane

Now imagine we want the plane in the same position as in example 1 - but with the normal pointing in opposite direction (which means the halfspaces will be flipped). So let's "flip the normal" from (-1,0,0) to (1,0,0) and leave d=-2.9.Notice in the left screenshot that now the plane is on the "x=2.9" place instead of "-2.9". So to keep the plane "in-place" we also need to invert the distance (see right image)