예제 #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)));
        }