Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace calc
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double progress = Math.Sqrt(2);
  14.             double temp = progress;
  15.             double multiplier = 2;
  16.  
  17.             while (true)
  18.             {
  19.                 temp = Math.Sqrt(Math.Pow(0.5 * progress, 2) + Math.Pow(1 - Math.Sqrt(1 - Math.Pow((0.5 * progress), 2)), 2));
  20.  
  21.                 //wait for key before continuing
  22.                 multiplier = multiplier * 2;
  23.                 Console.WriteLine(temp*multiplier);
  24.                 Console.WriteLine("");
  25.                 Console.WriteLine(((temp*multiplier)/Math.PI)*100 + "%");
  26.                 Console.WriteLine("");
  27.                 Console.WriteLine(Math.PI);
  28.                 _ = Console.ReadKey();
  29.                 progress = temp;
  30.                 Console.Clear();
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement