Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiaSuisse authored and MattiaSuisse committed May 23, 2020
0 parents commit d50db8a
Show file tree
Hide file tree
Showing 81 changed files with 71,218 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "getmdl-select"]
path = getmdl-select
url = https://github.com/CreativeIT/getmdl-select
21 changes: 21 additions & 0 deletions Copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Written in 2020 by Mattia Rüfenacht <[email protected]>.

Based on GPL-licensed example code by Mike Bostock.


This program is free software: you can redistribute it and/or modify

it under the terms of the GNU General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.


This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU General Public License for more details.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# OpenKDV
D3js-based data visualization of homogenized temperature data provided by MeteoSchweiz.

Inspired by [Ed Hawkins](http://www.climate-lab-book.ac.uk/spirals/) and [Robert Gieseke and Malte Meinshausen](https://github.com/openclimatedata/climate-spirals).

Based on GPL-licensed D3 example code by [Mike Bostock](https://github.com/mbostock).

70 changes: 70 additions & 0 deletions accel_vectors.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// A Mover object
Mover mover;

void setup() {
size(800,360);
mover = new Mover();
}

void draw() {
background(255);

// Update the location
mover.update();
// Display the Mover
mover.display();
}




/**
* Acceleration with Vectors
* by Daniel Shiffman.
*
* Demonstration of the basics of motion with vector.
* A "Mover" object stores location, velocity, and acceleration as vectors
* The motion is controlled by affecting the acceleration (in this case towards the mouse)
*/


class Mover {

// The Mover tracks location, velocity, and acceleration
PVector location;
PVector velocity;
PVector acceleration;
// The Mover's maximum speed
float topspeed;

Mover() {
// Start in the center
location = new PVector(width/2,height/2);
velocity = new PVector(0,0);
topspeed = 5;
}

void update() {

// Compute a vector that points from location to mouse
PVector mouse = new PVector(mouseX,mouseY);
PVector acceleration = PVector.sub(mouse,location);
// Set magnitude of acceleration
acceleration.setMag(0.2);

// Velocity changes according to acceleration
velocity.add(acceleration);
// Limit the velocity by topspeed
velocity.limit(topspeed);
// Location changes by velocity
location.add(velocity);
}

void display() {
stroke(255);
strokeWeight(10);
fill(74, 51, 162);
ellipse(location.x,location.y,48,48);
}

}
Loading

0 comments on commit d50db8a

Please sign in to comment.