Advertisement
Guest User

Maple AM2 2FREQ

a guest
Jun 25th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Cart2esf:= proc(x,y,z)
  2. local R,theta,phi
  3. R = sqrt(x^2+y^2+z^2)
  4. if x ≠ 0 then theta = arctg(y/x)
  5. else if y = 0 then theta = 0
  6. else if y > 0 theta = pi/2
  7. else theta = pi/2
  8. end if
  9. if R = 0 then phi = 0
  10. else
  11. phi = arccos(z/R)
  12.  
  13. Cilindricas2esfericas := (x,y,z)
  14. Local x,y,z
  15. R = sqrt(x^2+y^2)
  16. if x ≠ 0 then theta = arctg(y/x)
  17. else if y = 0 then theta = 0
  18. else if y > 0 theta = pi/2
  19. else theta = pi/2
  20. end if
  21.  
  22. Esf2cart:=(r,theta,phi)
  23. local x,y,z
  24. if evalf(r>=0,0<=theta<=2pi,0<=phi<=pi)
  25. x = R*cos(theta) * sin(phi)
  26. y = R*sin(theta) * sin(phi)
  27. z = R*cos(phi)
  28. return [x,y,z]
  29. else error "Valores fora do dominio"
  30. end it
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement