Min Max of Point Collection
-
How to I get the min max of X and/or Y in a point collection (or can't it be done using Linq)? I am assuming something with Lamdas but I am not well versed with them yet so I can see how it would be done. To retiterate in code:
List[Point] pointCollection = GetABunchOfPoints();
var pointWithMinXandY = ????
var pointWithMinX = ????
var pointWithMinY = ????
Thank you in advance.
ASCII stupid question, get a stupid ANSI
-
How to I get the min max of X and/or Y in a point collection (or can't it be done using Linq)? I am assuming something with Lamdas but I am not well versed with them yet so I can see how it would be done. To retiterate in code:
List[Point] pointCollection = GetABunchOfPoints();
var pointWithMinXandY = ????
var pointWithMinX = ????
var pointWithMinY = ????
Thank you in advance.
ASCII stupid question, get a stupid ANSI
-
Here is what I got for Max
private int GetMaxX()
{
int maxX = 0;
var query = (from p in pointCollection
select new
{
p
}).Max(p2 => p2.p.X);return query; }
ASCII stupid question, get a stupid ANSI
modified on Tuesday, January 26, 2010 11:10 AM