This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Define an ellipsoid by its semi major axis (a) and flattening (f). | |
The definition of the ellipsoid is then saved in the instance object and the functions can be called with just the coordinates to be transformed. | |
''' | |
from math import * | |
class Ellipsoid: | |
def __init__(self, a, f): | |
self.a = a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void startRecording() | |
{ | |
String folder = year() +""+ month() +""+ day() +""+ hour() +""+ minute(); | |
record = true; | |
} | |
void record() | |
{ | |
if(record) saveFrame(folder +"/"+ year() +""+ month() +""+ day() +""+ hour() +""+ minute() +""+ second() +""+ millis() +".png"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ta delar ur en bild och shuffla runt dem | |
int col = 4; //even numbers | |
int row = 2; | |
int w; | |
int h; | |
PImage img; | |
PImage[] delar = new PImage[col*row]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PImage src; | |
Mover[] movers = new Mover[10000]; | |
void setup(){ | |
src = loadImage("YOUR_IMAGE.JPG"); | |
src.resize(src.width/4, src.height/4); | |
size(src.width, src.height); | |
for(int i = 0; i < movers.length; i++){ | |
movers[i] = new Mover(src, new PVector(random(width), random(height))); |
NewerOlder