Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
gl-vec3
Advanced tools
Readme
Part of a fork of @toji's
gl-matrix split into smaller pieces: this
package contains glMatrix.vec3
.
vec3 = require('gl-vec3')
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:
var scale = require('gl-vec3').scale
var scale = require('gl-vec3/scale')
Adds two vec3's
Get the angle between two 3D vectors
Math.ceil
the components of a vec3
Creates a new vec3 initialized with values from an existing vector
Copy the values from one vec3 to another
Creates a new, empty vec3
Computes the cross product of two vec3's
Calculates the euclidian distance between two vec3's. Aliased as dist
Divides two vec3's. Aliased as div
Calculates the dot product of two vec3'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 vec3
Perform some operation over an array of vec3s.
Creates a new vec3 initialized with the given values
Returns the inverse of the components of a vec3
Calculates the length of a vec3. Aliased as len
Performs a linear interpolation between two vec3's
Returns the maximum of two vec3's
Returns the minimum of two vec3's
Multiplies two vec3's. Aliased as mul
Negates the components of a vec3
Normalize a vec3
Generates a random vector with the given scale
Rotate a 3D vector around the x-axis
Rotate a 3D vector around the y-axis
Rotate a 3D vector around the z-axis
Math.round
the components of a vec3
Scales a vec3 by a scalar number
Adds two vec3's after scaling the second operand by a scalar value
Set the components of a vec3 to the given values
Calculates the squared euclidian distance between two vec3's. Aliased as sqrDist
Calculates the squared length of a vec3. Aliased as sqrLen
Subtracts vector b from vector a. Aliased as sub
Transforms the vec3 with a mat3.
Transforms the vec3 with a mat4. 4th vector component is implicitly '1'
Transforms the vec3 with a quat
zlib. See LICENSE.md for details.
FAQs
gl-matrix's vec3, split into smaller pieces
The npm package gl-vec3 receives a total of 129,307 weekly downloads. As such, gl-vec3 popularity was classified as popular.
We found that gl-vec3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.