Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AlgoPointMilieu {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- middlePointCircle(6);
- }
- static void middlePointCircle(int rayon)
- {
- // Restriction : centre du cercle à (0,0)
- int x = 0;
- int y = rayon;
- double d = 5.0/4.0 - rayon;
- //DessinerPointsCercle(x,y);
- System.out.println( "D:" + d +" X:" + x + " Y:" + y );
- while(y>x){
- if(d<0){
- d += 2.0*x + 3.0;
- System.out.print("D:" + d);
- }
- else{
- d += 2.0*x - 3.0*y + 5.0;
- System.out.print("D:" + d);
- y--;
- }
- x++;
- //DessinerPointsCercle(x,y);
- System.out.println(" X:" + x + " Y:" + y);
- }
- }
- }
Add Comment
Please, Sign In to add comment