示例#1
0
        public double distance(PointS ps)
        {
            double dx = x - ps.X;
            double dy = y - ps.Y;

            return(Math.Sqrt(dx * dx + dy * dy));
        }
示例#2
0
        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);
        }
示例#3
0
 double        rad;    // радиус круга
 public CircleS(double xc, double yc, double rad)
 {
     center   = new PointS(xc, yc);
     this.rad = rad;
 }