2026-01-09 23:43:39 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
2018-03-06 22:22:58 +01:00
|
|
|
|
{
|
2019-10-25 19:56:23 +02:00
|
|
|
|
/// <summary>
|
2022-12-01 23:49:57 +01:00
|
|
|
|
/// Replaces Windows.Foundation.Point for double floating point precision.
|
2019-10-25 19:56:23 +02:00
|
|
|
|
/// </summary>
|
2026-01-09 23:43:39 +01:00
|
|
|
|
public readonly struct Point(double x, double y) : IEquatable<Point>
|
2018-03-06 22:22:58 +01:00
|
|
|
|
{
|
2026-01-09 23:43:39 +01:00
|
|
|
|
public double X => x;
|
|
|
|
|
|
public double Y => y;
|
|
|
|
|
|
|
|
|
|
|
|
public static implicit operator Windows.Foundation.Point(Point p) => new(p.X, p.Y);
|
|
|
|
|
|
|
|
|
|
|
|
public static implicit operator Point(Windows.Foundation.Point p) => new(p.X, p.Y);
|
|
|
|
|
|
|
|
|
|
|
|
public static bool operator ==(Point p1, Point p2) => p1.Equals(p2);
|
|
|
|
|
|
|
|
|
|
|
|
public static bool operator !=(Point p1, Point p2) => !p1.Equals(p2);
|
|
|
|
|
|
|
|
|
|
|
|
public bool Equals(Point p) => X == p.X && Y == p.Y;
|
|
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj) => obj is Point p && Equals(p);
|
|
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode() => X.GetHashCode() ^ Y.GetHashCode();
|
2018-03-06 22:22:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|