Sign in to follow this  

Finding the angle between faces in a pyramid

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Uhh, topic. I guess this should be a pretty simple one, but I'm a sophomore in HS, and low-level math classes are hard to get out of (can't test out in HS--at least not at my school). So, if the topic didn't say it clear enough, I'm wondering how you would find the angle between faces in a pyramid. At first I was thinking that you could use the hypotenuse (sp) of a right triangle (pyramid on a square base, half of square base == right triangle), but then I realized that I need a way to find an angle between the base and the faces. This hasn't been covered in any of my math classes, so a slow explanation would be much appreciated... Thanks in advance.

Share this post


Link to post
Share on other sites
I think it would be the arc tangent of (y/.5x).

y= height of pyramid
x= lenght of one side of the square base


/|\
/ | \
/ y| \ angle=t
/ | \
/ | t\
-----------
x

Share this post


Link to post
Share on other sites
I'm in HS too so i know where your coming from, however i've already taken trig and im currently taking AP Physics so this stuff is fresh in my mind.

arc tangent is also known as inverse tangent so mabye that might help.

Share this post


Link to post
Share on other sites
Oh wait a second...I just now reread the question I posted, and realized that it's not what I wanted to know. I guess it could be *helpful*, but not the current problem. What I need to find is the angle difference between the *faces*, such as face1 to face2, not between face1 and the base.

So, uh...my bad.

Share this post


Link to post
Share on other sites
homework question?

if so, i'll give only a hint:
angle between planes = angle between normals of planes.

So from there you probably can find what you want, except, that i don't know what you want, angle difference may mean different things.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dmytry
homework question?

if so, i'll give only a hint:
angle between planes = angle between normals of planes.

So from there you probably can find what you want, except, that i don't know what you want, angle difference may mean different things.


Not homework. draw_triangle() :P.

I started to re-learn OpenGL and realized that I don't know how to mathematically find the angle between the first face and the second face. I just used vertices in the past. This time I ended up for() looping through 360 degrees, increasing 0.1f, and drawing a triangle by the rotation. So it's a whole bunch of flat triangles that look un-flat.

This feels like a n00b question, but I guess it's better to know and feel like a nub than to not know.

EDIT: btw, no homework, fall break =).

Share this post


Link to post
Share on other sites
To follow on from Dmytry:

1) calculate the face normals by cross-producting two of the edges, and normalise them
2) angle = arccos (dotproduct (normal1, normal2))

Share this post


Link to post
Share on other sites
...
@Ajare:
I really, really wish you hadn't told me that. I was totally havin fun in my own little world thinking I knew the way to do it, and then I read this and...*whoosh*

That's the sound of something flying way over my head. *sigh* Here I come MathWorld.

Share this post


Link to post
Share on other sites
so.... you need to find angle between faces, in mathematical sense, or you need to find angle that turns one face into other when you horisontally rotate it? Second angle is 2pi/n where n is number of sides of piramid.

if you know how to find angle between vectors, and you know how to find normals, you can apply teh knowledge - find normals, find angle between normals, you'll have angle between faces.

Normal is given by cross product of 2 edges, that is, if triangle have points ABC, normal is (A-B)x(B-C) where x is cross product.

