Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class KwadraturaGaussa{
- double poczatek_przedzialu=0.3;
- double koniec_przedzialu=1.5;
- double[] A;
- double[] x;
- double funkcja (double x){
- return (Math.sqrt(Math.pow(x,2)+0.5))/(1.2+Math.sqrt(0.8*Math.pow(x,2)+1.1));
- }
- double LiczKwadratureGaussaLegendrea(double poczatek_przedzialu, double koniec_przedzialu, double n, double[] A, double[] x){
- double poczatek,koniec,wynik=0;
- poczatek = (koniec_przedzialu-poczatek_przedzialu)/2;
- koniec = (koniec_przedzialu+poczatek_przedzialu)/2;
- for(int i=0;i<n;i++){
- wynik+=A[i]*funkcja(poczatek*x[i]+koniec);
- }
- return wynik*=poczatek;
- }
- }
- public class KwadraturaGaussaLagendrea {
- public static void main(String[] args) {
- KwadraturaGaussa gauss = new KwadraturaGaussa();
- int n = 0;
- double[] A = new double[n];
- double[] x = new double[n];
- switch(n){
- case 2:
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement