Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Zad1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = 100;
  14. double x = -5;
  15. double dx = 10 /(float)n;
  16. dx *= Math.PI;
  17. List<double> Wzor = new List<double>();
  18. List<double> Wzzor = new List<double>();
  19. List<double> Wzoor = new List<double>();
  20. List<double> Wzorr = new List<double>();
  21.  
  22. for (int i = 0; i <= 100; i++)
  23. {
  24. Wzor.Add(Wzor(x));
  25. x += dx;
  26. }
  27. for (int i = 0; i < 1000; i++)
  28. {
  29. Wzzor.Add((sin.ElementAt(i + 1) - sin.ElementAt(i)) / dx);
  30.  
  31. }
  32. for (int i = 1; i < 999; i++)
  33. {
  34. sinn.Add((cosn.ElementAt(i + 1) - cosn.ElementAt(i - 1)) / 2 * dx);
  35. blad2.Add(Math.Abs(sin.ElementAt(i) - sinn.ElementAt(i - 1)));
  36. }
  37. //Wyswietlanie wyniku
  38. for (int i = 0; i < 100; i++)
  39. {
  40. Console.WriteLine(Wzor.ElementAt(i) + " " + Wzzor.ElementAt(i) + " " + Wzoor.ElementAt(i) + " " + Wzorr.ElementAt(i));
  41. }
  42. Console.ReadKey();
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement