Character Vault
Any Concept / Any System
Compendium
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)
m (Script Use)
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
{{revdate}}
 
{{script overview
 
{{script overview
 
|name=Vector Math
 
|name=Vector Math
|author={{user profile|46544|Stephen L}}
+
|author=[[Ada Lindberg|Ada L.]]
 
|version=1.0
 
|version=1.0
 
|lastmodified=2015-01-21
 
|lastmodified=2015-01-21
Line 12: Line 13:
 
== Syntax ==
 
== Syntax ==
 
{{syntaxbox top|Example|nocat=true}}
 
{{syntaxbox top|Example|nocat=true}}
See code documentation in VecMath.js.
+
See code documentation on the {{repo|Roll20/roll20-api-scripts/tree/master/Vector%20Math README}}.
 
{{syntaxbox end}}
 
{{syntaxbox end}}
  
 
== Installation and Configuration ==
 
== Installation and Configuration ==
Copy the script's code, available from the menu on the right and stored at Roll20's [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.
+
Install from the One-Click menu, or from {{repo|https://github.com/Roll20/roll20-api-scripts/tree/master/Vector%20Math sourcecode}}.
 +
 
 +
Install manually: Copy the script's code, available from the menu on the right and stored at Roll20's [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.
  
 
== Script Use ==
 
== Script Use ==
 
The library's exposed functions are accessed through the VecMath object, created when the script is loaded.  
 
The library's exposed functions are accessed through the VecMath object, created when the script is loaded.  
E.G.: VecMath.dot([1,2,3], [-4,-5,-6]) computes the dot product of [1,2,3] and [-4,-5,-6].
+
 
 +
'''E.g:''' <code>VecMath.dot([1,2,3], [-4,-5,-6])</code> computes the dot product of <code>[1,2,3]</code> and <code>[-4,-5,-6]</code>.
 +
 
 +
See '''{{repo|Roll20/roll20-api-scripts/tree/master/Vector%20Math Readme}}''' for more details.
  
 
== Changelog ==
 
== Changelog ==
 
See GitHub commit log/wiki page history.
 
See GitHub commit log/wiki page history.
 +
 +
[[Category:API Meta Scripts]]

Latest revision as of 09:16, 23 June 2022

API ScriptAuthor: Ada 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.

Contents

[edit] Syntax

See code documentation on the README.

[edit] Installation and Configuration

Install from the One-Click menu, or from sourcecode.

Install manually: 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.

[edit] Script Use

The library's exposed functions are accessed through the VecMath object, created when the script is loaded.

E.g: VecMath.dot([1,2,3], [-4,-5,-6]) computes the dot product of [1,2,3] and [-4,-5,-6].

See Readme for more details.

[edit] Changelog

See GitHub commit log/wiki page history.