public double distance(PointS ps) { double dx = x - ps.X; double dy = y - ps.Y; return(Math.Sqrt(dx * dx + dy * dy)); }
public int CompareTo(object ob) { PointS temp = new PointS(0, 0); if (this.distance(temp) < ((PointS)ob).distance(temp)) { return(1); } if (this.distance(temp) > ((PointS)ob).distance(temp)) { return(-1); } return(0); }
double rad; // радиус круга public CircleS(double xc, double yc, double rad) { center = new PointS(xc, yc); this.rad = rad; }