using System;
namespace FuzzyLogicPCL
{
///
/// Simple utility class to create, manipulate and sort 2D points
///
public class Point2D : IComparable
{
///
/// X coordinate
///
public double X { get; set; }
///
/// Y coordinate
///
public double Y { get; set; }
///
/// Constructor
///
/// x coordinate
/// y coordinate
public Point2D(double x, double y)
{
this.X = x;
this.Y = y;
}
///
/// Comparison method, for the IComparable interface. The order axis used is only the x-axis.
///
/// The other point
/// 0 if equals, negative if smaller, postive if bigger
public int CompareTo(object obj)
{
return (int)(this.X - ((Point2D) obj).X);
}
///
/// Conversion to string
///
/// Coordinates in format : (x;y)
public override String ToString()
{
return "(" + this.X + ";" + this.Y + ")";
}
}
}