# How to calculate normals or surfaces in 3D using angles?

For example in 2D space:

It is possible to calculate unit normal, $$\vec{n}$$, using $$\theta$$ and a bit of the unit-circle application: $$\vec{n} = (\sin{\theta}, -\cos{\theta})$$

I want to know is the same rules apply for 3D:

If it looks confusing:

• Plane a has no elevation
• Plane b is elevated on plane a by $$\theta$$
• $$\phi$$ is the angle made between the x-axis and Plane a

Think about the 2D cartesian graph turning into the 3D cartesian graph above, but now the entire slope is shifted by angle of $$\phi$$ in the horizontal direction (from the x-axis).

Now, to calculate $$\vec{n}$$ in 3D graph, do the same rules apply as the 2D graph (ie, $$\vec{n} = (\sin{\theta}, -\cos{\theta}, z)$$, and if so, how would we calculate z? Basically, I want to calculate the normal of plane b using its angle of inclination. Any help is appreciated!

EDIT:

I know $$\angle X$$ (Angle made with the y-axis / its rotation around the x-axis)

I know $$\angle Y$$ (Angle made with the x-axis / its rotation around the y-axis)

I know $$\angle Z = \theta$$ (Angle made with the x-axis / its rotation around the z-axis)

Is it now possible to calculate $$\phi$$? ... so that I can calculate the normal.

• Spherical coordinates will help Aug 26, 2021 at 9:11
• @Vedant Chourey Thanks for the suggestion, but I do not quite understand... Aug 26, 2021 at 9:15

Given a normal vector in the space $$N=(A,B,C)$$ the first step is to make this vector unitary by

$$n=\frac{N}{|N|}=\left(\frac{A}{\sqrt{A^2+B^2+C^2}},\frac{B}{\sqrt{A^2+B^2+C^2}},\frac{C}{\sqrt{A^2+B^2+C^2}}\right)=(a,b,c)$$

then by spherical coordinates, beeing $$r=|n|=1$$, we have

• $$a=\cos \theta \sin \phi$$
• $$b=\sin \theta \sin \phi$$
• $$c=\cos \phi$$

with

• $$\phi = \arccos c$$
• $$\theta = \arctan \frac a b$$ (adjusting properly for the qudrant and in case $$b=0$$; see also atan2 function)

(credit Wikipedia)

Edit

What you have are the angles for direction cosines, therefore with your symbols

• $$a= \cos y$$
• $$b=\cos x$$
• I understand how the angles and sides work, but I cannot understand how you have used it to achieve the unit normal of the line. Aug 26, 2021 at 11:37
• I’ve assumed we already have a normal vector. Are you interested on how we can obtain a normal?
– user
Aug 26, 2021 at 11:59
• Yes, please, thank you! Aug 26, 2021 at 13:14
• @SnipingPoodle We can consider the normal in space only for surfaces but I see you are referring to a line. Could you please better clarify this point? What is the line or surface for which you need to obtain the/a normal?
– user
Aug 26, 2021 at 13:16
• Its actually a surface; I cannot calculate the plane/surface's normal using the equation $(ax + by +cz +d = 0)$, which is why i am trying to calculate its normal using its angle of inclination. Aug 26, 2021 at 14:04