Advertisement
orneto

spline

Jun 25th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #define comprimento 5
  5. int main(){
  6. float x[comprimento]={0,0.5,1,1.5,2};
  7. float y[comprimento]={3,1.8616,-0.5571,-4.1987,-9.0536};
  8. int i;
  9. float h[comprimento];
  10. for(i=0;i<(comprimento-1); i++){
  11. h[i]=x[i+1]-x[i];
  12. }
  13. b[comprimento];
  14. for(i=0;i<(comprimento-2); i++){
  15. b[i]=6*((y[i+2]-y[i+1])/h[i+1] -(y[i+1]-y[i])/h[i]);
  16. }
  17. float v[9]={2,0.5,0,0.5,2,0.5,0,0.5,2};
  18. float A[3][3]={{2,0.5,0},{0.5,2,0.5},{0,0.5,2};
  19. // usar programa de eliminação de gauss
  20. return 0
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement