Advertisement
RMarK0

Untitled

Apr 26th, 2022
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2. namespace HelloWorld
  3. {
  4.     class Hello
  5.     {
  6.         static void Main(string[] args)
  7.         {
  8.             double x_start = 0; // coords of start x
  9.             double y_start = 50; // coords of start y
  10.             double radius = 50;
  11.             double x_end;
  12.             double y_end;
  13.  
  14.            
  15.  
  16.             double input_percent = 50;
  17.             double angle = 360 * input_percent / 100;  // angle in degrees
  18.             double angle_rad = angle * Math.PI / 180; // angle converted to radians
  19.  
  20.            
  21.  
  22.  
  23.             y_end = Math.Round(radius * Math.Cos(angle_rad), 2);
  24.             x_end = Math.Round(radius * Math.Sin(angle_rad), 2);
  25.             x_end += 50;
  26.             y_end -= 50;
  27.             y_end *= -1;
  28.  
  29.  
  30.             Console.Read();
  31.  
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement