Gathering detailed insights and metrics for gl-vec2
Gathering detailed insights and metrics for gl-vec2
Gathering detailed insights and metrics for gl-vec2
Gathering detailed insights and metrics for gl-vec2
npm install gl-vec2
Typescript
Module System
Node Version
NPM Version
99.9
Supply Chain
100
Quality
82.6
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
26,765,892
Last Day
9,919
Last Week
133,126
Last Month
551,907
Last Year
5,994,319
Zlib License
36 Stars
29 Commits
8 Forks
8 Watchers
1 Branches
17 Contributors
Updated on Jun 04, 2023
Minified
Minified + Gzipped
Latest Version
1.3.0
Package Id
gl-vec2@1.3.0
Size
6.38 kB
NPM Version
6.3.0
Node Version
8.9.1
Published on
Aug 24, 2018
Cumulative downloads
Total Downloads
Last Day
56%
9,919
Compared to previous day
Last Week
3.6%
133,126
Compared to previous week
Last Month
-2.8%
551,907
Compared to previous month
Last Year
-0.9%
5,994,319
Compared to previous year
Part of a fork of @toji's
gl-matrix split into smaller pieces: this
package contains glMatrix.vec2
.
vec2 = require('gl-vec2')
Will load all of the module's functionality and expose it on a single object. Note that any of the methods may also be required directly from their files.
For example, the following are equivalent:
1var scale = require('gl-vec2').scale 2var scale = require('gl-vec2/scale')
Adds two vec2's
Math.ceil
the components of a vec2
Creates a new vec2 initialized with values from an existing vector
Copy the values from one vec2 to another
Creates a new, empty vec2
Computes the cross product of two vec2's Note that the cross product must by definition produce a 3D vector
Calculates the euclidian distance between two vec2's. Aliased as dist
.
Divides two vec2's. Aliased as div
.
Calculates the dot product of two vec2's
Returns whether or not the vectors have approximately the same elements in the same position.
Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
Math.floor
the components of a vec2
Perform some operation over an array of vec2s.
Creates a new vec2 initialized with the given values
Returns the inverse of the components of a vec2
Calculates the length of a vec2. Aliased as len
.
Performs a linear interpolation between two vec2's
Limit the magnitude of this vector to the value used for the max
parameter
Returns the maximum of two vec2's
Returns the minimum of two vec2's
Multiplies two vec2's. Aliased as mul
.
Negates the components of a vec2
Normalize a vec2
Generates a random vector with the given scale
Math.round
the components of a vec2
Rotates a vec2 by an angle (in radians)
Scales a vec2 by a scalar number
Adds two vec2's after scaling the second operand by a scalar value
Set the components of a vec2 to the given values
Calculates the squared euclidian distance between two vec2's. Aliased as sqrDist
.
Calculates the squared length of a vec2. Aliased as sqrLen
.
Subtracts vector b from vector a. Aliased as sub
.
Transforms the vec2 with a mat2
Transforms the vec2 with a mat2d
Transforms the vec2 with a mat3 3rd vector component is implicitly '1'
Transforms the vec2 with a mat4 3rd vector component is implicitly '0' 4th vector component is implicitly '1'
zlib. See LICENSE.md for details.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 1/15 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More