#### Archived

This topic is now archived and is closed to further replies.

# How to I find y given x,z inside a plane

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

## Recommended Posts

Hi, I have a triangle ABC given by 3 points, x1,y1,z1; x2,y2,z2; and x3,y3,z3 I have a point inside triangle ABC, given x,z how do I find y? Thanks in advance!

##### Share on other sites
The plane equation...

d = a*x + b*y + c+z

Where (x,y,z) is any point on the plane, (a,b,c) is the unit normal of the plane and d is the distance (0,0,0) is from the plane. If (a,b,c) is not a unit vector then d is the distance (0,0,0) is from the plane mutiplied by |(a,b,c)|.

The normal vector can be calculated like this:

(a,b,c) = (p2-p1) cross (p3-p1)

Where p1, p2, and p3 are points on the plane (your triangle). From here you can normalize (a,b,c) if you want but it's not necessary.

The plane constant, d, can be calculated like this:

d = (a,b,c) dot p1
d = a*p1.x + b*p1.y + c*p1.z

Now you know d and (a,b,c) and you have an x and z value so just use the plane equation to solve for y. Like this:

d = a*x + b*y + c*z
b*y = d - a*x - c*z
y = (d - a*x - c*z) / b

[edited by - nonoptimalrobot on February 28, 2004 5:21:13 PM]

##### Share on other sites
Thanks a bunch!...it had been a while since I did vector math :-)

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 10
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633718
• Total Posts
3013518
×