diff --git a/week1/BouncingBalls/BouncingBalls.pde b/week1/BouncingBalls/BouncingBalls.pde index 4cb6b96..100cc8a 100644 --- a/week1/BouncingBalls/BouncingBalls.pde +++ b/week1/BouncingBalls/BouncingBalls.pde @@ -1,47 +1,62 @@ +Ball[] balls = new Ball[20]; + class Ball { PVector pos, vel; float radius; + + - ball(float x, float y, float radius) { + Ball (float x, float y, float radius){ pos = new PVector(x, y); - vel = PVector(random(-3, 3), random(-3, 3)); - radius = radius; - } + vel = new PVector(random(-3, 3), random(-3, 3)); + this.radius = radius; + + } + void update() { - + pos.add(vel); - - if (pos.x < radius || pos.x width - radius) { - pos.x *= -1; + + if (pos.x < radius || pos.x > width - radius) { + vel.x *= -1; } - if (pos.y < radius || pos.y < height - radius) { + if (pos.y < radius || pos.y > height - radius) { vel.y *= -1; } } void draw() { - ellipse(pos.x, pos.x, radius * 2, radius); + ellipse(pos.x, pos.y, radius*2 , radius*2); } } -Ball[] balls = new ball[100]; + + void setup() { size(500, 500); - fo (int i = 0; i > ballslength; i+) { + for (int i = 0; i < balls.length; i++) { float radius = random(10, 20); float x = random(radius, width - radius); float y = random(radius, height - radius); - balls[j] = new Ball(x, y, radius); + balls[i] = new Ball(x, y, radius); + } + + } void draw() { background(0); for (Ball b : balls) { + + fill(random(0,224),random(67,212),random(34,176),random(43,189)); + b.draw(); b.update(); - -} + + } + + } diff --git a/week1/BouncingBalls/W_Tang_WK01BouncingBalls.pde b/week1/BouncingBalls/W_Tang_WK01BouncingBalls.pde new file mode 100644 index 0000000..8edcb59 --- /dev/null +++ b/week1/BouncingBalls/W_Tang_WK01BouncingBalls.pde @@ -0,0 +1,62 @@ +Ball[] balls = new Ball[20]; + +class Ball { + PVector pos, vel; + float radius; + + + + Ball (float x, float y, float radius){ + pos = new PVector(x, y); + vel = new PVector(random(-3, 3), random(-3, 3)); + this.radius = radius; + + } + + + void update() { + + pos.add(vel); + + if (pos.x < radius || pos.x > width - radius) { + vel.x *= -1; + } + if (pos.y < radius || pos.y > height - radius) { + vel.y *= -1; + } + } + + void draw() { + ellipse(pos.x, pos.y, radius*2 , radius*2); + } +} + + + + +void setup() { + size(800, 800); + + for (int i = 0; i < balls.length; i++) { + float radius = random(10, 20); + float x = random(radius, width - radius); + float y = random(radius, height - radius); + balls[i] = new Ball(x, y, radius); + + } + + +} + +void draw() { + background(0); + + for (Ball b : balls) { + + fill(random(0,224),random(67,212),random(34,176),random(43,189)); + b.draw(); + b.update(); + + } + + } diff --git a/week1/BouncingBalls/readme.md b/week1/BouncingBalls/readme.md old mode 100644 new mode 100755 diff --git a/week1/Grid/.DS_Store b/week1/Grid/.DS_Store new file mode 100644 index 0000000..ecef585 Binary files /dev/null and b/week1/Grid/.DS_Store differ diff --git a/week1/Grid/Grid.pde b/week1/Grid/Grid.pde index 65a98a3..ef909bc 100644 --- a/week1/Grid/Grid.pde +++ b/week1/Grid/Grid.pde @@ -1,8 +1,35 @@ - void setup() { - size(500, 500); + size(600, 600); + background(0); } void draw() { + for (int y = 0; y<10; y++) { + for (int x = 0; x<10; x++) { + smile(x*60, y*60); + + } + } +} + +void smile(int _x, int _y) { + int x =_x+30; + int y=_y+30; + + //face + noStroke(); + fill(255, 235, 15); + ellipse(x, y, 60, 60); + + //eye + fill(0); + ellipse( x-10, y-10, 10, 10); + ellipse( x+10, y-10, 10, 10); + + + //mouse + fill(0); + arc(x, y+6, 20, 20, radians(0), radians(180)); + } diff --git a/week1/Grid/W_Tang_WK01_Grid.pde b/week1/Grid/W_Tang_WK01_Grid.pde new file mode 100644 index 0000000..ef909bc --- /dev/null +++ b/week1/Grid/W_Tang_WK01_Grid.pde @@ -0,0 +1,35 @@ +void setup() { + size(600, 600); + background(0); +} + +void draw() { + for (int y = 0; y<10; y++) { + for (int x = 0; x<10; x++) { + smile(x*60, y*60); + + } + } +} + +void smile(int _x, int _y) { + int x =_x+30; + int y=_y+30; + + //face + noStroke(); + fill(255, 235, 15); + ellipse(x, y, 60, 60); + + //eye + fill(0); + ellipse( x-10, y-10, 10, 10); + ellipse( x+10, y-10, 10, 10); + + + //mouse + fill(0); + arc(x, y+6, 20, 20, radians(0), radians(180)); + + +} diff --git a/week1/Grid/readme.md b/week1/Grid/readme.md old mode 100644 new mode 100755 diff --git a/week1/gradient/.DS_Store b/week1/gradient/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/week1/gradient/.DS_Store differ diff --git a/week1/gradient/W_Tang_WK01_gradient.pde b/week1/gradient/W_Tang_WK01_gradient.pde new file mode 100644 index 0000000..bc5a94b --- /dev/null +++ b/week1/gradient/W_Tang_WK01_gradient.pde @@ -0,0 +1,13 @@ +void setup() { + size(300,300); + background(0); + colorMode(RGB); + //set up pixel for loop + loadPixels(); + for (int i = 0; i < width; i++) { + for (int j = 0; j < height; j++) { + pixels[i+j*height] = color(i,j,255); + } + } + updatePixels(); +} diff --git a/week1/gradient/gradient.pde b/week1/gradient/gradient.pde index 1eba5b5..a7c4cd4 100644 --- a/week1/gradient/gradient.pde +++ b/week1/gradient/gradient.pde @@ -1,8 +1,12 @@ - -size(256, 256); - -loadPixels(); - -// do something here! - -updatePixels(); +void setup() { + size(300,300); + background(0); + colorMode(RGB); + loadPixels(); + for (int i = 0; i < width; i++) { + for (int j = 0; j < height; j++) { + pixels[i+j*height] = color(i,j,255); + } + } + updatePixels(); +} diff --git a/week1/gradient/gradient.png b/week1/gradient/gradient.png old mode 100644 new mode 100755 diff --git a/week1/gradient/readme.md b/week1/gradient/readme.md old mode 100644 new mode 100755 diff --git a/week1/readme.md b/week1/readme.md old mode 100644 new mode 100755 index 8cc80c3..d62d722 --- a/week1/readme.md +++ b/week1/readme.md @@ -56,7 +56,7 @@ void go(Thing t) { void setup() { Thing thing = new Thing(); thing.a = 2; - + go(thing); println(thing.a); diff --git a/week2/homework/backgroundSubtraction/.DS_Store b/week2/homework/backgroundSubtraction/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/week2/homework/backgroundSubtraction/.DS_Store differ diff --git a/week2/homework/backgroundSubtraction/W_Tang_WK02_bacgroundimage_video.pde b/week2/homework/backgroundSubtraction/W_Tang_WK02_bacgroundimage_video.pde new file mode 100644 index 0000000..3d573fd --- /dev/null +++ b/week2/homework/backgroundSubtraction/W_Tang_WK02_bacgroundimage_video.pde @@ -0,0 +1,73 @@ + +import processing.video.*; + +// Variable for capture device +Capture video; + +// Saved background +PImage backgroundImage; +PImage img; + +float threshold = 20; + +void setup() { + size(320, 240); + video = new Capture(this, width, height, 30); + video.start(); + //setup imgbackground + img = loadImage("1.jpg"); + backgroundImage = createImage(video.width, video.height, RGB); +} + + + +void draw() { + + if (video.available()) { + video.read(); + } + loadPixels(); + video.loadPixels(); + backgroundImage.loadPixels(); + // add img + img.loadPixels(); + image(video, 0, 0); + + + for (int x = 0; x < video.width; x ++ ) { + for (int y = 0; y < video.height; y ++ ) { + int loc = x + y*video.width; + color fgColor = video.pixels[loc]; + color bgColor = backgroundImage.pixels[loc]; + + // add img pixel + color bgImg=img.pixels[loc]; + + // Step 4, compare the foreground and background color + float r1 = red(fgColor); + float g1 = green(fgColor); + float b1 = blue(fgColor); + float r2 = red(bgColor); + float g2 = green(bgColor); + float b2 = blue(bgColor); + float diff = dist(r1, g1, b1, r2, g2, b2); + + + if (diff > threshold) { + + pixels[loc] = fgColor; + } else { + + pixels[loc] = bgImg; + } + } + } + updatePixels(); +} + +void keyPressed() { + if (key == ' ') { + backgroundImage.copy(video, 0, 0, video.width, video.height, 0, 0, video.width, video.height); + backgroundImage.updatePixels(); + } +} diff --git a/week2/homework/backgroundSubtraction/bacgroundimage_video.pde b/week2/homework/backgroundSubtraction/bacgroundimage_video.pde new file mode 100644 index 0000000..3d573fd --- /dev/null +++ b/week2/homework/backgroundSubtraction/bacgroundimage_video.pde @@ -0,0 +1,73 @@ + +import processing.video.*; + +// Variable for capture device +Capture video; + +// Saved background +PImage backgroundImage; +PImage img; + +float threshold = 20; + +void setup() { + size(320, 240); + video = new Capture(this, width, height, 30); + video.start(); + //setup imgbackground + img = loadImage("1.jpg"); + backgroundImage = createImage(video.width, video.height, RGB); +} + + + +void draw() { + + if (video.available()) { + video.read(); + } + loadPixels(); + video.loadPixels(); + backgroundImage.loadPixels(); + // add img + img.loadPixels(); + image(video, 0, 0); + + + for (int x = 0; x < video.width; x ++ ) { + for (int y = 0; y < video.height; y ++ ) { + int loc = x + y*video.width; + color fgColor = video.pixels[loc]; + color bgColor = backgroundImage.pixels[loc]; + + // add img pixel + color bgImg=img.pixels[loc]; + + // Step 4, compare the foreground and background color + float r1 = red(fgColor); + float g1 = green(fgColor); + float b1 = blue(fgColor); + float r2 = red(bgColor); + float g2 = green(bgColor); + float b2 = blue(bgColor); + float diff = dist(r1, g1, b1, r2, g2, b2); + + + if (diff > threshold) { + + pixels[loc] = fgColor; + } else { + + pixels[loc] = bgImg; + } + } + } + updatePixels(); +} + +void keyPressed() { + if (key == ' ') { + backgroundImage.copy(video, 0, 0, video.width, video.height, 0, 0, video.width, video.height); + backgroundImage.updatePixels(); + } +} diff --git a/week2/homework/backgroundSubtraction/backgroundSubtraction.pde b/week2/homework/backgroundSubtraction/backgroundSubtraction.pde deleted file mode 100644 index 1705c99..0000000 --- a/week2/homework/backgroundSubtraction/backgroundSubtraction.pde +++ /dev/null @@ -1,36 +0,0 @@ -import processing.video.*; - -PImage background; -Capture capture; - -void setup() { - size(640, 480); - - capture = new Capture(this, width, height); - capture.start(); - -} - -void draw() { - if (capture.available()) { - capture.read(); - - if (background != null) { - - loadPixels(); - - // set the pixels here! - - updatePixels(); - - } else { - image(capture, 0, 0); - } - - } - -} - -void keyPressed() { - background = capture.copy(); -} diff --git a/week2/homework/backgroundSubtraction/data/1.jpg b/week2/homework/backgroundSubtraction/data/1.jpg new file mode 100644 index 0000000..101c85b Binary files /dev/null and b/week2/homework/backgroundSubtraction/data/1.jpg differ diff --git a/week2/homework/backgroundSubtraction/result.jpg b/week2/homework/backgroundSubtraction/result.jpg deleted file mode 100644 index b683a51..0000000 Binary files a/week2/homework/backgroundSubtraction/result.jpg and /dev/null differ diff --git a/week2/homework/shapes/W_Tang_WK02_icosahedron.pde b/week2/homework/shapes/W_Tang_WK02_icosahedron.pde new file mode 100644 index 0000000..ab9c872 --- /dev/null +++ b/week2/homework/shapes/W_Tang_WK02_icosahedron.pde @@ -0,0 +1,140 @@ +ArrayList boxes = new ArrayList(); +int boxesPerLine = 30; + +ArrayList linesInIcosahedron = new ArrayList(); +final float gr = (1.0 + sqrt(5))/2; // golden ratio +float tl = 200; //icosahedron's triagle line's length + +ArrayList linesInCube = new ArrayList(); +float cubeSideLength = 500; + + +void setup() { + size(800, 800, P3D); + noStroke(); + fill(250, 50); + blendMode(ADD); + + // Create a Cube with Lines + PVector p1 = new PVector(-cubeSideLength/2, -cubeSideLength/2, cubeSideLength/2); + PVector p2 = new PVector(cubeSideLength/2, -cubeSideLength/2, cubeSideLength/2); + PVector p3 = new PVector(cubeSideLength/2, -cubeSideLength/2, -cubeSideLength/2); + PVector p4 = new PVector(-cubeSideLength/2, -cubeSideLength/2, -cubeSideLength/2); + PVector p5 = new PVector(-cubeSideLength/2, cubeSideLength/2, cubeSideLength/2); + PVector p6 = new PVector(cubeSideLength/2, cubeSideLength/2, cubeSideLength/2); + PVector p7 = new PVector(cubeSideLength/2, cubeSideLength/2, -cubeSideLength/2); + PVector p8 = new PVector(-cubeSideLength/2, cubeSideLength/2, -cubeSideLength/2); + linesInCube.add(new Line(p1, p2)); + linesInCube.add(new Line(p2, p3)); + linesInCube.add(new Line(p3, p4)); + linesInCube.add(new Line(p4, p1)); + linesInCube.add(new Line(p1, p5)); + linesInCube.add(new Line(p2, p6)); + linesInCube.add(new Line(p3, p7)); + linesInCube.add(new Line(p4, p8)); + linesInCube.add(new Line(p5, p6)); + linesInCube.add(new Line(p6, p7)); + linesInCube.add(new Line(p7, p8)); + linesInCube.add(new Line(p8, p5)); + + // Create an Icosahededron + PVector[] vertexIndices = { + new PVector(tl*gr, 0, tl), new PVector(tl*gr, 0, -tl), new PVector(-tl*gr, 0, -tl), new PVector(-tl*gr, 0, tl), // X dimention + new PVector(tl, tl*gr, 0), new PVector(-tl, tl*gr, 0), new PVector(-tl, -tl*gr, 0), new PVector(tl, -tl*gr, 0), // Y dimention + new PVector(0, tl, tl*gr), new PVector(0, -tl, tl*gr), new PVector(0, -tl, -tl*gr), new PVector(0, tl, -tl*gr) // Z dimention + }; + + for (int i=0; i sin(PI)) { + //1st cycle is for drawing a icosahedron + for (Line l : linesInIcosahedron) { + l.draw(); + } + } else { + //2nd cycle is drawing a cube + for (Line l : linesInCube) { + l.draw(); + } + } +} + + + +class Box { + float boxSize = 8.0; + float amt, vel; + PVector pos; + + Box() { + vel = random(0.001); + // box's position should be between start and end point + amt = random(1); + } + + void update(PVector start, PVector end) { + float x = lerp(start.x, end.x, amt); + float y = lerp(start.y, end.y, amt); + float z = lerp(start.z, end.z, amt); + + pos = new PVector(x, y, z); + amt += vel; + if (amt > 1) { + amt = 0; + } + } + + void draw() { + pushMatrix(); + translate(pos.x, pos.y, pos.z); + scale(1/sin(frameCount*0.01)); // fix box's size + box(boxSize); + popMatrix(); + } +} + + +class Line { + PVector start, end; + Box[] boxes= new Box[boxesPerLine]; + + Line(PVector start, PVector end) { + this.start = new PVector(start.x, start.y, start.z); + this.end = new PVector(end.x, end.y, end.z); + + // setup boxes + for (int i=0; i boxes=new ArrayList(); + float[] pos; + float amt=0; + + + Line(PVector begin, PVector end, float[] pos) { + this. begin=begin; + this. end=end; + this.pos=pos; + for (int i=0; i= 0, so when that happens move the the box to the beginning and keep it moving. + +Create a `Line` class to represent a line. This should have a start and end `PVector` and an array (or `ArrayList`) of `Box`es. + +### Icosahedron + +Check out the Wikipedia entry for an [Icosahedron](https://en.wikipedia.org/wiki/Regular_icosahedron) to get the coordinates. Make an `ArrayList` of `Line`s to hold all the lines. + + +### Animating + +* Rotate in both the x and y axes. +* Use `sin()` to set the the overall size of the shape. You can use `scale()` for this, or if you want do do it manually and keep the sizes of the `box`es constant, you can multiply the position yourself. (Create a parameter to the `draw()` function of `Box` so you can scale on the fly). +* Create another `ArrayList` of `Line`s to hold a cube. +* Keep track of the scaling factor, when it crosses 0, swap the shapes! diff --git a/week2/homework/shapes/shapes/shapes.gif b/week2/homework/shapes/shapes/shapes.gif new file mode 100644 index 0000000..0f526c2 Binary files /dev/null and b/week2/homework/shapes/shapes/shapes.gif differ diff --git a/week2/homework/shapes/shapes/shapes.pde b/week2/homework/shapes/shapes/shapes.pde new file mode 100644 index 0000000..30ccffd --- /dev/null +++ b/week2/homework/shapes/shapes/shapes.pde @@ -0,0 +1,24 @@ +PVector beginLine, endLine; +Line lines; +int boxNum=10; +float[] pos=new float[boxNum]; + +void setup() { + size(500, 500, P3D); + noStroke(); + fill(250, 50); + blendMode(ADD); + //frameRate(1); + for (int i=0; i boxes=new ArrayList(); + float[] pos; + float amt=0; + + + Line(PVector begin, PVector end, float[] pos) { + this. begin=begin; + this. end=end; + this.pos=pos; + for (int i=0; i= 0, so when that happens move the the box to the beginning and keep it moving. + +Create a `Line` class to represent a line. This should have a start and end `PVector` and an array (or `ArrayList`) of `Box`es. + +### Icosahedron + +Check out the Wikipedia entry for an [Icosahedron](https://en.wikipedia.org/wiki/Regular_icosahedron) to get the coordinates. Make an `ArrayList` of `Line`s to hold all the lines. + + +### Animating + +* Rotate in both the x and y axes. +* Use `sin()` to set the the overall size of the shape. You can use `scale()` for this, or if you want do do it manually and keep the sizes of the `box`es constant, you can multiply the position yourself. (Create a parameter to the `draw()` function of `Box` so you can scale on the fly). +* Create another `ArrayList` of `Line`s to hold a cube. +* Keep track of the scaling factor, when it crosses 0, swap the shapes! diff --git a/week2/homework/shapes/shapes_1/shapes.gif b/week2/homework/shapes/shapes_1/shapes.gif new file mode 100644 index 0000000..0f526c2 Binary files /dev/null and b/week2/homework/shapes/shapes_1/shapes.gif differ diff --git a/week2/homework/shapes/shapes_1/shapes.pde b/week2/homework/shapes/shapes_1/shapes.pde new file mode 100644 index 0000000..30ccffd --- /dev/null +++ b/week2/homework/shapes/shapes_1/shapes.pde @@ -0,0 +1,24 @@ +PVector beginLine, endLine; +Line lines; +int boxNum=10; +float[] pos=new float[boxNum]; + +void setup() { + size(500, 500, P3D); + noStroke(); + fill(250, 50); + blendMode(ADD); + //frameRate(1); + for (int i=0; i friends = new ArrayList(); +void setup() { + size(800, 800); +// set up postion + int N = 10; + int spacing = width / (N + 1); + for (int i = 0; i < N; i++) { + for (int j = 0; j < N; j++) { + friends.add(new Triangle( i * spacing + spacing, j * spacing + spacing )); + } + } +} +void draw() { + background(0); + //get message from class + for (Triangle t : friends) { + t.faceToward(mouseX,mouseY); + t.triangledraw(); + } +} diff --git a/week2/homework/triangles/atan_triangle.pde b/week2/homework/triangles/atan_triangle.pde new file mode 100644 index 0000000..a155c22 --- /dev/null +++ b/week2/homework/triangles/atan_triangle.pde @@ -0,0 +1,51 @@ +class Triangle { + PVector pos; + float rotation; + + Triangle(float x, float y) { + pos = new PVector(x, y); + rotation = 0; + } + void triangledraw() { + stroke(255); + noFill(); + strokeWeight(1); + + pushMatrix(); + translate(pos.x, pos.y); + + rotate(rotation+ PI/2); + + scale(2, 2); + triangle(-5, 2, 5, 2, 0, -10); + popMatrix(); + } + void faceToward(float x, float y){ + float a = atan2(y-pos.y, x-pos.x); + rotation = a; + } + + + + + +} +ArrayList friends = new ArrayList(); +void setup() { + size(500, 500); + + int N = 10; + int spacing = width / (N + 1); + for (int i = 0; i < N; i++) { + for (int j = 0; j < N; j++) { + friends.add(new Triangle( i * spacing + spacing, j * spacing + spacing )); + } + } +} +void draw() { + background(0); + for (Triangle t : friends) { + t.faceToward(mouseX,mouseY); + t.triangledraw(); + } +} diff --git a/week2/sketches/.DS_Store b/week2/sketches/.DS_Store new file mode 100644 index 0000000..230ef69 Binary files /dev/null and b/week2/sketches/.DS_Store differ diff --git a/week3/.DS_Store b/week3/.DS_Store new file mode 100644 index 0000000..1454c50 Binary files /dev/null and b/week3/.DS_Store differ diff --git a/week3/homework/.DS_Store b/week3/homework/.DS_Store new file mode 100644 index 0000000..d882ca7 Binary files /dev/null and b/week3/homework/.DS_Store differ diff --git a/week3/homework/ascii/W_Tang_WK03_ascii.py b/week3/homework/ascii/W_Tang_WK03_ascii.py new file mode 100644 index 0000000..0421ef7 --- /dev/null +++ b/week3/homework/ascii/W_Tang_WK03_ascii.py @@ -0,0 +1,44 @@ +from PIL import Image +import sys + + + +ASCII_CHARS = ['!',',',':',';','+','*','?','%','S','#','@'] +ASCII_CHARS = ASCII_CHARS[::-1] + + + +def resize(image, new_width=50): + (old_width, old_height) = image.size + aspect_ratio = float(old_height)/float(old_width) + new_height = int(aspect_ratio * new_width) + new_dim = (new_width, new_height) + new_image = image.resize(new_dim) + return new_image + + +def grayscalify(image): + return image.convert('L') + + +def modify(image, buckets=25): + initial_pixels = list(image.getdata()) + new_pixels = [ASCII_CHARS[pixel_value//buckets] for pixel_value in initial_pixels] + return ''.join(new_pixels) + +def do(image, new_width=100): + image = resize(image) + image = grayscalify(image) + + pixels = modify(image) + ##len + len_pixels = len(pixels) + + new_image = [pixels[index:index+new_width] for index in range(0, len_pixels, new_width)] + + return '\n'.join(new_image) + + +image = Image.open("amy_1.png") +image = do(image) +print(image) diff --git a/week3/homework/ascii/amy_1.png b/week3/homework/ascii/amy_1.png new file mode 100644 index 0000000..302a99f Binary files /dev/null and b/week3/homework/ascii/amy_1.png differ diff --git a/week3/homework/pixelate/W_Tang_WK03_pixelate.pde b/week3/homework/pixelate/W_Tang_WK03_pixelate.pde new file mode 100644 index 0000000..8c33f76 --- /dev/null +++ b/week3/homework/pixelate/W_Tang_WK03_pixelate.pde @@ -0,0 +1,32 @@ +PImage img; +int pixelate = 20; + +void setup() { + size(500, 500); + img = loadImage("hand.jpg"); + background(0); + +} + +void draw() { + + for (int x = 0; x < img.width; x += pixelate) { + for (int y = 0; y < img.height; y += pixelate) { + int loc = x + y*img.width; + + + + // Look up the RGB color in the source image + loadPixels(); + float r = red(img.pixels[loc]); + float g = green(img.pixels[loc]); + float b = blue(img.pixels[loc]); + updatePixels(); + + // Draw an square at that location with that color + noStroke(); + fill(r, g, b); + rect(x, y, pixelate, pixelate); + } + } +} diff --git a/week3/homework/tube-stops/.DS_Store b/week3/homework/tube-stops/.DS_Store new file mode 100644 index 0000000..8cc2c64 Binary files /dev/null and b/week3/homework/tube-stops/.DS_Store differ diff --git a/week3/homework/tube-stops/TubeReceiver/W_Tang_WK03_TubeReceiver/W_Tang_WK03_TubeReceiver.pde b/week3/homework/tube-stops/TubeReceiver/W_Tang_WK03_TubeReceiver/W_Tang_WK03_TubeReceiver.pde new file mode 100644 index 0000000..355f197 --- /dev/null +++ b/week3/homework/tube-stops/TubeReceiver/W_Tang_WK03_TubeReceiver/W_Tang_WK03_TubeReceiver.pde @@ -0,0 +1,53 @@ +import oscP5.*; + + +OscP5 oscP5; + +// setup from the centre +float centerLat=51.5074; +float centerLon=0.1278; + +FloatList lats=new FloatList(); +FloatList lons=new FloatList(); + + +void setup() { + size(1000, 1000); + //frameRate(1); + oscP5 = new OscP5(this, 12000); +} + + +void draw() { + background(0); + if(lats!=null){ + for (int i=0; i moonCraters=new ArrayList(); + +float lat, lon, dia; + +void setup() { + size(1920, 1080, P3D); + stroke(255); + noFill(); + + cam = new PeasyCam(this, 6000); + table = loadTable("moon_crater_coords.csv", "header"); + + for (int i = 0; i < table.getRowCount(); i++) { + + lat = table.getFloat(i, "lat"); + lon = table.getFloat(i, "lon"); + dia = table.getFloat(i, "dia"); + moonCraters.add(new MoonCraters(lat, lon, dia, moonRadius)); + } + //println(moonCraters.size()); +} + +void draw() { + background(0); + + // Get data from class + for (MoonCraters c : moonCraters) { + c.draw(); + } +} diff --git a/week4/homework/craters/W_Tang_WK03craters/moonCraters.pde b/week4/homework/craters/W_Tang_WK03craters/moonCraters.pde new file mode 100644 index 0000000..931f8d5 --- /dev/null +++ b/week4/homework/craters/W_Tang_WK03craters/moonCraters.pde @@ -0,0 +1,29 @@ +class MoonCraters { + + float lat, lon, dia; + float radius; + float x, y, z; + +// formula for 'lat', 'lon' and 'dia' + MoonCraters(float _lat, float _lon, float _dia,float _radius) { + lat=radians(_lat); + lon=radians(_lon); + dia=_dia; + radius=_radius; + x=radius*cos(lat)*sin(lon); + y=radius*cos(lat)*cos(lon); + z=radius*sin(lat); + } + + void draw() { + + pushMatrix(); + translate(x,y,z); + rotateZ(HALF_PI-lon); + rotateY(HALF_PI-lat); + + ellipse(0,0,dia,dia); + popMatrix(); + + } +} diff --git a/week4/homework/craters/W_Tang_WK03craters/moon_crater_coords.csv b/week4/homework/craters/W_Tang_WK03craters/moon_crater_coords.csv new file mode 100644 index 0000000..9380c29 --- /dev/null +++ b/week4/homework/craters/W_Tang_WK03craters/moon_crater_coords.csv @@ -0,0 +1,1570 @@ +lat,lon,dia +-57.58,174.77,63.98 +5.56,54.74,10.4 +-34.63,85.78,137.35 +-20.99,11.89,43.19 +20.11,27.82,1.6 +0.96,116.63,54.18 +-13.87,13.91,62.23 +-5.65,60.14,13.06 +-31.89,68.39,63.27 +87.96,-109.69,16.74 +-19.85,-31.11,51.98 +4.1,10.47,43.75 +-18.14,5.61,38.9 +-16.44,172.96,129.69 +20.01,-31.76,2.28 +-10.93,-6.17,1.44 +14.34,20.25,12.21 +-11.24,4.01,130.84 +38.3,-35,0.1 +18.07,92.62,80.41 +-23.51,111.11,111.44 +-48.63,-177.88,82.12 +1.41,22.09,2.8 +-67.94,-131.85,74.82 +40.25,13.69,94.8 +-5.42,18.97,20.52 +15.91,71.83,34.65 +-30.6,5.13,79.65 +7.02,107.01,56.25 +-16.85,15.14,47.76 +-10.45,55.77,8.57 +29.79,-53.88,2.55 +-16.05,-4.51,40.02 +-13.39,-2.85,110.54 +18.74,-107.8,64.73 +3.3,57.04,9.2 +-10.06,-172.23,52.03 +-8.52,-0.83,8.55 +-5.34,46.78,2.47 +-84.44,83.07,103.39 +73.48,-10.17,51.9 +66.97,-51.44,68.71 +72.49,-44.98,81.12 +-10.41,12.38,32.93 +-41.31,-143.3,41.33 +15.5,170.79,105.33 +-49.95,-95.46,13.42 +-22.68,146.11,16.57 +20.48,-32.34,0.87 +29.9,-41.67,9.55 +25.11,-0.05,2.12 +29.43,-25.64,1.29 +-12.92,79.72,91.42 +-69.3,-173.06,137.92 +-48.85,101.66,62.14 +1.84,49.51,10.26 +-26.96,7.87,63.44 +-35.69,-151.48,524.23 +4.51,60.96,50.66 +37.05,158.17,64.59 +6.15,21.43,25.51 +23.58,4.51,10.23 +29.72,-3.99,81.04 +58.87,4.99,31.95 +-16.55,5.8,33.72 +4.55,17.28,10.4 +23.73,-47.49,39.99 +33.88,1.21,54.37 +50.24,17.32,87.57 +-16.36,154.22,26.76 +1.35,24.94,4.21 +66.98,35.83,93.13 +-55.58,-91.45,40.93 +25.44,103.79,62.45 +10.4,-145.22,66.39 +25.03,-25.36,2.28 +27.61,-36.63,7.96 +6.2,35.17,21.89 +-18.26,-1.93,96.99 +7.25,49.9,12.37 +-55.19,25.52,40.56 +-81.1,-110.58,157.68 +32.77,-87.68,44.48 +46.74,44.38,88.12 +-5.88,57.78,28.64 +30.68,1.49,38.88 +15,17.12,19.64 +10.21,64.01,32.92 +-1.32,81.37,10.73 +39.63,-97.28,72.99 +63.21,165.36,129.84 +-22.19,12.7,47.54 +-44.75,-82.03,57.85 +-20.81,123.26,19.15 +59.56,-57.38,146.56 +4.13,94.14,95.28 +1.2,80.67,34.63 +-16.22,103.35,75.46 +-51.04,19.1,65.31 +74.61,37.35,89.44 +-66.82,-68.9,300.56 +49.78,30.56,25.68 +-18.94,152.58,11.81 +19.24,-83.31,69.19 +-53.32,-151.96,55.76 +-35.92,-8.39,40.31 +-20.27,70.22,136.3 +5.28,80.01,99.09 +28.07,-6.43,12.5 +26.58,16.43,5.15 +-23.85,157.93,65.38 +-10.67,67.22,40.9 +-29.79,85.95,115.73 +-44.98,16.81,82.72 +-28.22,-150.43,66.89 +71.28,7.59,93.82 +24.51,-89.85,54.95 +-25.28,102.56,1.57 +-51.62,-35.14,48.51 +37.11,86.58,52.61 +-18.08,28.82,50.69 +40.79,129.5,62.86 +-2.57,125.07,66.62 +27.07,-9.1,9.06 +-16.61,79.41,56.21 +-13.4,151.84,76.77 +16.23,29.18,8.3 +24.67,2.27,10.07 +61.53,90.15,215.08 +21.98,-96.53,86.33 +-60.72,-164.85,63.23 +-12.48,48.19,17.5 +-17.25,-128.23,61.9 +23.1,143.11,55.9 +4.35,141.54,13.83 +6.97,137.49,22.51 +-18.72,176.44,42.98 +25.13,-105.24,87.62 +-63.04,-163.61,93.75 +34.93,60.61,47.3 +33.5,69.99,75.24 +36.55,50.95,48.53 +14.85,-37.31,9.84 +21.73,17.92,15.56 +-63.4,-45.16,71.78 +-55.5,-165.31,70.25 +48.78,-34.37,37.59 +-54.99,51.63,77.03 +-5.83,56.34,44.55 +-13.83,-50.24,45.57 +8.02,115.05,34.99 +-22.7,51.08,13.01 +-30.17,174.01,81.64 +58.45,-145.65,329.81 +65.12,-10.7,89.92 +-22.36,-8.59,15.81 +78.35,148.46,55.27 +-38.5,113.69,48.18 +-9.2,80.39,19.46 +-37.55,-115.84,145.31 +1.22,1.46,4.97 +-63.77,-21.63,105.82 +-58.25,-93.5,37.46 +-25.32,2.44,59.9 +31.37,-147.86,51.11 +53.04,-13.78,22.85 +19.63,15.44,6.04 +26.7,-132.12,32.14 +6.71,-2.45,17.8 +5.57,72.33,11.17 +-72.9,43.26,94.59 +-16.24,40.06,31.74 +12.71,-86.52,70.07 +-20.26,-171.58,43.03 +-74.82,-90.41,72.31 +-33.85,126.12,102.22 +5.28,56.19,9.72 +-17.24,136.89,28.26 +-8.38,-17.33,59.25 +63.79,-87.29,61.34 +-25.2,46.52,45.4 +22.37,26.42,4.66 +30.53,-33.5,1.73 +-39.06,-148.25,50.72 +-6.05,66.83,15.07 +38.3,-35,0.4 +86.82,133.54,19.58 +9.71,11.01,41.53 +-53.95,-169.36,92.55 +45.75,88.68,50.2 +52.32,-35.82,22.23 +-70.21,53.73,127.61 +-24.97,103.07,43.04 +17.63,9.1,8.09 +-53.29,177.89,57.13 +17.84,23.54,8.87 +42.33,-103.44,77.21 +-73.54,-171.57,60.16 +-81.82,158.88,11.28 +20.9,-36.94,14.17 +17.25,-158.37,61.68 +-48.31,18.31,48.64 +-39.09,39.11,90.01 +23.27,34.69,9.83 +74.75,-88.36,137.26 +43.39,136.98,81.89 +26.45,-69.19,36.75 +-49.2,68.76,44.32 +25.9,-134.67,66.16 +-35.82,-124.75,119.6 +-46.53,-17.99,34.03 +1.16,0.37,6.14 +-9.86,90.91,50.66 +-38.9,17.68,51.31 +-40.64,-133.53,105.76 +-1.47,112.95,61.27 +-20.75,-22.26,60.72 +41.4,-85.46,55.22 +31.11,56.39,54.36 +45.07,28.21,41.04 +-13.92,7.25,24.09 +-38.04,19.96,53.49 +12.05,-108.81,38.77 +20.86,174.82,66.38 +85.43,10.07,97.49 +-24.73,-65.38,84.46 +34.48,-31.29,13.7 +63.26,17.31,37.54 +-61.24,-170.21,81.3 +-85.33,-42.13,100.58 +-60.41,153.5,52.85 +80.12,113.66,44.89 +12.59,31.08,8.57 +-47.67,168.7,74.65 +38.92,10.72,34.03 +6.19,45.93,10.91 +-28.04,-27.9,46.41 +45.57,152.91,222.48 +55.5,-99.73,54.51 +19.88,81.36,57.58 +38.04,118.69,75.72 +-7.65,34.92,48.13 +-34.09,-26.73,59.69 +13.27,-72.5,49.57 +33.75,-24.12,10.66 +24.91,2.28,4.67 +19.53,40.36,19.73 +52.09,-144.2,126.06 +8.48,122.37,6.25 +69.52,-51.23,59.06 +10.67,26.68,15.59 +-2.11,80.96,17.85 +43.97,62.04,27.77 +4.24,59.29,15.62 +-43.46,127.6,62.45 +-72.7,-30.75,102.85 +-51.95,113.3,56.66 +40.25,4.64,56.88 +-45.7,-87.37,26.77 +-17.98,23.55,98.77 +9.56,38.63,11.8 +5.1,-66.93,59.35 +-24.63,-53.78,52.64 +29.74,-29.38,2.8 +3.94,15.09,14.2 +-34.1,20.05,38.96 +-0.42,32.69,4.1 +40.68,45.78,39.43 +29.88,31.67,50.44 +-52.85,-101.34,29.74 +-39.06,-154.63,51.75 +79.58,9.09,53.21 +-20.44,-116.35,25.08 +-58.83,96.04,60.41 +37.39,175.03,48.97 +43.65,171.76,88.6 +18.9,112.21,42.65 +-12.69,-2.16,2.34 +-40.14,-109.46,33.6 +-5.76,150.24,123.39 +50.09,-100.47,76.83 +-61.29,-91.24,55.79 +54.53,-176.77,73.92 +29.9,-26.37,1.34 +36.22,-131.69,109.88 +3.39,-140.71,45.48 +-11.64,137.2,77.67 +-42.48,-147.49,14.25 +-34.01,-132.88,179.05 +47.01,174.41,59.31 +45.01,51.57,51.83 +20.02,29.97,3.7 +3.99,1.12,13.07 +-46.11,162.99,98.63 +-33.29,-21.18,39.18 +-47.84,13.86,76.89 +-38.67,119.35,52.11 +-36.9,-43.93,24.2 +-58.62,-14.73,230.77 +27.6,55.5,130.77 +60.32,-77.4,63.23 +21.68,29.8,6.66 +-38.09,126.65,32.66 +31.09,-162.91,92.16 +1.3,23.71,2.58 +-15.26,46.02,79.02 +55.86,104.05,164.63 +23.39,-113.17,59.25 +21.59,-122.05,73.23 +1.87,60.36,34.85 +12.1,69.58,74.85 +-0.28,-167.84,57.61 +21.66,1.95,20.96 +-17.5,48.81,45.16 +52.68,175.92,51.87 +9.62,-20.08,96.07 +-50.48,-152.91,67.22 +0.56,171.8,78.56 +-4.9,-92.58,18.56 +54.46,-115,89.72 +25.14,-30.81,1.24 +67.24,-90.86,85.12 +14.21,45.98,9.3 +-46.98,150.51,67.5 +-67.46,-147.95,93.48 +-10.4,-165.1,48.25 +-13.56,50.72,22.51 +-16.68,-66.96,45.94 +0.83,118.75,32.1 +-23.05,92.28,138.87 +14.57,56.79,2.88 +-67.08,4.4,99.29 +71.82,69.4,60.87 +-50.29,9.69,77.3 +-20.37,157.37,79.58 +-13.29,24.07,98.09 +-66.21,-6.34,47.77 +-41.65,-147.16,16.12 +9.1,44.95,37.46 +-5.83,179.4,93.61 +18.71,5.26,0.36 +-11.91,33.61,45.79 +-9.56,82.93,23.41 +51.07,164.89,233.55 +17.07,-84.45,60.69 +5.74,59.5,14.96 +-4.85,-61.25,36.66 +35.42,31.16,28.2 +-11.42,123.9,69.3 +25.36,180,53.83 +-14.61,-23.57,14.81 +2.26,14.6,29.67 +-10.31,124.59,30.36 +-19.93,-69.21,122.18 +-26.49,-137.05,35.95 +15.73,14.75,14.67 +-37.93,-174.97,92.46 +-11.85,-8.15,33.94 +17.21,26.34,17.6 +-66.99,-135.05,44.32 +-76.94,-163.33,56.26 +-25.83,-50.83,30.9 +-88.48,-88.34,32.71 +59.02,52.84,135.22 +49.38,143,54.41 +3.31,14.89,9.68 +-55.24,-98.99,43.51 +79.81,38.57,63.79 +-19.71,-60.32,22.13 +-19.68,-176.78,57.51 +29.47,51.62,31.92 +-10.68,99.68,19.77 +49.43,-176.03,127.03 +46.12,-68.18,12.04 +-1.94,17.39,51.49 +-22.26,2.62,44.63 +-10.91,-6.13,1.57 +29.98,-34.68,24.83 +-6.87,140.7,82.04 +27.16,60.2,32.16 +-15.89,121.55,42.5 +-55.02,-2.98,45.69 +2.88,7.27,26.11 +62.31,34.99,37.78 +-78.09,59.36,121.93 +-16.26,142.76,44.18 +70.25,-73.42,84.85 +-11.74,15.67,47.73 +21.13,20.59,6.01 +-32.55,-5.57,227.02 +24.35,110.91,73.33 +-2.61,165.62,46.31 +14.29,35.65,1.55 +-20.42,121.54,20 +2.77,17.29,17.25 +27.62,-34.3,17.57 +10.58,-152.05,47.24 +-12.83,129.68,38.4 +-68.97,-108.53,68.63 +-10.48,14.41,11.04 +-20.69,5.1,35.84 +7.22,38.3,1.84 +-31.35,97.99,55.05 +-28.48,-41.51,65.08 +-12.58,-159.84,101.79 +35.5,-122.72,50.95 +-46.83,31.42,30.36 +17.56,-21.75,8.28 +-40.93,-49.12,30.23 +10.24,97.09,63.84 +-38.56,-91.89,27.13 +-33.21,-156.15,54.45 +-79.57,-87.18,162.49 +4.38,69.95,48.12 +5.57,169.54,36.11 +64.12,103.11,49.65 +44.68,179.46,65.07 +-30.12,-31.71,15.12 +60.87,-121.71,63.14 +20.99,99.02,68.9 +17.28,58.38,2.62 +21.5,-72.02,120.13 +24.88,99.27,62.72 +-25.77,102.33,6.92 +48.72,10.64,34.18 +40.82,-172.27,33.58 +-22.63,-78.42,49.57 +-63.21,-142.51,56.36 +23.97,64.8,44.99 +16.6,-88.65,181.47 +-5.06,110.06,73.94 +-35.4,-29.81,21.51 +-25.44,-120.39,46.21 +54.93,-108.05,36.99 +-10.23,84.18,16.86 +9.01,-100.64,80.21 +62.76,-176.51,114.64 +4.57,-36.68,28.27 +53.61,56.48,122.1 +5.39,-159.47,43.51 +-35.61,134.43,101.8 +67.5,-4.62,54.51 +-40.92,-30.33,22.56 +14.47,-11.32,58.77 +86.99,28.62,10.94 +5.68,98.54,63.75 +21.47,42.06,15.29 +47.41,-141.83,76.79 +28.15,109.34,70.01 +-7.4,-29.56,11.8 +76.26,30.57,62.7 +44.27,16.23,70.16 +23.26,-29.18,26.03 +-9.63,-133.78,69.4 +34.57,-153.04,48.88 +35.3,-159.51,65.28 +7.69,121.46,2.6 +18.66,29.27,10.55 +-42.75,41.84,78.9 +43.07,100.68,179.44 +13.12,61.71,6.65 +-26.07,102.95,2.87 +-42.45,8.75,69.03 +-87.18,84.31,42.48 +6.23,-20.14,11.94 +-21.39,3.81,38.02 +-58.25,125.03,59.32 +28.23,-37.05,6.08 +25.09,-25.38,1.45 +-44.94,-105.06,43.31 +30.73,140.5,22.06 +-22.71,19.79,37.77 +-19.61,123.24,241.41 +-38.18,4.86,68.42 +17.9,-126.06,148.14 +-23.16,135.14,36.12 +27.37,-9.46,8.94 +86.14,37.13,21.1 +23.58,21.27,4.05 +-42.29,-177.72,72.98 +7.25,63.43,56.81 +4.2,112.7,51 +7.99,142.44,30.48 +26.67,-172.14,104.21 +-58.19,-134.11,107.08 +-3.33,-3.73,76.18 +-4.49,-44.34,19.34 +14.91,109.28,126.37 +25.45,131.85,69.03 +87.04,-19.75,69.06 +-33.7,-93.91,22.04 +-16.04,-56.79,31.47 +63.42,-18.96,37.68 +23.59,-141.49,37.02 +50.46,-39.86,25.08 +-30.31,-53.1,51.57 +42.59,-145.27,139.52 +0.47,98.14,23.97 +-6.06,-16.97,96.76 +-21.36,33.07,120.58 +22.59,35.56,11.91 +38.73,47.64,55.92 +16.57,40.24,25.48 +-39.52,59.06,57.75 +18.37,46.55,13.39 +25.79,-52.4,2.85 +25,170.89,83.16 +-12.48,-126.88,101.45 +80,-111.63,56.73 +37.41,-118.9,78.3 +-21.25,-101.65,17.62 +-36,60.54,135.03 +32.39,36.32,19.05 +36.21,-147.36,65.66 +-19.66,149.35,261.83 +21.95,4.96,9.18 +10.48,-62.83,15.99 +55.87,22.33,20.96 +-13.94,-152.99,231.97 +49.51,-84.56,76.83 +0.92,-15.24,24.68 +65.29,144.65,113.92 +-9.64,97,42.11 +-79.42,111.17,77.52 +-47.21,156.78,81.05 +17.75,33.81,17.62 +59.24,34.76,101.79 +-17.55,-39.96,111.39 +30.88,-33.96,2.02 +-10.93,37.82,33.14 +-33.91,-12.74,79.64 +36.01,79.08,170.72 +17.41,131.22,61.62 +13.88,-20.79,25.4 +-19.46,13.85,44.68 +-14.39,158.41,36.63 +-2.6,76.51,17.39 +34.42,56.66,81.98 +-34.33,13.37,88.54 +38.3,-35,0.2 +44.54,-80.51,98.78 +-22.95,-123.42,90.19 +-36.53,99.53,47.2 +-18.37,84.27,78.76 +-3.2,76.16,100.25 +-63.77,75.95,63.9 +14.25,97.4,53.23 +83.35,1.76,42.47 +35.97,102.89,22.13 +13.19,49.34,15.92 +11.32,142.67,15.24 +-1.85,137.76,38.96 +8.11,-77.67,40.1 +-10.05,45.03,73.04 +15.15,89.13,93.18 +1.82,10.16,34.25 +73.04,-3.37,115.26 +27.78,-59.96,5.58 +-25.2,-105.2,35.47 +39.75,161.24,37.86 +-32.67,14.08,44.09 +86.18,-62.31,9.41 +-19.26,-17.25,32.99 +14.21,35.89,1.49 +-3.83,-108.42,34.98 +-42.3,-88.71,36.16 +-17.04,150.23,36.95 +13.18,52.79,14.27 +3.69,133.12,68.28 +1.76,127.28,63.9 +12.5,-130.13,36.72 +-5.38,-68.36,173.49 +84.54,-75.83,12.95 +-46.92,-147.98,59.82 +-66.15,128.28,36.78 +40.3,32.98,28.55 +-67.04,-10.3,91.5 +32.89,-39.78,14.98 +-11.57,-14.19,60.75 +-19.79,117.39,19.79 +45.16,-173.38,56.75 +44.95,-129.67,45.05 +-40.34,88.91,54.55 +-8.61,41.25,70.65 +-47.76,-94.04,37.03 +11.63,117.12,98.28 +-5.37,0.23,48.15 +40.84,122.63,108.9 +83.4,-94.63,56.79 +-59.92,46.63,79.55 +-48.32,135.95,57.52 +31.22,73.55,87.49 +-39.18,-25.14,21.33 +-41.23,-33.52,70.56 +-1.66,84.11,40.26 +-74.13,91.71,84.42 +33.81,36.75,31.77 +-8.05,5.73,34.59 +-42.77,84.41,57.45 +-56.46,71.38,59.54 +14.04,72.54,41.18 +-11.53,-52.06,44.99 +5.46,143.55,14.98 +43.54,-71.66,22.57 +-58.77,-176.19,29.77 +-2.18,64.09,18 +40.87,98.74,337.14 +-38.31,79.65,63.45 +-10.88,-6.07,1.43 +52.73,-43.49,39.77 +33.2,114.4,52.77 +2.71,135.45,63.29 +-6.14,-80.47,78.46 +19.35,-146.51,59.98 +-29.37,62.68,82.08 +81.51,133.16,66.57 +29.33,-121.92,30.15 +-65.11,-88.49,163.24 +-87.45,-5.17,51.42 +12.68,-176.45,28.15 +64.56,83.87,86.21 +32.5,-111,37.98 +-10.44,166.77,164.46 +-22.06,79.68,133.67 +-81.77,85.6,74.14 +2.87,-76.57,157.38 +24.84,-15.37,6.86 +-39.48,-17.82,64.87 +32.47,-31.98,13.69 +22.63,-102.46,61.93 +40.43,-23.11,23.74 +-32.41,-7.8,33.31 +-7.56,87.67,26.72 +-68.64,65.34,110.16 +4.76,152,43.49 +-46.86,-159.97,16.63 +-23.97,-57.01,39.06 +-23.52,-59.02,41.73 +12.7,-152.33,68.74 +-49.31,6.42,85.74 +46.82,39.21,68.32 +-13.36,-33.97,14.86 +-0.87,-57.47,15.92 +86.17,-93.32,108.64 +23.25,-49.84,35.87 +0.65,119.88,28.1 +-5.69,-2.09,39.09 +13.32,104.56,82.94 +1.37,-128.66,536.37 +-29.42,-16.42,43.24 +-54.47,174.19,90.44 +2.2,-67.46,113.87 +83.09,149.15,49.99 +74.76,-144.94,46.45 +-39.55,-95.42,16.66 +-17.87,108.32,173.24 +-51.68,127.74,122 +20.91,40.81,15.86 +-7.92,7.31,28.5 +89.41,-51.89,13.35 +-24.92,-30.42,57.36 +-5.36,4.91,143.95 +70.26,-146.54,59.24 +-6.01,93.63,145.21 +15.04,136.84,44.46 +33.51,121.96,38.39 +-17.92,-94.26,16.81 +-19.19,62.53,47.6 +-27.61,151.15,37.77 +-54.74,32.93,113.6 +41.14,54.86,34.35 +-51.01,159.23,87.84 +23.8,12.51,2.85 +58.8,-40.93,24.98 +-3.99,5.85,29.65 +6.47,-28,14.16 +83.11,98.52,31.41 +-9.42,87.38,42.68 +-17.25,-123.89,76.84 +22.29,86.91,81.84 +-41.07,-1.52,65.79 +30.73,-56.66,4.34 +-27.02,80.96,199.46 +-4.68,90.47,22.3 +-40.32,-147.84,31.26 +37.22,168.68,45.17 +20.2,-4.54,3.48 +7.76,6.27,8.7 +-4.25,22.58,38.82 +25.72,-0.39,1.51 +-86.3,-75.04,11.98 +-6.95,50.44,11.51 +6.83,122.3,88.29 +14.14,91.14,59.69 +-11.69,21.71,31.08 +-5.49,-173.26,93.73 +-49.32,22.24,37.77 +-81.35,112.69,59.82 +38.3,-35,0.1 +-17.8,-97.68,12.42 +18.66,5.3,2.98 +26.16,-153.34,37.23 +-47.49,-68.95,94.6 +27.85,119.31,42.83 +-14.38,-129.16,83.95 +28.18,-34.07,1.22 +-17.57,147.49,94.1 +-7.96,33.5,41.39 +18.95,27.48,0.61 +26.86,-43.26,3.84 +-23.32,117.59,30.83 +62.31,-41.86,154.44 +22.05,-163.32,71.38 +-56.82,11.3,66.28 +13.55,28.64,24.21 +8.63,89.5,73.77 +-44.96,40.82,200.65 +-35.13,-148.21,41.22 +-55.58,91.51,81.13 +20.71,-31.86,4.46 +0.37,78.04,37.77 +-42.01,95.98,73.66 +18.53,27.63,0.63 +25.79,93.39,172.79 +24.41,2.44,7.36 +-12.68,-1.66,1.22 +27.15,-144.14,97.52 +25.01,6.56,5.12 +-34.85,147.28,145.54 +26.06,3.13,1.8 +9.17,15.21,84.72 +-36.49,6.48,53.15 +14.72,-116.29,70.03 +62.99,25.84,54.96 +-10.62,20.2,30.85 +-6.71,87.81,34.54 +-10.79,70.59,48.65 +-25.93,102.98,3.05 +72.61,166.8,91.4 +-52.06,-142.28,55.56 +8.3,122.12,12.39 +-6.9,78.94,116.07 +5.91,116.07,32.3 +25.34,-0.83,5.37 +-11.59,-112.92,27.99 +-9.78,161.78,158.07 +16.31,-138.47,94.22 +51.23,43.65,32.75 +28.63,126.72,31.67 +8.12,-38.01,29.49 +-14.13,111.87,55.88 +2.72,-147.18,91.67 +35.79,122.95,55.1 +-26.31,-22.63,45.54 +-6.41,84.11,67.79 +-56.82,118.38,27.44 +-60.75,14.94,41.87 +4.96,120.49,76.21 +-17.71,132.83,6.81 +39.27,-5.62,11.71 +-67.01,-45.48,71.2 +30.3,38.84,24.38 +68.34,-156.66,68.12 +-69.85,-26.26,121.37 +-11.99,2.53,43.47 +-32.48,-140.36,55.98 +36.93,-141.76,77.47 +5.36,80.19,13.44 +-42.13,150.33,94.7 +-84.47,-134.02,24.03 +14.24,153.95,56.25 +10.79,-115.01,78.78 +38.3,-35,0.1 +24.59,152.25,80.43 +-15.33,115.8,97.97 +-24.23,-24.68,22.86 +-28.16,-124.37,27.67 +19.56,158.34,68.08 +-17.39,-89.68,40.49 +-4.19,-157.41,423.41 +-20.19,149.61,14.63 +14.43,118.85,67.91 +38.3,-35,0.2 +-21.89,101.03,44.97 +30.86,-129.44,113.71 +-46.64,129.59,59.35 +16.56,-72.72,51.15 +-2.29,-98.89,21.05 +53.28,-127.98,61.59 +-29.93,-79.82,41.17 +3.79,-175.63,61.67 +-9.05,84.55,29.37 +29.02,-45.61,22.87 +9.41,65.69,19.17 +-26.3,5.76,46.44 +35.26,-166.11,49.83 +-53.44,104.1,65.87 +-84.48,-152.48,16.61 +-9.78,-22.68,6.28 +41.98,-154.63,60.46 +-11.57,-11.57,10.31 +3.22,-32.53,18.27 +8.1,-134.66,33.48 +38.3,141.74,110.96 +62.49,154.84,49.52 +-38.67,162.43,72.23 +-30.42,157.29,70.41 +57.13,-64.2,73.47 +43.09,47.25,42.28 +18.32,-113.78,61.75 +-43.76,76.09,78.67 +7.3,-76.14,73.02 +20.57,117.79,79.94 +58.72,138.44,78.45 +58.21,-102.22,68.64 +-36.38,-149.79,26.88 +-16.32,-17.64,48.73 +-35.32,-166.03,201.16 +-1.52,-0.45,40.87 +-42.61,169.22,82.05 +-25.77,-175.08,72.93 +-40.37,-3.96,121.02 +18.61,5.27,0.42 +18.65,27.65,0.96 +-10.98,-6.25,1.79 +10.24,121.95,108.13 +-9.47,-7.19,33.47 +-28.02,64.39,41.87 +5.48,-1.65,49.51 +-28.64,-47.8,39.84 +62.6,-94.63,60.92 +-4.2,140.69,67.5 +10.15,163.95,92.03 +-22.92,163.44,85.88 +50.09,-150.34,98.87 +25.88,-108.91,94.57 +-33.29,103.69,93.08 +-14.57,3.29,70.66 +-7.88,-15.78,47.28 +37.25,-171.16,41.12 +74.36,-70.63,108.2 +-14.06,-140.53,127.36 +-11.58,104.91,232.77 +24.91,0.5,10.08 +-16.77,133.6,55.25 +-44.76,137.35,95.28 +-28.28,142.4,143.05 +44.24,145.29,59.98 +88.63,24.4,78.75 +12.51,-106.3,40.84 +2.76,86.96,12.55 +18.26,53.35,18.86 +-46.4,67.8,61.53 +-64.57,11.34,56.45 +-24.05,106.01,48.87 +-9.99,128.8,88.74 +47.02,-175.73,62.48 +42.11,-127.95,87.41 +-25.39,60.78,184.06 +74.35,67.89,76.95 +68.07,29.39,14.67 +2.32,63.46,5.04 +45.14,108.47,32.86 +36.92,-115.28,64.07 +-61.36,88.18,55.44 +-27.52,-86.75,36.67 +-62.73,-110.83,93.47 +-26.57,75.67,104.21 +72.22,-32.88,71.44 +-52.79,-57.31,115.18 +-36.16,-68.01,102.57 +41.91,-3.24,12.96 +14.57,54.72,22.35 +-29.7,32.2,87.58 +-2.88,6.99,15.4 +-43.56,-7.49,59.95 +3.3,-100.24,9.29 +-48.37,124.25,40.96 +-60.17,-86.7,64.37 +-58.64,-73.95,88.43 +-20.34,139.93,62.14 +-29.88,-13.53,100.63 +-50.61,30.57,79.85 +-35.06,119.29,53.47 +42.25,28.22,42.97 +-57.27,135.34,319.46 +-10.22,163.26,36.8 +81.63,176.71,114.34 +51.62,-9.38,100.68 +-23.56,8.45,49.88 +15.36,23.61,41.31 +-24.62,-154.86,75.7 +24.18,79.05,69.59 +57.27,-99.23,212.36 +-42.38,111.11,40.87 +-56.86,163.99,345.99 +78.9,-146.21,65.11 +-30.34,10.56,41.4 +-22.46,25.63,40.81 +25.57,115.01,66.53 +0.74,66.91,25.51 +75.91,-54.57,67.57 +-25.43,21.55,39.7 +-28.42,14.36,55.66 +-58.78,66.07,91.4 +16.93,99.38,71.4 +-56.15,-10.18,51.46 +31.88,29.99,95.06 +17.5,-133.38,127.55 +-3.99,130.78,53.9 +-59.62,141.54,87.53 +-56.71,108.47,54.88 +25.49,-44.14,46.13 +-10.96,-6.21,1.5 +16.09,46.89,26.91 +-46.43,-5.04,47.64 +56.02,7.34,21.05 +-9.16,-1.84,153.67 +-27.82,-39.19,24.95 +23.87,-11,2.17 +-25.51,-2.03,114.97 +-1.54,94.86,50.29 +63.68,-62.98,144.55 +20.57,-20.59,18.81 +42.66,-135.3,54.77 +-34.78,23.46,82.44 +-13.5,-179.87,71.91 +14.78,-159.63,68.37 +26.96,-55.16,10.17 +-41.23,-148.08,17.23 +-40.02,145.04,61.28 +-32.96,-31.87,25.11 +-3.87,71.49,10.48 +-22.41,151.75,45.52 +-12.5,-1.97,1.62 +44.65,114.5,27.76 +29.12,89.45,113.77 +38.95,-114.63,75.08 +-2.45,0.73,51.25 +9.76,123.99,19.96 +-28.28,-1.09,126.64 +54.04,-87.88,51.31 +-30.48,47.95,64.85 +-47.69,60.42,47.62 +6.92,-54.98,29.85 +3.28,-22.86,43.28 +51.31,-78.41,108.65 +-34.15,-150.84,22.16 +2.86,71.9,17.88 +0.03,4.92,44.43 +-37.1,47.17,70.81 +-2.9,-74.42,155.66 +-37.02,26.43,71.79 +74.92,177.05,65.83 +7.7,140.09,16.8 +30.93,99.89,162.56 +-48.89,-140.05,49.14 +39.38,87.18,117.85 +-11.13,8.48,24.07 +-74.25,107.07,27.5 +1.96,19.17,29.52 +-15.37,92.38,53.77 +19.03,27.45,0.56 +70.66,-174.25,89.37 +21.84,-105.37,89.85 +59.06,-46.03,24.09 +-12.89,-72.89,84.06 +28.91,-45,4.35 +-42.37,136.54,152.67 +7.53,122.68,7.15 +25.43,36.41,43.7 +32.88,-91.42,128.42 +20.31,-32.3,0.82 +-55.49,43.15,91.65 +11.67,21.74,24.49 +-17.95,34.98,11.43 +-40.82,130.68,67.66 +-56.42,-33.84,46.85 +-30.81,27.7,41.67 +56.98,-162.48,166.12 +84.99,-157.89,181.15 +-28.81,-169.8,60.83 +-2.43,86.81,38.98 +26.51,-75.55,103.37 +28.71,-45.06,3.08 +10.56,137.09,15.98 +-61.15,-12.25,49.98 +-46.43,-96.43,48.03 +-43.87,143.3,15.55 +46.78,-103.73,77.88 +13.19,79.01,9.6 +1.38,20.07,29.75 +-23.75,16.64,97.67 +4.49,102.8,74.57 +10.44,176.7,31.42 +-1.69,103.04,103.34 +28.5,-34.29,1.86 +29.58,-16.53,1.83 +32.38,-139.21,55.09 +-20.99,44.06,62.24 +27.79,4.75,8.8 +24.75,21,7.38 +49.12,-121.14,71.33 +-39.28,-9.44,81.74 +-4.26,8.72,44.38 +-43.38,-3.88,54.56 +-27.26,109.14,86.4 +-26.33,117.71,56.74 +-9.45,-37.85,4.69 +-60.35,-27.81,110.07 +23.38,-58.82,24.2 +-44.38,-55.11,212.18 +-51.72,-39.78,179.36 +69.04,158.24,62.82 +47.12,-138.98,97.28 +-1.99,155.12,77.4 +-5.93,-83.39,87.55 +0.96,18.78,11.13 +41.34,-163.73,56.87 +-76.64,24.69,85.8 +44.76,-98,24.57 +-19.45,89.8,52.09 +-74.73,132.93,316.39 +2.74,-6.98,36.67 +2.78,81.01,51.94 +42.42,60.81,61.31 +4.44,146.42,100.08 +65.1,45.48,25.47 +70.08,121.57,211.42 +-31.36,-149.64,41.53 +77.73,14.13,54.93 +-82.35,48.52,107.82 +73.74,147.23,99.5 +2.4,43.56,22.13 +-6.97,-143.09,63.8 +-2.22,3,8.28 +46.99,127.52,17.28 +-58.96,-48.68,67.84 +-32.65,152.47,55.39 +21.09,-66.66,45.01 +26.71,79.81,47.57 +29.26,114.34,102.63 +-89.67,129.78,20.92 +7.58,122.42,15.99 +-32.89,-85.27,48.47 +9.35,56.83,24.82 +12.37,173.1,75.12 +45.75,-40.22,37.61 +24.26,140.48,24.05 +32.52,172.42,92.9 +59.24,17.04,23.67 +-11.13,118,18.8 +75.78,104.13,46.52 +-12.18,128.56,48.13 +-88.14,45.91,51.82 +-74.54,-7.68,67.94 +19.38,-116.82,74.36 +42.65,52.71,37.73 +-27.11,-92.67,14.67 +22.05,135.08,62.7 +-26.93,154.81,66.94 +-65.89,103.65,97.67 +6.21,12.53,12.56 +-72.61,14.74,68.89 +8.85,31.6,11.67 +-12.49,-60.51,44.17 +41.07,109.13,35.6 +4.61,120.7,1.59 +-18.04,96.15,125.55 +-88.08,111.29,25.12 +38.3,-35,0.1 +49.28,160.27,74.65 +-3.15,89.07,12.15 +-31.79,-151.01,32.87 +2.38,53.64,6.04 +60.22,-96.91,84.26 +-29.33,55.7,85.98 +-22.29,-168.84,41.13 +0.45,121.77,40.79 +-8.33,64.96,17.08 +64.83,-161.54,150.89 +0.19,-7.53,27.97 +-12.87,-1.63,1.9 +8.7,17.6,16.99 +57.58,-50.94,119.04 +-46.38,24.73,30.86 +13.06,165.84,88.19 +-4.3,-1.77,25.57 +27.91,-1.27,13.21 +10.07,149.98,66.74 +10.48,-13.77,68.48 +-25.43,134.59,47.72 +34.68,162.6,38.94 +64.36,-142.64,129.74 +46.33,-108.77,112.18 +7,179.11,30.72 +-48.71,46.66,63.28 +-36.73,-105.05,36.61 +19.91,29.76,0.42 +32.61,161.78,32.29 +-19.75,-142.27,109.8 +-39.58,-118.2,63.12 +-32.49,54.14,71.54 +2.15,66.98,13.77 +-34.49,31.99,43.76 +-41.24,5.93,129.87 +52.36,-88.11,53.85 +44.82,-155.5,42.43 +-55.58,-156.38,47.51 +57.14,146.65,68.62 +61.94,54.42,54.72 +-5.6,164.7,69.76 +-46.58,-10.74,58.52 +-21.74,-132.37,62.17 +23.41,-76.65,164.34 +-29.32,135.71,71.66 +4.36,-47.72,8.39 +19.63,11.68,11.61 +37.62,108.76,52.87 +10.76,-91.69,41.04 +-11,-6.3,0.95 +-81.68,65.15,15.34 +-88.32,-153.39,32.83 +51.96,112.52,42.18 +-5.46,89.67,24.85 +19.35,53.44,10.06 +82.65,-81.22,59.28 +33.71,105.78,127.22 +15.54,-29.17,33.15 +5.08,85.82,42.58 +-16.2,18.95,39.81 +16.64,19.2,6.43 +44.15,-19.49,0.48 +24.7,2.2,8.19 +-2.47,85.3,12.36 +-4.32,146.38,40.54 +-56.44,21.92,28.07 +5.5,46.54,57.32 +-5.28,16.65,36.35 +9.46,53.52,33.99 +31.96,-136.28,62.31 +3.76,11.86,43.19 +-9.58,134.66,59.95 +28.21,143.84,31.33 +38.36,124.73,41.15 +61.74,50.27,30.75 +-30.6,145.63,13.45 +37.01,6.06,24.59 +-22.01,-4.02,54.64 +13.36,82.85,8.28 +-2.41,15.79,17.61 +-0.81,15.42,18.02 +-11.45,26.28,98.59 +17.46,39.06,8.03 +40.17,-134.56,35.67 +74.86,-169.5,66.39 +-32.32,166.04,117.25 +44.1,-19.45,0.47 +24.2,161.33,86.43 +61.66,172.29,83.97 +-52.85,-133.11,38.23 +62.91,-0.55,32.81 +-5.09,-147.15,52.15 +26.72,-13.1,34.14 +6.89,176.7,53.75 +21.41,48.17,34.63 +-26.75,100.66,68.42 +28.55,150.29,29.61 +-9.52,-15.98,13.03 +-4.72,28.4,30.87 +27.96,-47.61,7.05 +3.42,63.19,17.68 +28.32,52.85,44.16 +4.18,3.6,24.97 +49.37,5.79,8.5 +29.33,167.14,76.17 +5.39,-149.69,159.95 +-48.66,142.64,65.59 +56.54,175.71,44.21 +-20.38,128.97,184.39 +17.16,145.16,28.53 +-5.62,88.21,6.78 +-1.4,-13.24,11.22 +-43.3,-11.22,85.29 +-35.2,117.64,20.94 +7.71,1.37,21.71 +32.67,-81.96,57.04 +27.93,87.43,39.29 +25.9,-47.9,8.12 +38.3,-35,0.1 +6.65,174.26,65.06 +9.36,64.35,22.92 +28.77,-45.59,9.08 +-27.04,172.01,240.47 +30.91,-159.21,43.42 +-5.26,145.95,25.18 +-43.56,119.98,113.37 +15.42,160.27,44.37 +36.03,128.18,46.42 +52.47,146.37,46.16 +-1.77,78.2,33.48 +-62.5,119.06,31.06 +61.75,-132.68,107.3 +13.78,-83.94,93.52 +43.65,93.01,44.99 +38.3,-35,0.1 +-0.87,-138.77,98.22 +-45.41,63.27,73.51 +-16.46,61.55,141.21 +-0.1,162.51,88.69 +-4.77,157.97,100.74 +26.33,-43.71,2.27 +23.11,130.43,91.97 +24.95,-25.38,1.54 +-19.3,171.12,172.76 +25.62,25.35,4.65 +-3.23,114.79,64.65 +33.87,93.68,97.81 +9.77,131.08,94.29 +-29.31,-56.53,87.16 +-5.76,144.39,45.83 +9.88,83.77,18.83 +15.64,176.74,39.65 +-30.42,-37.55,42.51 +17.66,31.28,30.94 +38.3,-35,0.2 +5.16,117.15,26.94 +-53.39,38.69,89.21 +-15.11,5.83,26.3 +-13.62,131.67,40.84 +53.9,-84.77,117.15 +56.55,131.64,55.1 +-81.8,61.87,13.46 +-7.75,71.72,37.65 +51.92,126.73,96.25 +41.04,-78.08,61.83 +-24.84,-133.01,53.89 +-44.45,176.25,186.35 +40.28,153.25,74.83 +42.19,-141.93,83.41 +27.91,-88.12,49.37 +65.41,3.52,170.53 +-25.82,-161.92,32.94 +20.26,-8.75,25.71 +4.89,32.27,5.74 +28.04,-33.81,1.26 +-33.25,0.62,134.23 +-9.96,-138.91,53.28 +-83.08,53.79,11.45 +-49.53,-60.44,84.69 +-3.98,87.35,34.51 +-25.7,128.18,74.91 +-62.59,-124.05,59.43 +-49.6,48.48,66.54 +8.84,46.31,15.55 +-0.98,60,21.41 +50.06,-123.79,43.95 +45.21,-113.81,95.78 +-1.26,77.15,31.32 +-58.39,-39.34,34.85 +-27.57,37.06,32.01 +-31.76,-19.59,66.56 +-28.03,3.29,70.59 +-68.88,90.71,52.44 +15.97,-120.53,122.82 +4.16,13.73,13.05 +89.14,120.02,14.53 +-44.8,-159.04,42.34 +-7.54,-38.13,9.77 +-6.09,85.43,52.88 +-84.03,164.7,40.82 +40.9,146.51,113.39 +9.02,75.83,12.31 +-43.21,-20.94,100.83 +-29.58,19.58,59.44 +42.02,37.31,36.36 +-20.97,-155.05,66.8 +-69.33,-42.83,66.57 +42.23,-178.81,22.85 +35.4,-105.92,63.93 +-10.76,-44.46,17.25 +-38.25,31.35,28.07 +-22.79,-16.63,25.74 +30.6,-46.98,9.64 +44.87,-159.83,44.5 +43.66,-121.83,84.15 +-31.55,-86.74,40.16 +-24,152.8,21.78 +-23.9,56.62,58.38 +-34.04,-16.06,86.77 +-1.42,98.1,103.4 +57.49,-82.01,117.57 +-22.79,122.05,25.5 +60.78,127.58,101.49 +-54.42,-78.93,35.92 +58.16,161.87,77.46 +16.96,4.69,7.87 +14.6,51.7,34.94 +24.56,10.99,0.5 +-41.54,50.98,71.44 +-60.92,5.25,68.54 +-31.94,21.89,78.92 +5.51,40.21,11.19 +2.93,124.69,39.5 +3.96,94.19,10.27 +-75.07,-135.06,186.56 +-28.74,166.86,53.95 +45.15,72.98,66.78 +18.34,168.4,50.68 +-69.07,-137.82,38 +-24.84,120.26,33.36 +7.55,-167.28,82.07 +26.64,-58.86,4.56 +44.12,-19.52,0.42 +-7.97,18.9,47.69 +59.52,-105.3,66.88 +-61.38,-50.65,63.18 +-17.18,-52.37,35.29 +-16.17,167.64,126.06 +-43.34,-147.7,15.3 +-23.68,1.08,67.22 +53.54,-28.22,37.83 +-10.67,76.28,80.4 +41.29,-107.83,57.95 +-37.93,-59.2,36.07 +-1.33,9.99,58.11 +-44.48,-22.36,88.78 +-32.6,-71.45,162.21 +-4.46,-8.65,23.54 +-14.4,-84.21,16.69 +-23.12,-70.06,114.65 +-42.67,100.94,103.55 +25.77,-20.99,30.12 +-14.76,64.56,84.28 +42.79,13.15,12.41 +5.14,23.32,83.23 +-31.17,131.51,63.04 +42.16,-119.34,218.15 +-15.34,131.81,40.05 +31.3,-14.79,6.11 +-9.5,132.36,53.76 +-9.93,119.45,104.76 +44.17,162.69,57.8 +51.17,-86.05,59.17 +-35.85,-128.89,91.5 +-8.86,61.04,131.98 +-0.31,-26.63,38.75 +31.85,-179.67,99.49 +-15.49,-7.9,21.82 +28.29,-97.05,89.17 +-27.54,96.31,51.24 +-81.8,-159.78,12.52 +38.17,-81.25,71.01 +7.35,43.3,24.02 +-74.27,-76.02,125.38 +26.66,30.5,68.4 +40.33,-20.61,20.52 +-3.19,37.46,12.48 +-44.86,-139.89,69.31 +-46.8,107.89,121.8 +7.84,-164.89,63.39 +-5.14,88.97,11.39 +-30.66,-40.76,41.17 +-29.28,-178.87,125 +-28.92,70.02,78.08 +-39.96,-56.17,53.85 +-38.24,179.35,236.67 +-61.36,-149.98,93.7 +85.19,-109.69,47.65 +2.72,-102.3,21.98 +38.3,-35,0.1 +19.07,148.36,34.04 +-33.3,-33.69,16.36 +-10.5,-42.49,117.59 +29.24,-116.41,57.03 +1.67,-109.05,50.14 +12.69,62.2,0.06 +-23.34,143.14,108.23 +-18.51,-114.23,40.32 +-35.78,-4.27,63.7 +42.11,154.84,81.05 +-47.19,6.54,75.42 +31.85,-67.72,19.53 +12.36,52.84,31.63 +-24.35,-48.3,38.96 +-54.6,6.09,61.18 +30.69,-33.38,1.11 +-5.41,52.9,13.34 +70.03,-99.22,59.37 +-32.35,24.77,53.08 +-7,13.01,32.23 +27.75,11.8,2.23 +2.73,73.57,16.12 +-25.96,-10.38,6.74 +-55.43,-114.32,160.07 +-2.15,-179.38,91.15 +-16.76,123.12,38.18 +21.5,31.39,28.52 +9.76,113.07,87.26 +-46.27,36.59,35.08 +-17.42,-146.78,56.11 +-22.69,-32.85,22.45 +-0.44,-67.38,31.25 +-13.76,60.31,43.34 +27.35,98.28,90.69 +-49.55,-21.88,145.5 +34.59,-97.19,378.42 +28.49,-34.2,0.64 +44.12,-46.04,34.81 +-6.33,129.17,90.08 +82.08,-109.51,57.06 +-36.74,-142.47,35.1 +-12.97,-103.42,62.65 +-3.99,41.79,14.09 +-17.88,-23.89,42.97 +14.34,36.78,6.85 +-8.22,-121.24,64.61 +-7.72,97.45,23.29 +-38.87,152.56,103.44 +33.2,24.15,9.29 +26.43,89.36,67.58 +13.63,40.56,31.17 +-64.96,162.47,83.25 +-50.47,84.8,150.6 +-41.21,-148.99,16.94 +18.13,-149.24,174.97 +-1.92,67.99,54.33 +10.52,20.1,20.34 +24.2,-7.85,6.88 +21.26,45.97,62.79 +-11.04,29.76,27.58 +4.9,-40.72,6.82 +-11.98,44.07,37.2 +-12.73,44.99,29.35 +-50.03,-5.98,155.58 +80.87,10.41,47.43 +41.6,-43.5,39.49 +-40.75,-168.65,83.84 +-85,11.4,72.38 +-87.22,75.94,8.28 +-45.41,54.05,58.92 +22.03,105.56,41.29 +5.7,162.39,181.89 +14.45,9.07,38.34 +4.57,19.99,15.05 +24.47,11.36,0.57 +-67.51,26.37,95.97 +19.36,34.8,39.62 +22.23,-167.57,24.47 +15.52,-2.05,28.25 +-9.48,145.2,72.88 +-39.38,76.57,56.55 +-28.46,-139.06,70.27 +11.9,-50.84,40.09 +53.43,-62.84,39.92 +-31.16,-29.35,6.54 +18.93,27.39,0.53 +2.16,30.04,22.42 +42.7,30.51,33.33 +-14.52,-93.88,53.8 +49.7,-27.28,45.49 +-41.77,13.92,115.35 +37.11,39.69,16.58 +29.76,-26.36,1.09 +29.9,98.53,109.24 +2.11,92.22,41 +-33.24,-149.77,19.11 +-15.32,50.24,23.96 +-41.28,-146.26,20.47 +30.39,-20.88,6.97 +-15.72,-170.86,50.16 +47.01,-92.83,75.29 +16.63,-166.09,88.58 +-35.93,-147.95,32.02 +22.5,-127.65,47.03 +-10.47,-148.99,58.83 +-43.63,-35.19,134.11 +13.57,-96.18,51.55 +24.3,122.94,51.16 +-10.87,113.1,87.27 +8.12,121.78,17.21 +-48.83,-109.86,139.65 +5.38,141.17,325.13 +16.26,15.93,27.13 +3.41,36.94,3.44 +-29.25,-26.11,46.32 +46.66,66.07,64.3 +74.83,-117.45,56.99 +-21.49,-49.34,84.46 +12.11,125.53,65.94 +39.31,60.06,122.4 +-1.9,47.65,13.8 +-40.42,43.37,83.81 +73.57,19.63,124.7 +71.77,-129.64,84.51 +25.05,0.21,3.46 +6.72,-121.55,123.14 +76.53,171.35,94.21 +10.01,-30.23,12.19 +-39.37,0.78,61.37 +46.76,121.52,93.97 +8.54,155.74,35.65 +-31,112.78,259.97 +24.67,-161.73,72.28 +-56.13,-145.8,107.51 +-67.54,178.57,137.31 +49.77,20.17,32.15 +17.76,-154.65,97.1 +15.63,101.13,48.96 +-18.73,-164.83,49.97 +66.27,28.8,36.83 +9.44,103.26,61.56 +4.77,137.45,22.45 +-0.59,24.16,6.15 +-19.24,47.54,36.6 +-12.54,-1.73,1.07 +-45.83,-20.76,77.05 +47.06,-160.08,83.71 +37.25,-177.55,52.66 +-70.63,-5.95,114.45 +-2.82,64.62,13.71 +4.62,127.33,41.01 +21.9,-175.29,72.77 +20.95,-90.2,88.89 +-0.7,-5.88,24.38 +78.38,-26.82,82.78 +-60.91,97.57,54.7 +-7.64,2.04,23.4 +-23.38,-140.97,44.52 +5.07,-0.21,57.83 +-63.65,29.93,76.33 +19.51,154.05,50.54 +81.17,95.38,116.9 +-4.7,57.93,32.96 +-41.04,0.14,51.99 +-50.49,-56.39,78.37 +-24.91,177.34,75.8 +19.98,-31.16,10.98 +35.38,-62.02,9.93 +-31.35,39.88,49.22 +-58.58,39.01,72.79 +-5.25,123.24,36.87 +-81.07,135.77,52.94 +68.21,25.02,51.03 +8.76,84.58,144.32 +35.57,-94.64,121.52 +-26.68,125.17,97.03 +-71.16,70.92,84.38 +29.76,43.67,39.8 +-76.52,-17.44,83.85 +-26.22,-85.21,38.08 +-42.47,25.87,40.54 +-21.95,-12.5,14.73 +31.8,-51.76,9.64 +72.2,-120.15,59.69 +33.19,134.17,35.46 +35.08,151.28,42.67 +38.3,-35,0.1 +-44.57,-170.8,62.13 +14.73,-101.39,50.87 +-85.28,53.27,79.27 +0.17,75.95,41.79 +-48.82,-45.84,32.12 +-34.9,3.79,70.61 +-11.78,-30.35,9.87 +66.35,-114.18,64.8 +-70.52,-162.2,105.39 +4.62,91.15,18.49 +32.19,167.45,60.58 diff --git a/week4/homework/craters/moon-craters.py b/week4/homework/craters/moon-craters.py index 86e6fee..774868e 100644 --- a/week4/homework/craters/moon-craters.py +++ b/week4/homework/craters/moon-craters.py @@ -14,27 +14,49 @@ parser = etree.HTMLParser() +# return coordinate def get_coords(url): res = requests.get(url) tree = etree.fromstring(res.text, parser) coords = tree.xpath('//span[@class="geo"]/text()') + return coords +# diameter +def get_dia(url): + res = requests.get(url) + + tree = etree.fromstring(res.text, parser) + + dia = tree.xpath('//tbody[1]/tr/td[3]/text()') + + return dia +# get data from the url all_coords = [] +all_dia =[] for url in urls: coords = get_coords(url) + dia=get_dia(url) all_coords += coords + all_dia += dia # ^ this is the same as all_coords.extend(coords) print('added {} coords'.format(len(coords))) print('total of {}'.format(len(all_coords))) + +i=0 with open('moon_crater_coords.csv', 'w') as f: - f.write('lat,lon\n') + # add dia + f.write('lat,lon,dia\n') for coord in all_coords: lat, lon = coord.split('; ') - f.write('{},{}\n'.format(lat, lon)) + + dia = all_dia[i] + + f.write('{},{},{}\n'.format(lat, lon,dia)) + i+=1 diff --git a/week4/homework/gui/.DS_Store b/week4/homework/gui/.DS_Store new file mode 100644 index 0000000..d75fb4f Binary files /dev/null and b/week4/homework/gui/.DS_Store differ diff --git a/week4/homework/gui/1.jpg b/week4/homework/gui/1.jpg new file mode 100644 index 0000000..b51b8a5 Binary files /dev/null and b/week4/homework/gui/1.jpg differ diff --git a/week4/homework/gui/slider/.DS_Store b/week4/homework/gui/slider/.DS_Store new file mode 100644 index 0000000..c11dfb9 Binary files /dev/null and b/week4/homework/gui/slider/.DS_Store differ diff --git a/week4/homework/gui/slider/sketch_1_1/.DS_Store b/week4/homework/gui/slider/sketch_1_1/.DS_Store new file mode 100644 index 0000000..013a799 Binary files /dev/null and b/week4/homework/gui/slider/sketch_1_1/.DS_Store differ diff --git a/week4/homework/gui/slider/sketch_1_1/data/1.jpg b/week4/homework/gui/slider/sketch_1_1/data/1.jpg new file mode 100644 index 0000000..b51b8a5 Binary files /dev/null and b/week4/homework/gui/slider/sketch_1_1/data/1.jpg differ diff --git a/week4/homework/gui/slider/sketch_1_1/sketch_1_1.pde b/week4/homework/gui/slider/sketch_1_1/sketch_1_1.pde new file mode 100644 index 0000000..0c8d8aa --- /dev/null +++ b/week4/homework/gui/slider/sketch_1_1/sketch_1_1.pde @@ -0,0 +1,20 @@ +PImage sample; +int x, y; + +void setup() { + size(1000, 600); + noStroke(); + sample=loadImage("1.jpg"); + x=0; + y=400; +} + +void draw() { + background(255); + image(sample, x, y, 50, 30); +} + +void mouseDragged() { + x=mouseX; + y=mouseY; +} diff --git a/week4/homework/gui/slider/slider/W_Tang_WK04slider.pde b/week4/homework/gui/slider/slider/W_Tang_WK04slider.pde new file mode 100644 index 0000000..89023d9 --- /dev/null +++ b/week4/homework/gui/slider/slider/W_Tang_WK04slider.pde @@ -0,0 +1,58 @@ +import controlP5.*; + +ControlP5 cp5; +int myColor = color(0, 0, 0); +int sliderValue = 100; +int sliderValue2 = 100; +int sliderValue3 = 100; +int r, g, b; +float x ; +float y ; + +float speedx = 1; +float speedy = 1; + +float dia = 25; + +void setup() { + size(700, 400); + noStroke(); + + x = width/2; + y = height/2; + cp5 = new ControlP5(this); + cp5.enableShortcuts(); + //slider(); + // to variable 'sliderValue' + + cp5.addSlider("sliderValue") + .setPosition(x, y) + .setSize(200, 20) + .setRange(0, 255) + .setValue(100); + + cp5.addSlider("sliderValue2") + .setPosition(x, y+20) + .setSize(200, 20) + .setRange(0, 200) + .setValue(120); + + cp5.addSlider("sliderValue3") + .setPosition(x, y+40) + .setSize(200, 20) + .setRange(0, 100) + .setValue(160); +} + + +void draw() { + + + background(r, g, b); + r = sliderValue; + g = sliderValue2; + b = sliderValue3; + + fill(255, 0, 120); + rect(x, y-10, 200, 10); +} diff --git a/week4/homework/gui/slider/slider/slider.pde b/week4/homework/gui/slider/slider/slider.pde new file mode 100644 index 0000000..89023d9 --- /dev/null +++ b/week4/homework/gui/slider/slider/slider.pde @@ -0,0 +1,58 @@ +import controlP5.*; + +ControlP5 cp5; +int myColor = color(0, 0, 0); +int sliderValue = 100; +int sliderValue2 = 100; +int sliderValue3 = 100; +int r, g, b; +float x ; +float y ; + +float speedx = 1; +float speedy = 1; + +float dia = 25; + +void setup() { + size(700, 400); + noStroke(); + + x = width/2; + y = height/2; + cp5 = new ControlP5(this); + cp5.enableShortcuts(); + //slider(); + // to variable 'sliderValue' + + cp5.addSlider("sliderValue") + .setPosition(x, y) + .setSize(200, 20) + .setRange(0, 255) + .setValue(100); + + cp5.addSlider("sliderValue2") + .setPosition(x, y+20) + .setSize(200, 20) + .setRange(0, 200) + .setValue(120); + + cp5.addSlider("sliderValue3") + .setPosition(x, y+40) + .setSize(200, 20) + .setRange(0, 100) + .setValue(160); +} + + +void draw() { + + + background(r, g, b); + r = sliderValue; + g = sliderValue2; + b = sliderValue3; + + fill(255, 0, 120); + rect(x, y-10, 200, 10); +}