Guest User

Untitled

a guest
Jan 22nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2. public class AlgoPointMilieu {
  3.  
  4. /**
  5. * @param args
  6. */
  7. public static void main(String[] args) {
  8. // TODO Auto-generated method stub
  9. middlePointCircle(6);
  10. }
  11.  
  12. static void middlePointCircle(int rayon)
  13. {
  14. // Restriction : centre du cercle à (0,0)
  15. int x = 0;
  16. int y = rayon;
  17. double d = 5.0/4.0 - rayon;
  18. //DessinerPointsCercle(x,y);
  19. System.out.println( "D:" + d +" X:" + x + " Y:" + y );
  20. while(y>x){
  21. if(d<0){
  22. d += 2.0*x + 3.0;
  23. System.out.print("D:" + d);
  24. }
  25. else{
  26. d += 2.0*x - 3.0*y + 5.0;
  27. System.out.print("D:" + d);
  28.  
  29.  
  30. y--;
  31. }
  32. x++;
  33. //DessinerPointsCercle(x,y);
  34. System.out.println(" X:" + x + " Y:" + y);
  35.  
  36. }
  37. }
  38. }
Add Comment
Please, Sign In to add comment