+ 2

Can anyone give shorter version of my code?

Here we are given a circle with radius and center and a axis aligned rectangle whose bottom left and top right coordinaates are given . We have to tell if they overlap Sample input: Radius xcenter ycenter X1 y1 x2 y2 ie. 1 0 0 1 -1 3 1 Output: true My code link is https://code.sololearn.com/cvjmzKzKEYpq/?ref=app

6th Jul 2020, 11:44 AM
Prince Yadav
Prince Yadav - avatar
6 Respuestas
0
What do you mean by axis aligned rectangle exactly?
6th Jul 2020, 2:50 PM
Nishant Sharma
Nishant Sharma - avatar
0
Nishant Sharma it means it sides are parallel to the axes I hope now you understand
7th Jul 2020, 1:08 AM
Prince Yadav
Prince Yadav - avatar
0
may be, forming the circles's equation and substituting the values
7th Jul 2020, 5:43 PM
Hima
Hima - avatar
0
Hima I have used same logic Any another logic?
8th Jul 2020, 5:06 AM
Prince Yadav
Prince Yadav - avatar
0
Then read about hypot function in python to shorten the code
8th Jul 2020, 5:42 AM
Hima
Hima - avatar
0
Prince Yadav logic is same
8th Jul 2020, 5:42 AM
Hima
Hima - avatar