Skip to content

Commit

Permalink
Update type doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Feb 18, 2025
1 parent c9f635d commit c49af19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/image/geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ export class Geometry {
* Check if a point is in the origin list.
*
* @param {Point3D} point3D The point to check.
* @param {number} tol The comparison tolerance
* default to Number.EPSILON.
* @param {number} [tol] Optional number comparison tolerance
* defaults to Number.EPSILON.
* @returns {boolean} True if in list.
*/
includesOrigin(point3D, tol) {
Expand Down
12 changes: 6 additions & 6 deletions src/math/matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const REAL_WORLD_EPSILON = 1e-4;
*
* @param {number} a The first number.
* @param {number} b The second number.
* @param {number} tol The comparison tolerance,
* default to Number.EPSILON.
* @param {number} [tol] Optional comparison tolerance,
* defaults to Number.EPSILON.
* @returns {boolean} True if similar.
*/
export function isSimilar(a, b, tol) {
Expand Down Expand Up @@ -81,16 +81,16 @@ export class Matrix33 {
* Check for Matrix33 equality.
*
* @param {Matrix33} rhs The other matrix to compare to.
* @param {number} [p] A numeric expression for the precision to use in check
* (ex: 0.001). Defaults to Number.EPSILON if not provided.
* @param {number} [tol] Optional number comparison tolerance,
* defaults to Number.EPSILON.
* @returns {boolean} True if both matrices are equal.
*/
equals(rhs, p) {
equals(rhs, tol) {
// TODO: add type check
// check values
for (let i = 0; i < 3; ++i) {
for (let j = 0; j < 3; ++j) {
if (!isSimilar(this.get(i, j), rhs.get(i, j), p)) {
if (!isSimilar(this.get(i, j), rhs.get(i, j), tol)) {
return false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/math/point.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ export class Point3D {
* Check for Point3D similarity.
*
* @param {Point3D} rhs The other point to compare to.
* @param {number} tol Optional comparison tolerance,
* default to Number.EPSILON.
* @param {number} [tol] Optional number comparison tolerance,
* defaults to Number.EPSILON.
* @returns {boolean} True if both points are equal.
*/
isSimilar(rhs, tol) {
Expand Down

0 comments on commit c49af19

Please sign in to comment.