// ----------------------------------------------------------------------- // // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex { using System.Globalization; /// /// Defines a point. /// public struct Point { /// /// The X position. /// private double x; /// /// The Y position. /// private double y; /// /// Initializes a new instance of the structure. /// /// The X position. /// The Y position. public Point(double x, double y) { this.x = x; this.y = y; } /// /// Gets the X position. /// public double X { get { return this.x; } } /// /// Gets the Y position. /// public double Y { get { return this.y; } } public static Point operator -(Point a, Point b) { return new Point(a.x - b.x, a.y - b.y); } /// /// Returns the string representation of the point. /// /// The string representation of the point. public override string ToString() { return string.Format(CultureInfo.InvariantCulture, "{0}, {1}", this.x, this.y); } } }