Search code examples
c++geometrycomputational-geometrygraphicsprojective-geometry

How to compute Aspect angle


I have many 3D planes. The thing that I need to know is the way of computing aspect angle. I hope, I can compute the aspect angle by using the projected normal vector of each plane (my plane equation is ax+by-z+c=0; so normal vector of this plane is a,b,-1) to the XY plane. Then, from the Y axis I can compute the aspect angle. But, I don’t know how to get the projected Normal vector after I projected to XY plane. Then, can I apply the equation which gives angle between two vectors to compute angle of my desired vector from the y axis.

On the other hand, I found, aspect angle is defined as the angle between any line which passes along the steepest slope of the plane and north direction (here, Y axis). Does this definition will follow, with my proposed way that is taking normal vectors? I mean, does the projected normal vector always given along the steepest slope of the plane? Also, some one told me, that this problem should consider as a 2D problem. Please comment me and send me the relevant formulae in order to compute aspect angle. Thank you.


Solution

  • Some quick googling reveals the definition of the aspect angle.

    http://www.answers.com/topic/aspect-angle

    It's the angle between the geographic north on the northern hemisphere and the geographic south on the southern hemisphere. So basically it's a measure how much a slope faces the closest pole.

    If your world is planar as opposed to spherical it will simplify things, so yes - A 2D problem. I'll make this assumption having the following implications:

    • In a spherical world the north pole is a point on the sphere. In a planar world the "pole" is a plane at infinity. Think about a plane somewhere far away in your world denoting "north". Only the normal of this plane is important in this task. The unit normal of this plane is N(nz,ny,nz).
    • Up is a vector pointing up U(ux,uy,yz). This is the unit normal vector of the ground plane.

    The unit normal vector of the plane V(a,b,c) can now be projected onto a vector P on the ground plane as usual: P = V - (V dot U) U

    Now it's easy to measure the aspect angle of the plane - It's the angle between the "pole"-plane N and the projected plane normal P given by acos(P dot N).

    Since north is positive Y-axis for you we have N = (0, 1, 0). And then I guess you have up is U = (0, 0, 1), positive Z. This will simplify things even more - To project on the ground plane we just strip the Z-part. The aspect angle is then the angle between (a,b) and (0,1).

    aspectAngle = acos(b / sqrt(a*a + b*b))
    

    Note that planes parallell with the ground plane does not have a well-defined aspect angle since there is no slope to measure the aspect angle from.