Given two planes P1: a1 * x + b1 * y + c1 * z + d1 = 0 and P2: a2 * x + b2 * y + c2 * z + d2 = 0. The task is to find the angle between these two planes in 3D.
Input: a1 = 1, b1 = 1, c1 = 2, d1 = 1, a2 = 2, b2 = -1, c2 = 1, d2 = -4
Output: Angle is 60.0 degree
Input: a1 = 2, b1 = 2, c1 = -3, d1 = -5, a2 = 3, b2 = -3, c2 = 5, d2 = -6
Output: Angle is 123.696598882 degree
Approach: Consider the below equations of given two planes:
P1 : a1 * x + b1 * y + c1 * z + d1 = 0 and, P2 : a2 * x + b2 * y + c2 * z + d2 = 0,
where a1, b1, c1, and a2, b2, c2 are direction ratios of normal to the plane P1 and P2.
The angle between two planes is equal to the angle determined by the normal vectors of the planes.
Angle between these planes is given by using the following formula:-
Cos A =
Using inverse property, we get:
Below is the implementation of the above formulae:
Angle is 60.0 degree
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Nth angle of a Polygon whose initial angle and per angle increment is given
- Area of Triangle using Side-Angle-Side (length of two sides and the included angle)
- Angle between a chord and a tangent when angle in the alternate segment is given
- Distance between two parallel Planes in 3-D
- Angle subtended by the chord when the angle subtended by another chord of same length is given
- Exterior angle of a cyclic quadrilateral when the opposite interior angle is given
- Angle subtended by the chord to center of the circle when the angle subtended by the another equal chord of a congruent circle is given
- Program to calculate angle on circumference subtended by the chord when the central angle subtended by the chord is given
- Maximum number of line intersections formed through intersection of N planes
- Find other two sides of a right angle triangle
- Find other two sides and angles of a right angle triangle
- Calculate the angle between hour hand and minute hand
- Find a time for which angle between hour and minute hands is given theta
- Angle between 3 given vertices in a n-sided regular polygon
- Angle between a Pair of Lines in 3D
- Length of diagonal of a parallelogram using adjacent sides and angle between them
- Program to print binary right angle triangle
- Find if it's possible to rotate the page by an angle or not.
- Maximum number of squares that can fit in a right angle isosceles triangle
- Arc length from given Angle
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.