Point3d Max Min Values for Y axis

fsl88

Member
Joined
Aug 9, 2021
Messages
5
Programming Experience
Beginner
I have a Point3d array, Z values are always zero. How can I have the maximum and minimum values of Y axis for every similar X values?
Sample Point 3d Array:
List[0] = (10,5,0)
List[1] = (10,6,0)
List[2] = (10,9,0)
List[3] = (7,2,0)
List[4] = (7,5,0)
List[5] = (7,8,0)
List[6] = (7,11,0)
List[7] = (12,1,0)
List[8] = (12,3,0)

Output
maxY [0] = 9
minY [0] = 5
maxY [1] = 11
minY [1] = 2
maxY [2] = 3
minY [2] = 1

Thanks
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,541
Location
Norway
Programming Experience
10+
See the 'Min with Group By' example here: LINQ Min
Adding Max too is no hassle.
 
Top Bottom