mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
17 lines
273 B
JavaScript
17 lines
273 B
JavaScript
"use strict";
|
|
class Calc {
|
|
constructor(seed) {
|
|
this.v = seed;
|
|
}
|
|
add(n) {
|
|
this.v += n;
|
|
return this;
|
|
}
|
|
value() {
|
|
return this.v;
|
|
}
|
|
}
|
|
exports.Calc = Calc;
|
|
exports.magnitude = (v) => Math.sqrt(v.x * v.x + v.y * v.y);
|
|
exports.origin = { x: 0, y: 0 };
|