Created
October 2, 2019 20:15
-
-
Save peterthorsteinson/25133922e54ad7ee08d6e24670623c73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleSinFunction | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for (int i = 0; i <= 400; i++) | |
{ | |
double theta = i * (2 * Math.PI / 100); | |
double sinTheta = Math.Sin(theta); | |
int y = (int)(50 * (1 + sinTheta)); | |
Plot(y); | |
} | |
} | |
static void Plot(int n) | |
{ | |
for (int i = 0; i < n; i++) | |
{ | |
Console.Write("*"); | |
} | |
Console.WriteLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment