Skip to content

Commit c039690

Browse files
committed
Release
1 parent 121c58a commit c039690

File tree

7 files changed

+46
-39
lines changed

7 files changed

+46
-39
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Robert Eisele
3+
Copyright (c) 2025 Robert Eisele
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Vector2.js
22

3+
[![NPM Package](https://img.shields.io/npm/v/@rawify/vector2.svg?style=flat)](https://www.npmjs.com/package/@rawify/vector2 "View this project on npm")
34
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
45

56
Vector2.js is a lightweight 2D vector library for JavaScript that provides a set of vector operations commonly used in graphics, physics simulations, and other geometric applications.
@@ -14,7 +15,13 @@ Vector2.js is a lightweight 2D vector library for JavaScript that provides a set
1415

1516
## Installation
1617

17-
To use Vector2.js, download or clone the repository:
18+
You can install `Vector2.js` via npm:
19+
20+
```bash
21+
npm install @rawify/vector2
22+
```
23+
24+
Alternatively, download or clone the repository:
1825

1926
```bash
2027
git clone https://github.com/rawify/Vector2.js
@@ -296,5 +303,5 @@ npm run test
296303

297304
## Copyright and Licensing
298305

299-
Copyright (c) 2024, [Robert Eisele](https://raw.org/)
306+
Copyright (c) 2025, [Robert Eisele](https://raw.org/)
300307
Licensed under the MIT license.

dist/vector2.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ const EPS = 1e-13;
1212
/**
1313
@constructor
1414
*/
15-
function Vector2(a, b) {
15+
function Vector2(x, y) {
1616

1717
let o = this instanceof Vector2 ? this : Object.create(Vector2.prototype);
1818

19-
if (typeof a === "object") {
20-
if (a instanceof Array) {
21-
o['x'] = a[0];
22-
o['y'] = a[1];
19+
if (typeof x === "object") {
20+
if (x instanceof Array) {
21+
o['x'] = x[0];
22+
o['y'] = x[1];
2323
} else {
24-
o['x'] = a['x'];
25-
o['y'] = a['y'];
24+
o['x'] = x['x'];
25+
o['y'] = x['y'];
2626
}
27-
} else if (!isNaN(a) && !isNaN(b)) {
28-
o['x'] = a;
29-
o['y'] = b;
27+
} else if (!isNaN(x) && !isNaN(y)) {
28+
o['x'] = x;
29+
o['y'] = y;
3030
}
3131
return o;
3232
}

dist/vector2.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vector2.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ const EPS = 1e-13;
1212
/**
1313
@constructor
1414
*/
15-
function Vector2(a, b) {
15+
function Vector2(x, y) {
1616

1717
let o = this instanceof Vector2 ? this : Object.create(Vector2.prototype);
1818

19-
if (typeof a === "object") {
20-
if (a instanceof Array) {
21-
o['x'] = a[0];
22-
o['y'] = a[1];
19+
if (typeof x === "object") {
20+
if (x instanceof Array) {
21+
o['x'] = x[0];
22+
o['y'] = x[1];
2323
} else {
24-
o['x'] = a['x'];
25-
o['y'] = a['y'];
24+
o['x'] = x['x'];
25+
o['y'] = x['y'];
2626
}
27-
} else if (!isNaN(a) && !isNaN(b)) {
28-
o['x'] = a;
29-
o['y'] = b;
27+
} else if (!isNaN(x) && !isNaN(y)) {
28+
o['x'] = x;
29+
o['y'] = y;
3030
}
3131
return o;
3232
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "vector2",
2+
"name": "@rawify/vector2",
33
"title": "Vector2",
44
"version": "0.0.1",
55
"homepage": "https://github.com/rawify/Vector2.js",
@@ -58,4 +58,4 @@
5858
"devDependencies": {
5959
"crude-build": "^0.1.2"
6060
}
61-
}
61+
}

src/vector2.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @license Vector2 v0.0.1 12/1/2024
2+
* @license Vector2 v0.0.1 3/25/2025
33
* https://github.com/rawify/Vector2.js
44
*
5-
* Copyright (c) 2024, Robert Eisele (https://raw.org/)
5+
* Copyright (c) 2025, Robert Eisele (https://raw.org/)
66
* Licensed under the MIT license.
77
**/
88

@@ -18,21 +18,21 @@ const EPS = 1e-13;
1818
/**
1919
@constructor
2020
*/
21-
function Vector2(a, b) {
21+
function Vector2(x, y) {
2222

2323
let o = this instanceof Vector2 ? this : Object.create(Vector2.prototype);
2424

25-
if (typeof a === "object") {
26-
if (a instanceof Array) {
27-
o['x'] = a[0];
28-
o['y'] = a[1];
25+
if (typeof x === "object") {
26+
if (x instanceof Array) {
27+
o['x'] = x[0];
28+
o['y'] = x[1];
2929
} else {
30-
o['x'] = a['x'];
31-
o['y'] = a['y'];
30+
o['x'] = x['x'];
31+
o['y'] = x['y'];
3232
}
33-
} else if (!isNaN(a) && !isNaN(b)) {
34-
o['x'] = a;
35-
o['y'] = b;
33+
} else if (!isNaN(x) && !isNaN(y)) {
34+
o['x'] = x;
35+
o['y'] = y;
3636
}
3737
return o;
3838
}

0 commit comments

Comments
 (0)