     POV-Ray : Newsgroups : povray.general : Plane passing through 3 points : Re: Plane passing through 3 points Server Time25 May 2022 06:44:01 EDT (-0400) Re: Plane passing through 3 points   From: Tor Olav Kristensen Date: 1 May 2022 13:00:00 Message:    ```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.626ebb76e0a3ca27afe6ae3e89db30a9%40news.povray.org",
"headline": "Re: Plane passing through 3 points",
"dateCreated": "2022-05-01T17:00:00+00:00",
"datePublished": "2022-05-01T17:00:00+00:00",
"author": {
"@type": "Person",
"name": "Tor Olav Kristensen"
}
}
kurtz le pirate <kur### [at] gmail com> wrote:
> Hello,
>
> I have 3 points A, B and C
> I would like the "plane" object to pass through these three points.
>
> It is easy to determine the equation of a plane that passes through
> these three points. We obtain this equation : ax + by + cz + d = 0
>
> I try to do : plane { <a, b, c>, d }
>
> but the plane does not pass through the points.
>
>
> Documentation at <http://www.povray.org/documentation/view/3.7.1/297/>
> indicates that the object "plane { <A, B, C>, D }" represent the plane
> defined by : A*x + B*y + C*z - D*sqrt(A^2 + B^2 + C^2) = 0
>
> ... I must be dumb but I can't make the link with my plan equation.
>
>
> A little help ?

I would prefer to rewrite this equation:

A*x + B*y + C*z - D*sqrt(A^2 + B^2 + C^2) = 0

- like this:

A*X + B*Y + C*Z = D*sqrt(A^2 + B^2 + C^2)

If we let L = sqrt(A^2 + B^2 + C^2)

- and we then divide by L on both sides, we get this equation:

A/L*X + B/L*Y + C/L*Z = D

The left side of the equation equals the dot product between
two vectors; vN and vP, where vN = <A/L, B/L, C/L> and
vP = <X, Y, Z>. I.e.:

vdot(vN, vP) = D

Since L = vlength(<A, B, C>), vN is a normalized vector;

vN = <A, B, C>/L = vnormalize(<A, B, C>)

Now if vN is the normalized normal vector to a plane - and if
vP is the position vector to any point in that plane, then the
plane is defined by all points in 3D space, where the dot
product between these two vectors equals the distance; D from
the origin to the plane in the direction of the plane's normal
vector.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k
```    