1. Ana Sayfa
  2. Programlama Temelleri

C# Koordinatları Verilen İki Nokta Arasındaki Masafeyi Bulan Program

C# Koordinatları Verilen İki Nokta Arasındaki Masafeyi Bulan Program
0

Kullanıcının girmiş olduğu iki nokta arasındaki mesafeyi bulan program C# Console Uygulaması hesaplama için gereken formül= |AB|= (kare kök)(x1-_x2)İn karesi+(y1+y2)in karesi

    
   int x1 = 0, y1 = 0;
            int x2 = 0, y2 = 0;
            double mesafe = 0;
            Console.WriteLine("n 1. Nokta (X Y): ");
            x1 = Int16.Parse(Console.ReadLine());
            y1 = Int16.Parse(Console.ReadLine());
            Console.WriteLine("n 2. Nokta (X Y): ");
            x2 = Int16.Parse(Console.ReadLine());
            y2 = Int16.Parse(Console.ReadLine());
            mesafe = Math.Sqrt(Math.Pow((y2 - y1), 2) + Math.Pow((x2 - x1), 2));
            Console.WriteLine("n Mesafe : {0}", mesafe);
            Console.ReadKey();

ikinokta

Bu İçeriğe Tepkin Ne Oldu?
Subscribe
Bildir
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Yorum
Inline Feedbacks
View all comments