# 3D geometry

**URL:** <https://boards.straightdope.com/t/3d-geometry/152269>\
**Category:** Factual Questions\
**Created:** [February 2, 2003, 6:52am UTC](https://boards.straightdope.com/t/3d-geometry/152269 "2003-02-02T06:52:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grievar](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@Grievar](https://boards.straightdope.com/u/Grievar)\
**Post date:** [February 2, 2003, 6:52am UTC](https://boards.straightdope.com/t/3d-geometry/152269/1 "2003-02-02T06:52:49Z")

</div>

Given a plane with the three points A B and C, using only formulae,  
how can one tell if point P is on the plane, and if not, which side  
of the plane it is on.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 2, 2003, 7:30am UTC](https://boards.straightdope.com/t/3d-geometry/152269/2 "2003-02-02T07:30:53Z")

</div>

You want to take the _triple scalar product_ of three vectors, specifically, PA, PB, and PC, or something like that. The formula is:

TSP = PA • (PB × PC)

It can also be written in matrix form. Write the components of the three vectors as a 3 × 3 matrix and take the determinant:

TSP = determinant of…  
PA[sub]x[/sub] PA[sub]y[/sub] PA[sub]z[/sub]  
PB[sub]x[/sub] PB[sub]y[/sub] PB[sub]z[/sub]  
PC[sub]x[/sub] PC[sub]y[/sub] PC[sub]z[/sub]

Now then, is P on top of the plane or on the bottom? Well, what do we mean by “top” and “bottom”? Let’s say you’re looking at the plane from one side, and you connect the dots A, B, C, then back to A. If you connected them clockwise, we’ll call the side that you’re on the “top”, and if you connected them counterclockwise, we’ll call that the “bottom”. Then, based on the sign of the TSP, you can determine where P is with respect to the ABC plane:

TSP \> 0 : P is on the top side  
TSP = 0 : P is in the plane  
TSP \< 0 : P is on the bottom side

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 2, 2003, 7:34am UTC](https://boards.straightdope.com/t/3d-geometry/152269/3 "2003-02-02T07:34:31Z")

</div>

By the way, thanks for asking a math question. Those three from yesterday really got me in the spirit. 🙂

---

<div class="post-metadata">

**Author:** ![Catalyst](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@Catalyst](https://boards.straightdope.com/u/Catalyst)\
**Post date:** [February 2, 2003, 8:22am UTC](https://boards.straightdope.com/t/3d-geometry/152269/4 "2003-02-02T08:22:53Z")

</div>

Well, I don’t have any formulae (and since geometry is based largely on theorems and postulates, I don’t see why you’d necessarily need formulae), but I just tried out a method that I _think_ works; hopefully I can convey it properly.

Take points A, B, and C. Draw lines AB, AC, and BC. Now draw lines perpendicular to AB, AC, and BC that intersect their respective lines at points A, B, and C. You’ll have a total of nine lines (fewer if you have points positioned such that some lines are coincidental). Now, plot point P. If line AP intersects any of the lines we’ve drawn on plane ABC anywhere other than point A, then P must be on the plane. If not, then point P is not on point ABC.

I can’t _prove_ that this works, but it has for the models I’ve drawn. As for which “side” of the plane point P is on, isn’t that a matter of our point of view?

On preview, it seems **Achernar** has beaten me to it and done a better job, at that. Good stuff, **Achernar**.

---

<div class="post-metadata">

**Author:** ![RM\_Mentock](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@RM\_Mentock](https://boards.straightdope.com/u/RM_Mentock)\
**Post date:** [February 2, 2003, 12:59pm UTC](https://boards.straightdope.com/t/3d-geometry/152269/5 "2003-02-02T12:59:21Z")

</div>

> [@](#):
>
> \*Originally posted by Catalyst \*  
> \*\*I can’t _prove_ that this works, but it has for the models I’ve drawn. \*\*

Are you drawing models in three dimensions?? Hey, let me have a turn.

---

<div class="post-metadata">

**Author:** ![RM\_Mentock](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@RM\_Mentock](https://boards.straightdope.com/u/RM_Mentock)\
**Post date:** [February 2, 2003, 1:21pm UTC](https://boards.straightdope.com/t/3d-geometry/152269/6 "2003-02-02T13:21:21Z")

</div>

> [@](#):
>
> \*Originally posted by Achernar \*  
> **You want to take the _triple scalar product_ of three vectors, specifically, PA, PB, and PC, or something like that.**

I get a sign reversal with those, using A(0,0,0), B(1,0,0), C(0,1,0), P(0,0,1)

I would have used a different set of vectors. The cross product of AB and AC is a vector perpendicular to the plane of ABC, at A, in the direction of the right hand rule. If you then take the dot product of that vector with the vector AP, it’ll tell you, by the sign, whether AP is in the same direction as the cross product or not. If it’s zero, it’s in the plane.

Sorta an explanation of why the triple product rule works.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 2, 2003, 3:49pm UTC](https://boards.straightdope.com/t/3d-geometry/152269/7 "2003-02-02T15:49:02Z")

</div>

> [@](#):
>
> \*Originally posted by RM Mentock \*  
> I get a sign reversal with those, using A(0,0,0), B(1,0,0), C(0,1,0), P(0,0,1)

I could be wrong, but I get PA = [0, 0, -1], PB = [1, 0, -1], PC = [0, 1, -1], TSP = -1, which is right because P is on the “bottom” side of the ABC plane.

There are indeed a bunch of different ways you could set up the TSP. Starting from any of the four points, draw vectors to the other three, and then use those three in any order. You’ll still get the same magnitude; the only difference will (possibly) be a sign change. I chose to start with P because I liked the symmettry, but if you prefer A (or B or C) that works just as well. 🙂

---

<div class="post-metadata">

**Author:** ![Catalyst](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@Catalyst](https://boards.straightdope.com/u/Catalyst)\
**Post date:** [February 2, 2003, 4:07pm UTC](https://boards.straightdope.com/t/3d-geometry/152269/8 "2003-02-02T16:07:06Z")

</div>

> [@](#):
>
> \*Originally posted by RM Mentock \*  
> \*\*Are you drawing models in three dimensions?? Hey, let me have a turn. \*\*

D’oh! :smack:  
Well, I drew two dimensions; I had to settle with holding my pen above the plane and eyeballing it for the third, though I guess I could’ve used a straightened-out paper clip if I were feeling frisky.

In any case, does my method actually work?

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 2, 2003, 4:13pm UTC](https://boards.straightdope.com/t/3d-geometry/152269/9 "2003-02-02T16:13:07Z")

</div>

Yes, your method works, but you could get away with only two lines in the beginning instead of nine, if you could guarantee that the lines were not parallel, and that neither of them passed through point A. If you draw line BC, then the perpendicular lines to BC that pass through B and C, that should suffice. Any line in the plane will have to intersect one of those three lines at a point other than A.

---

<div class="post-metadata">

**Author:** ![RM\_Mentock](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@RM\_Mentock](https://boards.straightdope.com/u/RM_Mentock)\
**Post date:** [February 2, 2003, 6:09pm UTC](https://boards.straightdope.com/t/3d-geometry/152269/10 "2003-02-02T18:09:47Z")

</div>

> [@](#):
>
> \*Originally posted by Achernar \*  
> **I could be wrong, but I get PA = [0, 0, -1], PB = [1, 0, -1], PC = [0, 1, -1], TSP = -1, which is right because P is on the “bottom” side of the ABC plane.**

That is indeed the way you defined it. I’m just not used to having **i** x **j** = **k** point _down_.

> [@](#):
>
> \*\*  
> You’ll still get the same magnitude; the only difference will (possibly) be a sign change.\*\*

I don’t think you get the same magnitude all the time, if you use any of the four points in any order, do you?

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [February 2, 2003, 8:23pm UTC](https://boards.straightdope.com/t/3d-geometry/152269/11 "2003-02-02T20:23:20Z")

</div>

> [@](#):
>
> \*Originally posted by RM Mentock \*  
> \*\*I don’t think you get the same magnitude all the time, if you use any of the four points in any order, do you? \*\*

If there’s a magnitude change, it’s from the cross product. The dot product can only change signs.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 2, 2003, 8:42pm UTC](https://boards.straightdope.com/t/3d-geometry/152269/12 "2003-02-02T20:42:52Z")

</div>

> [@](#):
>
> \*Originally posted by RM Mentock \*  
> That is indeed the way you defined it. I’m just not used to having **i** x **j** = **k** point _down_.

That’s why I didn’t call them “up” and “down”; I called them “top” and “bottom”. 😃 It would not be difficult to distinguish the “more z-ward” side from the “less z-ward” side, or the same with the x or y axes. One small problem is, though, that whatever method you pick degenerates if the plane is parallel to the axis of your choice. So a vertical plane does not allow a distinction of “up” and “down”. My definition allows a distinction between the two sides, as long as A, B, and C are noncolinear. Of course, talking about the ABC plane when they _are_ collinear is meaningless as well.

> [@](#):
>
> I don’t think you get the same magnitude all the time, if you use any of the four points in any order, do you?

Perhaps I wasn’t clear. You must start each of the three vectors at one of the points. So you could use CA, CP, and CB, but not CA, AB, and BP. Geometrically, the TSP is the volume of the paralellipiped with edges defined by the three vectors. You can also think of this as six times the volume of the tetrahedron with those four points. Since the volume of the tetrahedron does not depend on which vertex you start from, it should be the same starting from any.
