Character Vault
Any Concept / Any System
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Script:Vector Math"

From Roll20 Wiki

Jump to: navigation, search
m (235259 moved page Script:vectorMath to Script:Vector Math)

Revision as of 06:50, 22 January 2015

API ScriptAuthor: Stephen L
Version: 1.0
Last Modified: 2015-01-21
Code: Vector Math
Dependencies: none
Conflicts: none

This is a small library for (mostly 2D) vector mathematics. Internally, the vectors used by this library are simple arrays of numbers. The functions provided by this library do not alter the input vectors, treating each vector as an immutable object.



See code documentation in VecMath.js.

Installation and Configuration

Copy the script's code, available from the menu on the right and stored at Roll20's API GitHub Repository. Paste the code into a new script in your campaign's API Script Editor. Save the new script and it will be available inside your campaign.

Script Use

The library's exposed functions are accessed through the VecMath object, created when the script is loaded. E.G.:[1,2,3], [-4,-5,-6]) computes the dot product of [1,2,3] and [-4,-5,-6].


See GitHub commit log/wiki page history.