Skip to content

Commit

Permalink
1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
quinton-ashley committed Nov 12, 2023
1 parent c8ebed7 commit 64b8142
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"author": "quinton-ashley",
"name": "q5",
"version": "1.5.2",
"version": "1.5.3",
"description": "An implementation of the p5.js 2D API that's smaller and faster",
"main": "q5.js",
"scripts": {
"min": "minify q5.js > q5.min.js && cp q5.min.js ../../web/p5play-web/v3/q5.min.js",
"min": "minify q5.js > q5.min.js",
"dist": "bun min && cp q5.min.js ../../web/p5play-web/v3/q5.min.js",
"v": "npm version patch --force",
"V": "npm version minor --force",
"version": "git add -A",
Expand Down
10 changes: 4 additions & 6 deletions q5.js
Original file line number Diff line number Diff line change
Expand Up @@ -2683,11 +2683,9 @@ Q5.Vector = class {
}
angleBetween() {
let u = this._arg2v(...arguments);
const costh = this.dot(u) / (this.mag() * u.mag());
let ang;
ang = this._$.tan(Math.min(1, Math.max(-1, costh)));
ang = ang * Math.sign(this.cross(u).z || 1);
return ang;
let o = Q5.Vector.cross(this, u);
let ang = this._$.atan2(o.mag(), this.dot(u));
return ang * Math.sign(o.z || 1);
}
lerp() {
let args = [...arguments];
Expand Down Expand Up @@ -2752,7 +2750,7 @@ Q5.Vector.dot = (v, u) => v.copy().dot(u);
Q5.Vector.equals = (v, u, epsilon) => v.equals(u, epsilon);
Q5.Vector.lerp = (v, u, amt) => v.copy().lerp(u, amt);
Q5.Vector.limit = (v, m) => v.copy().limit(m);
Q5.Vector.heading = (v) => Math.atan2(v.y, v.x);
Q5.Vector.heading = (v) => this._$.atan2(v.y, v.x);
Q5.Vector.magSq = (v) => v.x * v.x + v.y * v.y + v.z * v.z;
Q5.Vector.mag = (v) => Math.sqrt(Q5.Vector.magSq(v));
Q5.Vector.mult = (v, u) => v.copy().mult(u);
Expand Down
2 changes: 1 addition & 1 deletion q5.min.js

Large diffs are not rendered by default.

0 comments on commit 64b8142

Please sign in to comment.