Advertisement
RMarK0

Untitled

Apr 26th, 2022
813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 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.  
  12.             double input_percent = 100;
  13.             double angle = 360 * input_percent / 100;  // angle in degrees
  14.             double angle_rad = angle * Math.PI / 180; // angle converted to radians
  15.  
  16.             double x_end;
  17.             double y_end;
  18.  
  19.            
  20.                 y_end = Math.Round(radius * Math.Cos(angle_rad), 2);
  21.                 x_end = Math.Round(radius * Math.Sin(angle_rad), 2);
  22.            
  23.            
  24.  
  25.             Console.Read();
  26.  
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement