文章已更新,最新地址:http://www.fearlazy.com/index.php/post/126.html
如图已知:a、b两点的坐标, c到a的距离d 。求c点的坐标。
求 cy 可以根据d / a到b距离 = a到c垂直距离 / a 到 b的垂直距离。
首先求a到b的距离
r = sqrt((x1- x2)*(x1 - x2) +(y1 - y2)*(y1 - y2));
cy = (d*(y2-y1))/r + y1;
同理可得
cx = (d*(x2-x1))/r + x1;
转载请注明原文地址: https://ju.6miu.com/read-50428.html