Advertisement
Guest User

Untitled

a guest
May 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. x0 <- 1.9
  2. y0 <- -0.3
  3. r <- 0.5
  4.  
  5. f <- function(x,y)
  6. x^3-4*x*y^2-2*x^2*y-3*x*y+2*y^3+3*x
  7.  
  8. x <- seq(x0-r,x0+r,r/100)
  9. y <- seq(y0-r,y0+r,r/100)
  10. z <- outer(x,y,f)
  11.  
  12. t <- seq(0,2*pi,0.01)
  13. contour(x,y,z,asp=1,nlevels=20)
  14. lines(2*cos(t),sin(t),col="red")
  15.  
  16. locator(1)
  17. f(2,-0.25)
  18.  
  19. x0 <- -0.5
  20. y0 <- 1
  21. r <- 0.5
  22.  
  23. f <- function(x,y)
  24. x^3-4*x*y^2-2*x^2*y-3*x*y+2*y^3+3*x
  25.  
  26. x <- seq(x0-r,x0+r,r/100)
  27. y <- seq(y0-r,y0+r,r/100)
  28. z <- outer(x,y,f)
  29.  
  30. t <- seq(0,2*pi,0.01)
  31. contour(x,y,z,asp=1,nlevels=20)
  32. lines(2*cos(t),sin(t),col="red")
  33.  
  34. locator(1)
  35. f(-0.4,1)
  36.  
  37. x0 <- 1.9
  38. y0 <- -0.3
  39. r <- 0.5
  40.  
  41. f <- function(x,y)
  42. x^3-4*x*y^2-2*x^2*y-3*x*y+2*y^3+3*x
  43.  
  44. x <- seq(x0-r,x0+r,r/100)
  45. y <- seq(y0-r,y0+r,r/100)
  46. z <- outer(x,y,f)
  47.  
  48. t <- seq(0,2*pi,0.01)
  49. contour(x,y,z,asp=1,nlevels=20)
  50. lines(2*cos(t),sin(t),col="red")
  51.  
  52. locator(1)
  53. f(2,-0.25)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement