Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- linear3D 3d
- .default {
- <xyz *+= >xyz
- }
- .
- spherivoid 3d {
- radius
- }
- .default {
- r, theta, phi = spherical >xyz
- r += .radius
- <xyz *+= rect3d r, theta, phi
- }
- .
- elliptic
- .priv {
- v
- }
- .prep {
- .v = >v * 2 / pi
- }
- .calc {
- tmp, x2 = >y*>y + >x*>x + 1, >x * 2
- xmax = 0.5 * (sqrt (tmp + x2) + sqrt (tmp - x2))
- a = >x / xmax
- b = sqrt (1.0 - a*a)
- <x += .v * atan2 a, b
- if >y > 0 {
- <y += .v * ln (xmax + sqrt (xmax - 1))
- } else {
- <y -= .v * ln (xmax + sqrt (xmax - 1))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement