Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. class KwadraturaGaussa{
  2.  
  3. double poczatek_przedzialu=0.3;
  4. double koniec_przedzialu=1.5;
  5.  
  6. double[] A;
  7. double[] x;
  8.  
  9. double funkcja (double x){
  10. return (Math.sqrt(Math.pow(x,2)+0.5))/(1.2+Math.sqrt(0.8*Math.pow(x,2)+1.1));
  11. }
  12.  
  13. double LiczKwadratureGaussaLegendrea(double poczatek_przedzialu, double koniec_przedzialu, double n, double[] A, double[] x){
  14.  
  15. double poczatek,koniec,wynik=0;
  16. poczatek = (koniec_przedzialu-poczatek_przedzialu)/2;
  17. koniec = (koniec_przedzialu+poczatek_przedzialu)/2;
  18.  
  19. for(int i=0;i<n;i++){
  20. wynik+=A[i]*funkcja(poczatek*x[i]+koniec);
  21. }
  22. return wynik*=poczatek;
  23. }
  24.  
  25. }
  26.  
  27.  
  28. public class KwadraturaGaussaLagendrea {
  29.  
  30. public static void main(String[] args) {
  31.  
  32. KwadraturaGaussa gauss = new KwadraturaGaussa();
  33.  
  34. int n = 0;
  35.  
  36. double[] A = new double[n];
  37. double[] x = new double[n];
  38.  
  39. switch(n){
  40.  
  41. case 2:
  42.  
  43. break;
  44.  
  45. }
  46.  
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement