Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jettcalleja
Copy link
Contributor

No description provided.

it('should return 0 with points (0, 1, 4), (1, 1, 6) in order Negative Infinity.', function () {
expect(minkowskiDistance([0, 1, 4], [1, 1, 6], Number.NEGATIVE_INFINITY)).toBe(0);
});
it('should return 8.372966759705923 with points (0, 3, 4, 5), (7, 6, 3, -1) in order 3.', function () {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description doesn't match the content.

var i;

if (lx !== ly) {
throw '2 points must have same array length';
Copy link
Owner

@mgechev mgechev May 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you change it to "Both vectors should have same dimension"?

}

if (isNaN(p)) {
throw 'p must be a number';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you change to it "The order "p" must be a number"?

} else if (p === Number.NEGATIVE_INFINITY) {
return chebyshevDistance(x, y, lx, p, Math.min);
} else if (p < 1) {
throw 'p less than 1 will violate triangle inequality';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you change it to: "Order less than 1 will violate the triangle inequality"?

@jettcalleja
Copy link
Contributor Author

done with the requested changes. thanks for the review (Y)

@mgechev mgechev merged commit 75e38b2 into mgechev:master May 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants