diff --git a/main/boofcv-geo/src/main/java/boofcv/struct/geo/PointIndex2D_F64.java b/main/boofcv-geo/src/main/java/boofcv/struct/geo/PointIndex2D_F64.java index 91f4d2d0b0..579da091d1 100644 --- a/main/boofcv-geo/src/main/java/boofcv/struct/geo/PointIndex2D_F64.java +++ b/main/boofcv-geo/src/main/java/boofcv/struct/geo/PointIndex2D_F64.java @@ -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). * @@ -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);