Socket
Socket
Sign inDemoInstall

gl-matrix

Package Overview
Dependencies
0
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gl-matrix

Javascript Matrix and Vector library for High Performance 3D web apps


Version published
Maintainers
3
Created

Package description

What is gl-matrix?

The gl-matrix npm package is a high-performance matrix and vector operations library for WebGL and other JavaScript applications that require mathematical operations on vectors and matrices. It is optimized for performance and memory usage and provides a clean API for a variety of mathematical operations.

What are gl-matrix's main functionalities?

Matrix Operations

Perform operations on 4x4 matrices such as creation, translation, rotation, scaling, and more.

const mat4 = require('gl-matrix').mat4;
let matrix = mat4.create();
mat4.translate(matrix, matrix, [2, 3, 4]);
mat4.rotateX(matrix, matrix, Math.PI / 4);

Vector Operations

Perform operations on 3D vectors such as setting values, normalization, cross product, dot product, and more.

const vec3 = require('gl-matrix').vec3;
let vector = vec3.create();
vec3.set(vector, 1, 2, 3);
vec3.normalize(vector, vector);

Quaternion Operations

Perform operations on quaternions for representing rotations such as creating a quaternion, rotating it, inverting it, and more.

const quat = require('gl-matrix').quat;
let quaternion = quat.create();
quat.rotateX(quaternion, quaternion, Math.PI / 2);
quat.invert(quaternion, quaternion);

Other packages similar to gl-matrix

Readme

Source

Fast, flexible vector and matrix math for JavaScript

NPM Version Build Status

glMatrix is a high performance, very flexible library for vector and matrix operations in JavaScript/TypeScript, designed for the needs of realtime 3D graphics APIs like WebGL and WebGPU.

Docs

Documentation is available at https://glmatrix.net/docs/v4/

FAQs

Last updated on 17 Apr 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc