hughsk/vectors — pull request #1 by shama (2013-08-15 04:12:31+00:00)
Title: Add tests and 3d capabilities

I've added 3d versions of all the functions except for `heading` as I didn't know how to do it correctly. I can try and figure it out later.

Each of the methods will automatically detect whether it is 3d or 2d (or any dimension for some of them). So I've taken the liberty of moving them out of the 2d/3d folder structure. Let me know if you prefer them separate.

I normalized how `add/sub/mult/div` work as well. Each can operate on *n* arguments, the first being the returned or affected vector or take scalar values. e.g.: `div([9, 9, 9], [3, 3, 3], 2) === [1.5, 1.5, 1.5]`

I added the tests before making any changes to be sure I wasn't screwing up existing functionality.

Cheers!