Lesson 1. The arrow of time
[h5p id=”11″]
By Raquel Basante and Pere Lopez
Lesson 2. Time and computers
Part1. Programming clocks
Result of our clock capable of giving the current hour and date in English, a different anniversary for every day of the year, a clock and a calendar and the time spent in the clock activity and the days until the next Christmas.
We also create an Erasmus clock and an international calendar
Part 2. Creating an art clock
Here you can find the art clocks
This is the p5.js code:
[p5js code canvas]
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
let clocks = new Array(10);
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(2);
smooth();
for(let i = 0; i < clocks.length; i++) {
clocks[i] = new Array(10);
for(let j = 0; j < clocks[i].length; j++) {
clocks[i][j] = new Clock();
clocks[i][j].x = j * 200;
clocks[i][j].y = i * 200;
}
}
}
function draw() {
for(let i = 0; i < clocks.length; i++) {
for(let j = 0; j < clocks[i].length; j++) {
clocks[i][j].draw()
}
}
}
class Clock {
constructor() {
this.x = 100;
this.y = 100;
this.r = 100;
this.fc = color(random(256), random(256), random(256));
this.bc = color(random(256), random(256), random(256));
this.hc = color(random(256), random(256), random(256));
this.mc = color(random(256), random(256), random(256));
this.sc = color(random(256), random(256), random(256));
}
draw() {
strokeWeight(1.5);
// translate to center
push();
translate(this.x, this.y)
rotate(radians(270));
// drawCircle
noStroke();
fill(this.bc);
ellipseMode(RADIUS);
ellipse(0, 0, this.r, this.r);
stroke(this.fc);
// draw hour numbers
let u = radians(360 / 12);
for(let h = 1; h <= 12; h++) {
push();
let x = (this.r * 0.85) * cos(h * u);
let y = (this.r * 0.85) * sin(h * u);
translate(x + 7, y);
rotate(radians(90));
fill(this.fc);
textAlign(CENTER, CENTER);
textSize(16);
textStyle(BOLD);
text(h, 0, 10);
pop();
}
strokeWeight(10);
// second needle
let ds = second() * (360 / 60);// degree
let ts = radians(ds);
let ls = this.r * 0.9; // length
stroke(this.sc);
line(0, 0, ls * cos(ts), ls * sin(ts));
// minute needle
let dm = minute() * (360 / 60);// degree
let tm = radians(dm + ds / 60);
let lm = this.r * 0.7; // length
stroke(this.mc);
line(0, 0, lm * cos(tm), lm * sin(tm));
// hour needle
let dh = hour() * (360 / 12); // degree
let th = radians(dh + dm / 12);
let lh = this.r * 0.5; // length
stroke(this.hc);
line(0, 0, lh * cos(th), lh * sin(th));
strokeWeight(4);
stroke(this.fc);
ellipse(0, 0, 8, 8);
pop();
}
}[/p5js]
Time question set
[h5p id=”12″]
Lesson 3. Time in philosophy and history
Time in Greek Mithology Video
Lesson 4. Time in physics