Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. f <- function(x,y)
  2. (x^2-3*x*y^2-2*y^3+x-4*y)/(x^2+x*y+y^2+1)
  3. h <- 1.e-6
  4. fx <- function(x,y)
  5. () f(x+h,y)-f(x-h,y))/(2*h)
  6. fy <- function(x,y)
  7. (f(x,y+h)-f(x,y-h))/(2*h)
  8.  
  9. fx(-2,3)
  10. fy(3,-1)
  11. v <- c(4,7)
  12. fv <- function(x,y)
  13. (f(x+h*v[1],y+h*v[2])- f(x,y))/(h*sqrt(v%*%v))
  14. fv <- c(5,-3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement