Tuesday, 27 July 2010

Distance between 2 Points

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 :)

9 comments:

劉隆季劉隆季 said...

Poverty is stranger to industry.........................................

陳陳昀人良喬 said...

Never put off till tomorrow what may be done today..................................................................

群育航學 said...

凡事三思而行,跑得太快是會滑倒的。..................................................

文王廷 said...

Lets cross the bridge when we come to it............................................................

黃智樺黃智樺 said...

人生有些波折,才能有些成長,所以不論順逆,凡是成長、成功的助緣,都應該心存感激。.................................................

文汝劉文汝劉文汝劉 said...

死亡是悲哀的,但活得不快樂更悲哀。. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

熙筠銘筠銘筠銘辰 said...

用心經營的blog~您的部落格文章真棒!!..................................................................

阿袁袁袁袁華 said...

在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」..................................................

fdsaf said...

只要有心,人人可以是熱門blog!!!.................................[/url]...............