Gouping Angles
-
I have a custom collection of points that also contain angle info about something. I would like to group them where heavy occurances are. The angle is in 0-pi and 0-(-ve)pi format. So for example If there are many occurances around pi/2 (i.e. lets say these many occurances range +-10% of pi/2) and a different grouping is around pi/4 (i.e. lets say these occurances range -10% of pi/2 to + 10% of the 0 range). In your mind you can now picture the 8 sectors in polar coordiantes. However I would like the grouping to happen intellegently (I do not want to hard code the groupings). How do I create this GroupBy?
ASCII stupid question, get a stupid ANSI
-
I have a custom collection of points that also contain angle info about something. I would like to group them where heavy occurances are. The angle is in 0-pi and 0-(-ve)pi format. So for example If there are many occurances around pi/2 (i.e. lets say these many occurances range +-10% of pi/2) and a different grouping is around pi/4 (i.e. lets say these occurances range -10% of pi/2 to + 10% of the 0 range). In your mind you can now picture the 8 sectors in polar coordiantes. However I would like the grouping to happen intellegently (I do not want to hard code the groupings). How do I create this GroupBy?
ASCII stupid question, get a stupid ANSI
Something like this:
var groupedPoints =
from p in points
group p by p.PolarSector into g
select new { PolarSector = g.Key, Points = g };I have no idea about your underlying data(fields/properties/etc) so this is the best I could come with.
modified on Tuesday, January 26, 2010 9:37 PM