Socket
Socket
Sign inDemoInstall

@loaders.gl/math

Package Overview
Dependencies
9
Maintainers
9
Versions
302
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @loaders.gl/math

Experimental math classes for loaders.gl


Version published
Maintainers
9
Install size
3.48 MB
Created

Package description

What is @loaders.gl/math?

@loaders.gl/math is a library that provides a collection of mathematical utilities and data structures for handling 3D graphics and geospatial data. It includes functions for vector and matrix operations, geometric transformations, and other mathematical computations commonly used in computer graphics and geospatial applications.

What are @loaders.gl/math's main functionalities?

Vector Operations

This feature allows you to perform vector operations such as addition, subtraction, and normalization. The code sample demonstrates how to create two vectors and add them together.

const { Vector3 } = require('@loaders.gl/math');

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 matrix operations such as multiplication, inversion, and transformation. The code sample shows how to create an identity matrix, apply a translation, and multiply two matrices.

const { Matrix4 } = require('@loaders.gl/math');

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] }

Geometric Transformations

This feature allows you to apply geometric transformations such as rotation, scaling, and translation to points and vectors. The code sample demonstrates how to rotate a point around the X-axis.

const { Vector3, Matrix4 } = require('@loaders.gl/math');

const point = new Vector3(1, 1, 1);
const transform = new Matrix4().rotateX(Math.PI / 4);
const transformedPoint = point.transform(transform);
console.log(transformedPoint); // Vector3 { x: 1, y: 0, z: 1.4142135623730951 }

Other packages similar to @loaders.gl/math

Changelog

Source

v4.0.0-alpha.25

  • fix(gltf): tests for ext-feature-metadata (#2656)
  • fix(gltf, converter): make ext-mesh-features independent from ext-structural-metadata (#2655)
  • batch types (#2645)
  • chore(twkb): Add TWKBLoader tests (#2653)
  • feat(tile-converter): select metadata class from EXT_structural_metadata (#2647)
  • feat: new geoparquet example (#2646)
  • feat(wkt): Add TWKBLoader/Writer (#2028)
  • feat(wkb): Auto-detect WKB dialect and encoding (#2184)
  • feat(wkb): New HexWKBLoader for hex encoded WKB (#2652)
  • chore(worker-utils): Improve version handling (#2651)
  • chore: geoparquet prep (#2650)
  • feat(wkt): Add WKTCRSLoader/Writer (#2649)
  • docs(release-notes): Loaders 4.0 upcoming release notes (#2648)
  • docs: Add whats-new and upgrade-guide to arrowjs docs (#2636)
  • feat(schema): Make geojson-table compatible with GeoJSON (#2644)
  • docs(tile-converter): metadata class selection (#2642)
  • chore(tile-converter): rename (#2641)
  • chore(parquet): Add Buffer polyfill to parquet to avoid bundler complications (#2643)

Readme

Source

@loaders.gl/math (Experimental, Temporary)

loaders.gl is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains math utilities for the @loaders.gl3d-tiles module. As they mature, these will likely be moved to a math framework (e.g. math.gl).

This code is a fork of a subset of the Cesium math library whcih is Apache 2 licensed.

For documentation please visit the website.

Keywords

FAQs

Last updated on 22 Sep 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