@@ -41,14 +41,14 @@ public function getCount():int{
4141 * @return float distance between two points
4242 */
4343 public function getDistance (FinderPattern $ b ):float {
44- return $ this -> distance ($ this ->x , $ this ->y , $ b ->x , $ b ->y );
44+ return self :: distance ($ this ->x , $ this ->y , $ b ->x , $ b ->y );
4545 }
4646
4747 /**
4848 * Get square of distance between a and b.
4949 */
5050 public function getSquaredDistance (FinderPattern $ b ):float {
51- return $ this -> squaredDistance ($ this ->x , $ this ->y , $ b ->x , $ b ->y );
51+ return self :: squaredDistance ($ this ->x , $ this ->y , $ b ->x , $ b ->y );
5252 }
5353
5454 /**
@@ -67,15 +67,15 @@ public function combineEstimate(float $i, float $j, float $newModuleSize):static
6767 );
6868 }
6969
70- private function squaredDistance (float $ aX , float $ aY , float $ bX , float $ bY ):float {
70+ private static function squaredDistance (float $ aX , float $ aY , float $ bX , float $ bY ):float {
7171 $ xDiff = ($ aX - $ bX );
7272 $ yDiff = ($ aY - $ bY );
7373
7474 return ($ xDiff * $ xDiff + $ yDiff * $ yDiff );
7575 }
7676
77- public function distance (float $ aX , float $ aY , float $ bX , float $ bY ):float {
78- return sqrt ($ this -> squaredDistance ($ aX , $ aY , $ bX , $ bY ));
77+ public static function distance (float $ aX , float $ aY , float $ bX , float $ bY ):float {
78+ return sqrt (self :: squaredDistance ($ aX , $ aY , $ bX , $ bY ));
7979 }
8080
8181}
0 commit comments