Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@math.gl/core
Advanced tools
@math.gl/core is a JavaScript library that provides a suite of mathematical utilities for 3D graphics and geospatial applications. It includes functions for vector and matrix operations, quaternion calculations, and other mathematical computations commonly used in computer graphics and geospatial applications.
Vector Operations
This feature allows you to perform vector operations such as addition, subtraction, and normalization. The code sample demonstrates how to create vectors and add them together.
const { Vector3 } = require('@math.gl/core');
const v1 = new Vector3(1, 2, 3);
const v2 = new Vector3(4, 5, 6);
const v3 = v1.add(v2);
console.log(v3); // Vector3 { x: 5, y: 7, z: 9 }
Matrix Operations
This feature provides functions for matrix operations such as multiplication, inversion, and transformation. The code sample shows how to create identity and translation matrices and multiply them.
const { Matrix4 } = require('@math.gl/core');
const m1 = new Matrix4().identity();
const m2 = new Matrix4().translate([1, 2, 3]);
const m3 = m1.multiplyRight(m2);
console.log(m3); // Matrix4 { elements: [1, 0, 0, 1, 0, 1, 0, 2, 0, 0, 1, 3, 0, 0, 0, 1] }
Quaternion Calculations
This feature allows you to perform quaternion calculations such as creating quaternions from axis rotations and multiplying quaternions. The code sample demonstrates how to create and multiply quaternions.
const { Quaternion } = require('@math.gl/core');
const q1 = new Quaternion().fromAxisRotation([0, 1, 0], Math.PI / 2);
const q2 = new Quaternion().fromAxisRotation([1, 0, 0], Math.PI / 2);
const q3 = q1.multiply(q2);
console.log(q3); // Quaternion { x: 0.5, y: 0.5, z: 0.5, w: 0.5 }
gl-matrix is a high-performance library for matrix and vector operations in WebGL. It provides similar functionalities to @math.gl/core, including vector, matrix, and quaternion operations. However, gl-matrix is more focused on performance and is widely used in WebGL applications.
three.js is a popular 3D library that includes a comprehensive set of mathematical utilities for 3D graphics, such as vectors, matrices, and quaternions. While three.js is primarily a 3D rendering library, its math utilities are comparable to those in @math.gl/core.
mathjs is a versatile mathematics library for JavaScript that supports a wide range of mathematical operations, including matrix and vector calculations. While it is not specifically designed for 3D graphics, it provides a broad set of mathematical tools that can be used in various applications.
math.gl is a suite of math modules for 3D applications.
This module contains classes for vectors and matrices etc.
For documentation please visit the website.
v3.5.0-beta.1
FAQs
Array-based 3D Math Classes optimized for WebGL applications
The npm package @math.gl/core receives a total of 274,103 weekly downloads. As such, @math.gl/core popularity was classified as popular.
We found that @math.gl/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.