Question
Write a simple python program to find out on which quadrant does the given point lies in. Assume that the user inputs x-coordinate and y-coordinate
Write a simple python program to find out on which quadrant does the given point lies in. Assume that the user inputs x-coordinate and y-coordinate values. Based on the user inputs, you need to decide whether the given point lies in 1st, 2nd , 3rd or 4th quadrant. Also, you need to check, if the user input lies along the axis. The diagram has been shown below for illustration:
You also need to calculate the distance between the origin and the entered point. For this question, you can import math library. Sample Test Data:
Please enter the x-coordinate: 5
Please enter the y-coordinate: 2 Sample Output:
The point lies in the I quadrant. The distance between the points (0,0) and (5,2) is 5.38 unit. Sample Test Data:
Please enter the x-coordinate: 0
Please enter the y-coordinate: 2 Sample Output:
The line lies on the y-axis.
The distance between the points (0,0) and (0,2) is 2.00 unit.
y-axis X-axis IVStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started