Sometimes you need to make normal N to be unit-length ,it's confusingly called normalize, it's can be done by N=N*(1/sqrt(DotProduct(N,N)))
You can find angle between vectors N1,N2 by
a=acos(DotProduct(N1,N2)/sqrt(DotProduct(N1,N1)*DotProduct(N2,N2));
if(a>pi*0.5)a=pi-a;
This formule works bad for small angles. It might be better to use
asin(Length(CrossProduct(N1,N2))/sqrt(DotProduct(N1,N1)*DotProduct(N2,N2))
where Length returns length of the vector,that is, length(a)=sqrt(DotProduct(a,a))

You'll need to search for cross product and dot product if you don't know what's it all about.

*******************************************

I'll anyway try to solve it more optimally(w/o cross products and renormalizations):

Let angle between normals is a.
Geometrically i can see a formule( very hard to explain in ascii art, or in words)
1:
2*sin(a/2)=2*sin(pi/n)*sin(angle_between_base_and_any_face)
(hope i'm right...)
where 2*sin(a/2) it's distance between unit-length normal vectors. Difference of unit-length normal vectors is horisontal due to symmetry. So it's equal to distance between projections of normals onto horisontal planes, it's 2*sin(pi/n)*sin(angle_between_base_and_face)
Let s it's radius of circle drawn inside base:
s=r*cos(pi/n)
then from definition of sin,
sin(angle_between_base_and_face) = h/sqrt(s2+h2)
so from 1 we have
sin(a/2)=sin(pi/n)*h/sqrt((r*cos(pi/n))2+h2)
and replacing cos2 by 1-sin2
sin(a/2)=sin(pi/n)*h/sqrt(r2*(1-sin(pi/n)2)+h2)
so a=2*asin(sin(pi/n)*h/sqrt(r2*(1-sin(pi/n)2)+h2))

Hope it's right.... evening there, i might have made some typos.

[Edited by - Dmytry on October 11, 2004 4:32:24 PM]

Share this post


Link to post
Share on other sites
In fewer words you need to make vectors out of two sides of each triangle.
The cross product is just an operation that can be performed on two vectors that will return a third, and it will be perpedicular to the plane created by the first two.
That is your "normal" or "direction this thing faces".

Dot product is another vector operation, except it returns a decimal number, and it happens to turn out that if you take the inverse-cos of that number, you get the angle between the two vectors (the angle you happen to be looking for).

Share this post


Link to post
Share on other sites
do you know anything about vectors if so well in 2-d you could find the outside angles by A X B = [A][B]sin(<) But this does have a some involvement. If you haven't learned about vectors forget you even saw that. Some else may know the vector equation to find these angles in the 3-D.

this is how i would go about it. i'm a junior at LSU, I have to take all those classes

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by halfangel
do you know anything about vectors if so well in 2-d you could find the outside angles by A X B = [A][B]sin(<) But this does have a some involvement. If you haven't learned about vectors forget you even saw that. Some else may know the vector equation to find these angles in the 3-D.

this is how i would go about it. i'm a junior at LSU, I have to take all those classes


I'm sorry A and B being Vectors and [A] [B] are the magnitudes of the vectors. Label your pyramid to get your vectors piece by piece. then solve for you angle, swaping the formula around to be (<)=sin(-1) ((A X B)/[A][B]

if you don't know the cross product you can use the matrix to find it

| Ax Ay Az|
| Bx By Bz| = (AyBz-AzBy, AzBx-AxBz, AxBy-AyBx)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by halfangel
do you know anything about vectors if so well in 2-d you could find the outside angles by A X B = [A][B]sin(<) But this does have a some involvement. If you haven't learned about vectors forget you even saw that. Some else may know the vector equation to find these angles in the 3-D.

this is how i would go about it. i'm a junior at LSU, I have to take all those classes


I'm sorry A and B being Vectors and [A] [B] are the magnitudes of the vectors. Label your pyramid to get your vectors piece by piece. then solve for you angle, swaping the formula around to be (<)=sin(-1) ((A X B)/[A][B]

if you don't know the cross product you can use the matrix to find it

| Ax Ay Az|
| Bx By Bz| = (AyBz-AzBy, AzBx-AxBz, AxBy-AyBx)

Share this post


Link to post
Share on other sites
Using just trig. A line from the center of the base to the center of a side is the hypotheneous of a right triangle. That right triangle is formed by a line from the center of the base to the center of a side and from the center of the side toward the apex. It doesn't go all the way to the apex, but rather stops at a point where a line from the center of the base through that point would be perpendicular to the side. Once you have that length you can use the angle of a side with the base to project the point onto the base, i.e. now that length is the hypotheneous. You can draw a line parallel to the side and it intersects a line from the center to a corner. The distance between the projection of the point on the side to the base to that intersection is the side of a right triangle with one angle half the angle between the two faces. You have the lengths of two sides of that right triangle.

Oops, stopped too soon. The distance from the projection of the point on the side to the base to the intersection with the line to the corner becomes the hypotheneous of a right triangle. The right angle is the intersection of a line connecting the projection of the points on two adjacent side with the line to the corner. The length of that is half the distance between the points on the side.

That doesn't tell you exactly how to calculate it, but it does give you a geometric construction. You should be able to fairly easily draw it using just a top and front view.

[Edited by - LilBudyWizer on October 12, 2004 3:40:07 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by LilBudyWizer
Using just trig. A line from the center of the base to the center of a side is the hypotheneous of a right triangle. That right triangle is formed by a line from the center of the base to the center of a side and from the center of the side toward the apex. It doesn't go all the way to the apex, but rather stops at a point where a line from the center of the base through that point would be perpendicular to the side. Once you have that length you can use the angle of a side with the base to project the point onto the base, i.e. now that length is the hypotheneous. You can draw a line parallel to the side and it intersects a line from the center to a corner. The distance between the projection of the point on the side to the base to that intersection is the side of a right triangle with one angle half the angle between the two faces. You have the lengths of two sides of that right triangle.

Oops, stopped too soon. The distance from the projection of the point on the side to the base to the intersection with the line to the corner becomes the hypotheneous of a right triangle. The right angle is the intersection of a line connecting the projection of the points on two adjacent side with the line to the corner. The length of that is half the distance between the points on the side.

That doesn't tell you exactly how to calculate it, but it does give you a geometric construction. You should be able to fairly easily draw it using just a top and front view.


it's somewhat similat to how i derived my formule:
(truing to explain...)

If N1 it's [unit-length] normal of one face and N2 it's normal of other face, ||N1-N2|| it's 2*sin(a/2) where a it's angle between normals(1).(edit: it's just yet another angle-between-vectors formule.)

You can easily see that N1-N2 is horisontal. So N1-N2=(N1 projected onto z=0 plane) - (N2 projected onto z=0 plane).
Both normals have equal angles between 'em and z direction, and both projections have length
sin(angle between normal and z direction)

Angle between projections of normals is 2*pi/n.
And length of difference of projections of normals is sin(angle between normal and z direction)*2*sin(pi/n)
using (1)
2*sin(a/2)=sin(angle between normal and z direction)*2*sin(pi/n)

then, angle between normal and z direction = angle between face and base.

edit: how to follow formules : do some drawings, and try to find the formule yourself...

[Edited by - Dmytry on October 12, 2004 7:08:30 AM]

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this