c# - Get max value in a list of points -


I have a list of digits, with the X and Y members defined as "XYPoint" type of objects with each Point. How can I get a point with maximum X or maximum Y value, lack of looping (Linux?)?

  public class XYPoint {int X; Int y; } List & lt; XYPoint & gt; LsRawPoints;  

Maximum X position:

  lsRawPoints.Max (Point = & gt; point.x)  

maximum Y position

  lsRawPoints.Max (point => point Y)  

Maximum sum of components

  lsRawPoints.Max (point = & gt; point.X + point.Y)  

Etc.


Comments