Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HelloWorld
- {
- class Hello
- {
- static void Main(string[] args)
- {
- double x_start = 0; // coords of start x
- double y_start = 50; // coords of start y
- double radius = 50;
- double x_end;
- double y_end;
- double input_percent = 50;
- double angle = 360 * input_percent / 100; // angle in degrees
- double angle_rad = angle * Math.PI / 180; // angle converted to radians
- y_end = Math.Round(radius * Math.Cos(angle_rad), 2);
- x_end = Math.Round(radius * Math.Sin(angle_rad), 2);
- x_end += 50;
- y_end -= 50;
- y_end *= -1;
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement