-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlgebra.js
78 lines (71 loc) · 2.51 KB
/
Algebra.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Some abstract Algebra
import {WebSystemObject} from "./WebSystemObject.js";
export class SubSpace extends WebSystemObject {
static #Continuous = class extends SubSpace { // Pass throw class, implemented abstraction
constructor(metric, base = new CanonicalBase(3), elements = []) {
super();
}
}
static #DisContinuous = class extends SubSpace { // Pass throw class, implemented abstraction
constructor(metric, base = new CanonicalBase(3), elements = []) {
super();
}
}
static #Euclidean = class extends SubSpace.#Continuous { // Pass throw class, implemented abstraction
constructor(metric, base = new CanonicalBase(3), elements = []) {
super();
}
}
static #Riemann = class extends SubSpace.#DisContinuous { // Pass throw class, implemented abstraction
constructor(metric, base = new CanonicalBase(3), elements = []) {
super();
}
}
// Una superficie o parte de una hiperesfera
static Surface = class extends SubSpace.#Euclidean {
constructor() {
super();
}
}
// El contenido o parte de una hiperesfera
static Wall = class extends SubSpace.#Euclidean {
constructor() {
super();
}
}
static Rare = class extends SubSpace.#Riemann {
constructor() {
super();
}
}
// We have a lot's of work, just implement...
// I'm working in... esto representa un variedad geométrica.
static VectorialSpace = class extends SubSpace {
constructor(metric, base = new CanonicalBase(3), elements = []) {
super();
this.base = [].concat(base);
if (!metric) { // Métrica (o norma) euclidiana si no se especifica alguna otra.
this.metric = (p1, p2) => {
let result = 0;
for (let i = 0; i < Math.min(p1.dimmensions.length, p2.dimmensions.length); i++) {
result += Math.pow(p1.dimmensions[i] - p2.dimmensions[i], 2);
}
return Math.sqrt(result);
}
} else {
this.metric = metric;
}
this.elements = [].concat(elements); // Algunos elementos del espacio al que se refiere.
}
}
volume() {
}
dimmensions() {
}
area() {
}
distance() {
}
reachableFrom() {
}
}