geomath

AMD Geometry and Matrix modules using reuse pattern for better performance

npm install geomath
2 downloads in the last week
2 downloads in the last month

# Geomath Build Status NPM version

AMD Geometry and Matrix modules using reuse pattern for better performance

Installation

Using Bower:

$ bower install geomath --save

Using NuGet:

$ Install-Package GeoMath

Using NPM:

$ npm install geomath --save

Usage

You could use geomath in different context.

Browser (with built file)

Include built script in your HTML file.

<script type="text/javascript" src="path/to/geomath.min.js"></script>

Browser (AMD from source)

Configure RequireJS.

requirejs.config({
    paths: {
        math: 'path/to/geomath'
    }
});

Then include promise in your dependencies.

define(["math"], function() {
    math.geometry // Geometry Functions
    math.matrix
    math.matrix.M3 // Matrix 3x3 Functions
    math.matrix.M4 // Matrix 4x4 Functions
    math.matrix.V2 // Vector 2 Functions
    math.matrix.V3 // Vector 3 Functions
});

Load modules independently

define(["math"], function() {
    math.geometry // Geometry Functions
    math.matrix
    math.matrix.M3 // Matrix 3x3 Functions
    math.matrix.M4 // Matrix 4x4 Functions
    math.matrix.V2 // Vector 2 Functions
    math.matrix.V3 // Vector 3 Functions
});

Node (installed using NPM)

Call require to register Promise to global object

var math = require("geomath");
// Or
var matrix3 = require("geomath/matrix3");

Documentation

For now documentation can be found in code.

npm loves you