Given co-ordinates (x, y), determine the quadrant of the cartesian plane.
Image_source : wikipedia.org
Input : x = 1, y = 1 Output : lies in 1st quadrant Input : x = 0, y = 0 Output : lies at origin
There are 9 conditions that needs to be checked to determine where does the points lies –
If in first quadrant then, x > 0 and y > 0 If in second quadrant then, x < 0 and y > 0 If in third quadrant then, x < 0 and y < 0 If in fourth quadrant then, x > 0 and y < 0 If in positive x-axis then, y = 0 and x > 0 If in negative x-axis then, y = 0 and x < 0 If in positive y-axis then, x = 0 and y > 0 If in negative y-axis then, x = 0 and y < 0 If at origin then, x = 0 and y = 0
Below is the implementation of the above approach :
lies in First quadrant
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 a Complex number
- Program to determine the octant of the axial plane
- Finding Quadrant of a Coordinate with respect to a Circle
- Number of possible Triangles in a Cartesian coordinate system
- Cartesian Product of Two Sets
- Cartesian Product of any number of sets
- 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
- 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
- Hammered distance between N points in a 2-D plane
- 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
- Find the equation of plane which passes through two points and parallel to a given axis
- Determine whether a given number is a Hyperperfect Number
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.
Improved By : jit_t