Skip to content

Commit

Permalink
added Vector.create
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 24, 2015
1 parent f4f3bf7 commit b327a40
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/geometry/Vector.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ var Vector = {};

(function() {

/**
* Creates a new vector.
* @method create
* @param {number} x
* @param {number} y
* @return {vector} A new vector
*/
Vector.create = function(x, y) {
return { x: x || 0, y: y || 0 };
};

/**
* Returns a new vector with `x` and `y` copied from the given `vector`.
* @method clone
Expand Down

0 comments on commit b327a40

Please sign in to comment.