Advertisement
zephyrtronium

example variations

Dec 22nd, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. linear3D 3d
  2. .default {
  3. <xyz *+= >xyz
  4. }
  5. .
  6.  
  7. spherivoid 3d {
  8. radius
  9. }
  10. .default {
  11. r, theta, phi = spherical >xyz
  12. r += .radius
  13. <xyz *+= rect3d r, theta, phi
  14. }
  15. .
  16.  
  17. elliptic
  18. .priv {
  19. v
  20. }
  21. .prep {
  22. .v = >v * 2 / pi
  23. }
  24. .calc {
  25. tmp, x2 = >y*>y + >x*>x + 1, >x * 2
  26. xmax = 0.5 * (sqrt (tmp + x2) + sqrt (tmp - x2))
  27. a = >x / xmax
  28. b = sqrt (1.0 - a*a)
  29.  
  30. <x += .v * atan2 a, b
  31. if >y > 0 {
  32. <y += .v * ln (xmax + sqrt (xmax - 1))
  33. } else {
  34. <y -= .v * ln (xmax + sqrt (xmax - 1))
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement