The Quadrant Navigator
MediumAcc. 92.4%
+30 XP 12
Navigator's Map
In the Cartesian plane, every coordinate (x, y) tells a story. Your goal is to identify which "Quadrant" a point belongs to, or if it sits exactly on the axes of the world.
The Map Rules
- Origin: Both x and y are
0. - X-axis: y is
0, but x is not. - Y-axis: x is
0, but y is not. - Quadrant 1: x and y are both positive.
- Quadrant 2: x is negative, y is positive.
- Quadrant 3: x and y are both negative.
- Quadrant 4: x is positive, y is negative.
Your Task
Receive x and y and return the correct string (Origin, X-axis, Y-axis, Quadrant 1, Quadrant 2, etc.).
01EXAMPLE 1
Input
x=5, y=5Output
"Quadrant 1"Explanation: Both positive.
02EXAMPLE 2
Input
x=0, y=-10Output
"Y-axis"Explanation: On the vertical line.
Constraints
- Return the string exactly as shown in the rules.
- Ensure "Origin" check happens first.
Control FlowMathGeometry
JavaScriptSystem handles I/O — write your function only
Loading...
4 Hidden
Input Arguments
x0
y0
Expected Output
Origin
Click RUN to test your solution