Given 3 coordinates x, y and z, the task is to determine the octant of the axial plane.
Input: 2, 3, 4
Output: Point lies in 1st octant
Input: -4, 2, -8
Output: Point lies in 6th octant
Input: -6, -2, 8
Output: Point lies in 3rd octant
Approach: Given below are the conditions which need to be checked in order to determine the octant of the axial plane.
- Check if x >= 0 and y >= 0 and z >= 0, then Point lies in 1st octant.
- Check x < 0 and y >= 0 and z >= 0, then Point lies in 2nd octant.
- Check if x < 0 and y < 0 and z >= 0, then Point lies in 3rd octant.
- Check if x >= 0 and y < 0 and z >= 0, then Point lies in 4th octant.
- Check if x >= 0 and y >= 0 and z < 0, then Point lies in 5th octant.
- Check if x < 0 and y >= 0 and z < 0, then Point lies in 6th octant.
- Check if x < 0 and y < 0 and z < 0, then Point lies in 7th octant.
- Check if x >= 0 and y < 0 and z < 0, then Point lies in 8th octant.
Below is the implementation of the above approach:
Point lies in 1st octant Point lies in 6th octant Point lies in 3rd octant
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.
- Program to determine the quadrant of the cartesian plane
- Program to find equation of a plane passing through 3 points
- Program to check whether 4 points in a 3-D plane are Coplanar
- Program to find X, Y and Z intercepts of a plane
- Program to determine focal length of a spherical mirror
- Program to determine the Quadrant of a Complex number
- Count of parallelograms in a plane
- Find mirror image of a point in 2-D plane
- Maximum distance between two points in coordinate plane using Rotating Caliper's Method
- Number of jump required of given length to reach a point of form (d, 0) from origin in 2D plane
- Shortest distance between a Line and a Point in a 3-D plane
- Number of triangles in a plane if no more than two points are collinear
- Mirror of a point through a 3 D plane
- Distance between a point and a Plane in 3 D
- Check if a line at 45 degree can divide the plane into two equal weight parts
- Find the foot of perpendicular of a point in a 3 D plane
- Find foot of perpendicular from a point in 2 D plane to a Line
- Maximum number of region in which N non-parallel lines can divide a plane
- Count of intersections of M line segments with N vertical lines in XY plane
- Find the equation of plane which passes through two points and parallel to a given axis
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.