Question: Write Python code to define a function myDist() that takes two parameters x and y and calculates the distance the point (x, y) and the
Write Python code to define a function myDist() that takes two parameters x and y and calculates the distance the point (x, y) and the origin (0,0). Use the Euclidean distance formula to calculate the distance.
Next write a function isIn() which returns nothing but prints whether or not or not the point (x, y) is inside a circle of radius r.
isIn() should take in three parameters: x, y and r. It should call myDist()..
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
