這個方式是透過海倫公式求得面積之後,在透過面積 = 底 x 高 / 2的公式取得高(最短距離) ... // 點到直線距離 class NearestDistance { public static function get (Point $A, Point $B, Point $P) { if ($A == $P) return 0; // A 和 P 位置相同 if ($B == $P) ...
94i.blogspot.com