Skip to content

Instantly share code, notes, and snippets.

@peterthorsteinson
Created October 2, 2019 20:15
Show Gist options
  • Save peterthorsteinson/25133922e54ad7ee08d6e24670623c73 to your computer and use it in GitHub Desktop.
Save peterthorsteinson/25133922e54ad7ee08d6e24670623c73 to your computer and use it in GitHub Desktop.
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