# Thread: create plane in 3D and

1. ## create plane in 3D and

Hi ,
I have severel Point (XYZ) and would like to do the following:

1) Pick out three points randomly and create a plane.

2) in a further step I would like to check if the remainig points are on the plane or not.

Is there a function or a library which I can use to create a plane using 3 points and check the distance of the remaining points to the created plane????

Has anybody an idea??

Thanks a lot.

Michi

2. For real life distances I believe the only, or best way to do it is to just use straight mathematics. As far as creating the plane and checking it, opengl or directX can do this.

3. Check this out: http://www.swiftless.com/tutorials/o...pengltuts.html

Simple, easy, just from the basic.

4. Hi,
But I don't want to display the a plane. I`m just interested in the equation of the plane(defined by 3 Points) and the distances of the remaining points.

Isn't there a function which can do that???

Thanks

Michi

5. Sorry, I think by visualizing it would be much easier

6. Originally Posted by michi7
Hi,
But I don't want to display the a plane. I`m just interested in the equation of the plane(defined by 3 Points) and the distances of the remaining points.

Isn't there a function which can do that???

Thanks

Michi
There will be, once you get done writing it. The mathematics is pretty straightforward, you just need to decide how you're going to store your plane.

7. The math for this is simple:

p dot n = d
ax + by + cz + d = 0

x,y,z = (0,1,2)

a(0) + b(1) + c(2) + d = 0

I'll let you figure out the rest.

Moved to Tech board for lack of a better place to put it.