C# 如何绘制三角函数曲线

来源:百度知道 编辑:UC知道 时间:2024/06/21 23:20:37

好像没有画三角函数的方法似的!
我这里有一个自己写的代码,可能参数设计的不是很好看起来不是很像,不过意思应该达到了!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SIN
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 61; i++)//绘制Y轴
{
Console.Write('-');
if (i == 60)
{
Console.WriteLine("> Y轴");
}
}
double Y;
double angle;
double radian;

char[,] SINS = new char[100, 61];
int[] huhao = new int[100];
for (int i = 0; i < 100; i++)
{
angle = i * 360 / 100;
radian = angle * Math.PI / 180;
Y = Math.Sin(radian);