123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using System;
- using System.Collections.Generic;
- using System.Runtime.CompilerServices;
- using System.Text;
- namespace Dbscan
- {
- /// <summary>
- /// A point on the 2-d plane.
- /// </summary>
- /// <param name="X">The x-coordinate of the point.</param>
- /// <param name="Y">The y-coordinate of the point.</param>
- public struct Point : IEquatable<Point>
- {
- /// <summary>The x-coordinate of the point.</summary>
- public double X { get; set; }
- /// <summary>The y-coordinate of the point.</summary>
- public double Y { get; set; }
- /// <summary>
- /// A point on the 2-d plane.
- /// </summary>
- /// <param name="X">The x-coordinate of the point.</param>
- /// <param name="Y">The y-coordinate of the point.</param>
- public Point(double X, double Y)
- {
- this.X = X;
- this.Y = Y;
- }
- [CompilerGenerated]
- public override string ToString()
- {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.Append("Point");
- stringBuilder.Append(" { ");
- if (PrintMembers(stringBuilder))
- {
- stringBuilder.Append(' ');
- }
- stringBuilder.Append('}');
- return stringBuilder.ToString();
- }
- [CompilerGenerated]
- private bool PrintMembers(StringBuilder builder)
- {
- builder.Append("X = ");
- builder.Append(X.ToString());
- builder.Append(", Y = ");
- builder.Append(Y.ToString());
- return true;
- }
- [CompilerGenerated]
- public static bool operator !=(Point left, Point right)
- {
- return !(left == right);
- }
- [CompilerGenerated]
- public static bool operator ==(Point left, Point right)
- {
- return left.Equals(right);
- }
- [CompilerGenerated]
- public override int GetHashCode()
- {
- return EqualityComparer<double>.Default.GetHashCode(X) * -1521134295 + EqualityComparer<double>.Default.GetHashCode(Y);
- }
- [CompilerGenerated]
- public override bool Equals(object obj)
- {
- if (obj is Point)
- {
- return Equals((Point)obj);
- }
- return false;
- }
- [CompilerGenerated]
- public bool Equals(Point other)
- {
- if (EqualityComparer<double>.Default.Equals(X, other.X))
- {
- return EqualityComparer<double>.Default.Equals(Y, other.Y);
- }
- return false;
- }
- [CompilerGenerated]
- public void Deconstruct(out double X, out double Y)
- {
- X = this.X;
- Y = this.Y;
- }
- }
- public class Data : IPointData
- {
- public long ID { get; set; }
- public Point Point { get; set; }
- }
- }
|