示例#1
0
文件: BalloonsDoc.cs 项目: AtanasK/VP
 public void AddBalloon(Point point)
 {
     Random r = new Random();
     Balloon balloon = new Balloon(point, r.Next(20, 30));
     Balloons.Add(balloon);
 }
示例#2
0
文件: Balloon.cs 项目: AtanasK/VP
 public bool IsTouching(Balloon ballon)
 {
     double distance = (Center.X - ballon.Center.X) * (Center.X - ballon.Center.X) + (Center.Y - ballon.Center.Y) * (Center.Y - ballon.Center.Y);
     return distance <= ((Radius + ballon.Radius) * (Radius + ballon.Radius));
 }
示例#3
0
        public bool IsTouching(Balloon ballon)
        {
            double distance = (Center.X - ballon.Center.X) * (Center.X - ballon.Center.X) + (Center.Y - ballon.Center.Y) * (Center.Y - ballon.Center.Y);

            return(distance <= ((Radius + ballon.Radius) * (Radius + ballon.Radius)));
        }