-
Notifications
You must be signed in to change notification settings - Fork 0
/
point.js
33 lines (28 loc) · 746 Bytes
/
point.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Point {
constructor() {
this.state = createVector(1, 1, 1);
this.Xchange = this.Xchange.bind(this);
this.Ychange = this.Ychange.bind(this);
this.Zchange = this.Zchange.bind(this);
this.update = this.update.bind(this);
}
Xchange(x, y, z) {
return (segma * (y - x)) * dt;
}
Ychange(x, y, z) {
return (x * (rho - z) - y) * dt;
}
Zchange(x, y, z) {
return (x * y - beta * z) * dt;
}
update(x, y, z) {
this.state.set(
p5.Vector.add(
createVector(x, y, z),
createVector(this.Xchange(x, y, z),
this.Ychange(x, y, z),
this.Zchange(x, y, z))
)
);
}
}