yacoordinate 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -0
- package/index.js +7 -0
- package/index.ts +7 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -37,6 +37,13 @@ class Coordinate {
|
|
|
37
37
|
coor.coordinate = coor.coordinate.slice(0, -n);
|
|
38
38
|
return coor;
|
|
39
39
|
}
|
|
40
|
+
projection() {
|
|
41
|
+
let length = this.coordinate.length - 1;
|
|
42
|
+
let notUse = this.coordinate[length];
|
|
43
|
+
let after = this.clone();
|
|
44
|
+
after.coordinate = after.coordinate.map(x => x / (notUse - +1));
|
|
45
|
+
return after;
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
exports.Coordinate = Coordinate;
|
|
42
49
|
const a = new Coordinate([0, 0, 0]);
|
package/index.ts
CHANGED
|
@@ -29,6 +29,13 @@ export class Coordinate {
|
|
|
29
29
|
coor.coordinate = coor.coordinate.slice(0, -n);
|
|
30
30
|
return coor;
|
|
31
31
|
}
|
|
32
|
+
projection(){
|
|
33
|
+
let length = this.coordinate.length - 1;
|
|
34
|
+
let notUse = this.coordinate[length];
|
|
35
|
+
let after = this.clone();
|
|
36
|
+
after.coordinate = after.coordinate.map(x =>x / (notUse -+1));
|
|
37
|
+
return after;
|
|
38
|
+
}
|
|
32
39
|
}
|
|
33
40
|
const a = new Coordinate([0, 0, 0]);
|
|
34
41
|
const b = new Coordinate([3, 4, 0]);
|