Skip to content

Commit

Permalink
Adding docs for equalPoints method
Browse files Browse the repository at this point in the history
  • Loading branch information
pgkelley4 committed Dec 5, 2014
1 parent 9e44777 commit b716f67
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion js/line-segments-intersect.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function crossProduct(point1, point2) {
* @param {Object} point1 point object with x and y coordinates
* @param {Object} point2 point object with x and y coordinates
*
* @return the subtraction result as a point object.
* @return the subtraction result as a point object
*/
function subtractPoints(point1, point2) {
var result = {};
Expand All @@ -76,6 +76,14 @@ function subtractPoints(point1, point2) {
return result;
}

/**
* See if the points are equal.
*
* @param {Object} point1 point object with x and y coordinates
* @param {Object} point2 point object with x and y coordinates
*
* @return if the points are equal
*/
function equalPoints(point1, point2) {
return (point1.x == point2.x) && (point1.y == point2.y)
}

0 comments on commit b716f67

Please sign in to comment.