Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (x - x0)^2 + (y - y0)^2 <= R^2
- function foo(int $x, int $y){
- $x0 = -2;
- $y0 = 0;
- $radius_min = 1;
- $radius_max = 2;
- if($x >= -1){
- return TRUE;
- }
- $radius = sqrt(pow($x - $x0, 2) + pow($y - $y0, 2));
- return $radius_min <= $radius && $radius <= $radius_max;
- }
Add Comment
Please, Sign In to add comment