Guest User

Untitled

a guest
May 16th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. (x - x0)^2 + (y - y0)^2 <= R^2
  2.  
  3. function foo(int $x, int $y){
  4. $x0 = -2;
  5. $y0 = 0;
  6. $radius_min = 1;
  7. $radius_max = 2;
  8.  
  9. if($x >= -1){
  10. return TRUE;
  11. }
  12.  
  13. $radius = sqrt(pow($x - $x0, 2) + pow($y - $y0, 2));
  14.  
  15.  
  16. return $radius_min <= $radius && $radius <= $radius_max;
  17.  
  18. }
Add Comment
Please, Sign In to add comment