Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
clarify intention
Browse files Browse the repository at this point in the history
  • Loading branch information
mauk81 committed Apr 6, 2015
1 parent 92454b1 commit 6f4b66b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ is found, `[decimal, 1]` is returned.
kmath.vector
------------

#### `vector.is(maybeAVector, [length])`
#### `vector.is(maybeAVector, [dimension])`

Returns true if `maybeAVector` is an array of numbers. If length is specified,
only returns true if `maybeAVector` is a vector of length `length`.
Returns true if `maybeAVector` is an array of numbers. If `dimension` is specified,
only returns true if `maybeAVector` is a vector with dimension `dimension`.

#### `vector.equal(v1, v2, [tolerance])`

Expand Down
4 changes: 2 additions & 2 deletions vector.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function arrayProduct(array) {

var kvector = {

is: function(vec, length) {
is: function(vec, dimension) {
if (!_.isArray(vec)) {
return false;
}
if (length !== undefined && vec.length !== length) {
if (dimension !== undefined && vec.length !== dimension) {
return false;
}
return _.all(vec, knumber.is);
Expand Down

0 comments on commit 6f4b66b

Please sign in to comment.