Skip to content

Commit

Permalink
Add vector2d add
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaitanLyss committed Jul 29, 2024
1 parent 79f215e commit 1e26413
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@selenite/commons",
"version": "0.15.2",
"version": "0.15.3",
"scripts": {
"dev": "npm run wasm && vite dev",
"wasm": "wasm-pack build ./selenite-commons-rs --target web",
Expand Down
5 changes: 5 additions & 0 deletions src/lib/datastructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export namespace Vector2D {
y: 0,
} as Vector2D);

/** Adds two vector2D together. */
export const add = (a: Vector2D, b: Vector2D) => ({
x: a.x + b.x,
y: a.y + b.y,
} as Vector2D);
}


Expand Down

0 comments on commit 1e26413

Please sign in to comment.