Advertisement
blakeman

Untitled

Sep 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1.  
  2. public class SemiCircle
  3. {
  4. private int x;
  5. private int y;
  6. private int radius;
  7.  
  8. /**
  9. * Constructor for objects of class SemiCircle
  10. * @param centerX is x
  11. * @param centerY is the y
  12. * @param theRadius is the radius
  13. */
  14. public SemiCircle(int centerX, int centerY,int theRadius)
  15. {
  16. this.x = centerX;
  17. this.y = centerY;
  18. this.radius = theRadius;
  19. }
  20. public boolean contains(int otherX, int otherY)
  21. {
  22.  
  23. if(otherX > otherY){
  24. return true;
  25.  
  26. }
  27. else{
  28. return false;
  29. }
  30. }
  31. public boolean intersects( SemiCircle other)
  32. {
  33. if(x < y){
  34. return true;
  35.  
  36. }
  37. else{
  38. return false;
  39. }
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement