Advertisement
SenyaSych

Untitled

Apr 1st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import math
  2.  
  3. #function_x = lambda y: -math.cos(y - 2)
  4. #function_y = lambda x: math.sin(x + 0.5) - 1
  5.  
  6. function_x = lambda x, y: math.sqrt(math.tan(x * y + 0.3))
  7. function_y = lambda x: math.sqrt(abs(1.0 - 0.90 * x**2) / 2.0)
  8.  
  9. previous_x = 0
  10. previous_y = 0
  11. eps = 0.001
  12. current_x = 1
  13. current_y = 1
  14.  
  15. while (abs(previous_x - current_x) > eps and abs(previous_y - current_y) > eps):
  16. previous_y = current_y
  17. previous_x = current_x
  18. current_x = function_x (previous_x, previous_y)
  19. #current_x = function_x (previous_y)
  20. current_y = function_y (previous_x)
  21. print ("X =", current_x, "Y =", current_y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement