Check whether given circle resides in boundary maintained by two other circles | function to check if given circle fit in boundary or not ; Distance from the center ; Checking the corners of circle ; Radius of outer circle and inner circle respectively ; Co - ordinates and radius of the circle to be checked
< ? php function fitOrNotFit ( $ R , $ r , $ x , $ y , $ rad ) { $ val = sqrt ( pow ( $ x , 2 ) + pow ( $ y , 2 ) ) ; if ( $ val + $ rad <= $ R && $ val - $ rad >= $ R - $ r ) echo " Fits STRNEWLINE " ; else echo " Doesn ' t ▁ Fit STRNEWLINE " ; } $ R = 8 ; $ r = 4 ; $ x = 5 ; $ y = 3 ; $ rad = 3 ; fitOrNotFit ( $ R , $ r , $ x , $ y , $ rad ) ; ? >