Javascript has arrays, but it does not support vector style mathematical operations such as array addition, scalar multiplication, etc. This module includes function to handle some of these vector operations.
Copyright 2012, Lance Larsen Licensed under the MIT license
| Vector Operations | Javascript has arrays, but it does not support vector style mathematical operations such as array addition, scalar multiplication, etc. |
| Functions | |
| SxV | Scalar times Vector function |
| SpV | Scalar plus Vector function |
| VpV | Vector plus Vector function |
| linspace | linspace creates a new vector with the indicated length. |
linspace creates a new vector with the indicated length. The values are either a range of evenly spaced numbers from beginning with xmin and ending with xmax, or the results of calling a callback with each number in the range xmin to xmax.
| xmin | The minimum value for the range |
| xmax | The maximum value for the range |
| length | The length of the vector to create |
| callback | (Optional) A function of the form callback(xval) that takes values one at a time in the range xmin to xmax and return a value to include in the vector. |
the generated vector (i.e. array)