class SinCos
{
public readonly double Sin2;
public readonly double Cos2;
public SinCos(double x)
{
Sin2 = square(Math.Sin(x));
Cos2 = square(Math.Cos(x));
Math.Round(Sin2, 4);
}
private double square(double x)
{
return x * x;
}
public override string ToString()
{
return "Sin2a = " + Sin2 + " ; Cos2a = " + Cos2;
}
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Таблица значений от –pi до pi с шагом pi/4.");
Console.WriteLine("\n");
double begin = -Math.PI;
double end = Math.PI;
double step = Math.PI / 4.0;
end += step / 2.0;
for (double i = begin; i < end; i += step)
{
Console.WriteLine("i = {0:f4}", i);
Console.WriteLine(new SinCos(i));
Console.WriteLine("");
}
}
}
}