Public Group

# plane

This topic is 4002 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I was just wondering what the best way to represent an infinite plane is in C++.

##### Share on other sites
Quote:
 Original post by ogl5I was just wondering what the best way to represent an infinite plane is inC++.
The two most common representations used are probably a vector (the plane normal) and a scalar (the [pseudo]distance to the plane from the origin along that normal), and the hyperplane equation ax+by+cz+d = 0. In the hyperplane equation, a, b, and c correspond to the components of the plane normal, and 'd' is the negative of the distance in the normal-distance representation.

The question of how best to represent a plane is more or less language-independent, by the way (that is, none of the above is specific to C++ or any other language).

##### Share on other sites
The implicit formula for a plane:

Ax+By+Cz+D = 0

All mathematical definitions of planes are infinite.

So all you need to store is the normal of the plane: <A, B, C> and the constant D.
You can solve for D by choosing a point that lies in the plane <x,y,z> and subbing it into the equation.

No matter what the language you only need 4 floats to represent an infinite plane.

1. 1
Rutin
24
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 38
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631706
• Total Posts
3001833
×