MeshKit
1.0
|
00001 #include "meshkit/AF2RuleExistVertex.hpp" 00002 00003 AF2RuleExistVertex::AF2RuleExistVertex(double refXCoord, double refYCoord, 00004 double coeffAlpha, double coeffBravo, double coeffCharlie) 00005 { 00006 x = refXCoord; 00007 y = refYCoord; 00008 a = coeffAlpha; 00009 b = coeffBravo; 00010 c = coeffCharlie; 00011 } 00012 00013 double AF2RuleExistVertex::getX() const 00014 { 00015 return x; 00016 } 00017 00018 double AF2RuleExistVertex::getY() const 00019 { 00020 return y; 00021 } 00022 00023 bool AF2RuleExistVertex::isMatching( 00024 AF2Point2D const& matchPoint, double maxDeviation) const 00025 { 00026 double dx = matchPoint.getX() - x; 00027 double dy = matchPoint.getY() - y; 00028 double deviation = a*dx*dx + b*dx*dy + c*dy*dy; 00029 return (deviation < maxDeviation); 00030 }