Find if a #point belongs to a #circle with its #centre as #origin #Python

preview_player
Показать описание
Music Credits
Music Cuba
Musician ASHUTOSH

Link to Python Basics:
👇👇👇

Link to Computer System and Python Fundamentals:
👇👇👇

Link to Python Codes:
👇👇👇

Link to String and Math Functions:
👇👇👇

Link to Lists, Sets & Dictionary Functions:
👇👇👇

Link to Patterns:
👇👇👇

Link to Python Library Programs:
👇👇👇
Рекомендации по теме
Комментарии
Автор

#Source_code:
#PYTHON PROGRAM TO FIND DOES THE POINT BELONG TO A CIRCLE WITH ITS CENTRE AT ORIGIN?

#for a circle with ORIGIN as centre, equation is:
# x²+y²=r²

import math
print('Point:')
x=float(input('x= '))
y=float(input('y= '))
r=float(input('Radius of circle: '))
hyp=math.sqrt(math.pow(x, 2)+math.pow(y, 2))

#comparison
if hyp<r:
print('Point lies inside the cirlce')
elif hyp==r:
print('Point lies on the circle')
else:
print('Point does not belong to circle')

snehaiitian