I want to plot x and y axis likea grid , so when user want to see the grid be able to see that !
here is the code I wrote but it only shows x = 0 and y = 0
- void setup() {
- size(screenWidth, screenHeight);
- }
- void draw() {
- translate(width/2, height/2);
- for ( int i = 0 ; i < width ; i++) {
- line(i, 0,width,0);
- line(-i,0,width,0);
- }
- for ( int j = 0 ; j < height ; j++) {
- line(0,j,0,height);
- line(0,-j,0,-height);
- }
- }
any body know why ?
1