xxxxxxxxxx
52
function setup() {
createCanvas(500, 400);
{
push();
translate(width / 2, height / 2);
scale(1, -1);
background(10);
noStroke();
colorMode(HSB);
for (let t = -1000; t < 1000; t += 0.01) {
const slope = sqrt(Math.pow(yprime(t), 2) + Math.pow(xprime(t), 2));
fill(slope, 255, 255);
circle(x(t), y(t), 5);
}
for (let t = -1000; t < 1000; t += 0.01) {
const slope = sqrt(Math.pow(y2prime(t), 2) + Math.pow(x2prime(t), 2));
fill(slope, 255, 255);
circle(x2(t), y2(t), 5);
}
pop();
}
fill(255);
textSize(20);
text("Δt = .01", 10, height - 20);
}
function x(t) {
return t;
}
function xprime(t) {
return 1;
}
function y(t) {
return t;
}
function yprime(t) {
return 1;
}
function x2(t) {
return t * t * t;
}
function x2prime(t) {
return 3 * t * t;
}
function y2(t) {
return t * t * t + 100;
}
function y2prime(t) {
return 3 * t * t;
}
function draw() {}