Search for this on the Internet and it gives you loads of technical details when all you want is a simple example you can use. So here it is
private static double GetlineLength(Point startPoint, Point endPoint)
{
var x = startPoint.X - endPoint.X;
var y = startPoint.Y - endPoint.Y;
return Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));
}
I hope this ends your search :)
Subscribe to:
Post Comments (Atom)
9 comments:
Poverty is stranger to industry.........................................
Never put off till tomorrow what may be done today..................................................................
凡事三思而行,跑得太快是會滑倒的。..................................................
Lets cross the bridge when we come to it............................................................
人生有些波折,才能有些成長,所以不論順逆,凡是成長、成功的助緣,都應該心存感激。.................................................
死亡是悲哀的,但活得不快樂更悲哀。. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
用心經營的blog~您的部落格文章真棒!!..................................................................
在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」..................................................
只要有心,人人可以是熱門blog!!!.................................[/url]...............
Post a Comment