Skip to content

Commit

Permalink
PointIndex2D_F64
Browse files Browse the repository at this point in the history
- Added isIdentical()
  • Loading branch information
lessthanoptimal committed Mar 9, 2025
1 parent 0083529 commit 9e166d2
Showing 1 changed file with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Peter Abeles. All Rights Reserved.
* Copyright (c) 2025, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
Expand Down Expand Up @@ -50,6 +50,34 @@ public PointIndex2D_F64 setTo( double x, double y, int index ) {
return this;
}

public boolean isIdentical( double x, double y, int index ) {
if (this.index != index)
return false;
if (p.x != x)
return false;
if (p.y != y)
return false;
return true;
}

public boolean isIdentical( PointIndex2D_F64 o ) {
if (index != o.index)
return false;
if (p.x != o.p.x)
return false;
if (p.y != o.p.y)
return false;
return true;
}

public boolean isIdentical( PointIndex2D_F64 o, double tol ) {
if (index != o.index)
return false;
if (Math.abs(p.x - o.p.x) > tol || Math.abs(p.y - o.p.y) > tol)
return false;
return true;
}

@Override
public PointIndex2D_F64 copy() {
return new PointIndex2D_F64(p, index);
Expand Down

0 comments on commit 9e166d2

Please sign in to comment.