Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- double x1 = 0.1, x2 = 0.8, e = 0.0001;
- int n = 50, k = 10;
- double x, y, SN, SE;
- x = x1;
- for (int i = 1; i <= k; i++)
- {
- y = 0.5 - (Math.PI / 4 * Math.Abs(Math.Sin(x)));
- SN = 0;
- SE = 0;
- for (int j=1; j <= n; j++)
- {
- SN = SN + (Math.Cos(2 * j * x)) / (Math.Pow(j, 2) * 4 - 1);
- }
- n = 0;
- do
- {
- n++;
- SE = SE + (Math.Cos(2 * n * x)) / (Math.Pow(n, 2) * 4 - 1);
- } while (Math.Abs(Math.Cos(2 * n * x) / (Math.Pow(n, 2) * 4 - 1)) > e);
- Console.WriteLine("ΠΡΠΈ x={0} y={1} SN={2} SE={3}", x, y, SN, SE);
- x = x + (x2 - x1) / k;
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement