; comment { by Ron Barnett
July 3, 2008
revised Dec 12, 2012
Ron's Website

This is my public collection. As much as possible, I will try to keep these backwards-compatible, so that all of your parameters will always render correctly in the future.

Search Menu:
1. Quaternion/Hypercomplex math
2. Misc 3D 4D Methods including mandelbulb and Msltoe 3D
3. Mobius Transformations
4. 3D Rotations
5. 3D Object classes
6. 3D Inversion classes
7. Trap shape classes
8. Image TrapMode classes
9. Image Trap ColorMode classes
10. Trap Transfer classes
11. Image Traps class
12. Color Trap classes
13. Formula object classes
14. Formula Switch Classes 15. Direct Color Arrays
16. Direct Coloring Classes
17. Gradient Coloring Classes
18. Line Art Plugins
19. Transformation classes
20. 3D Mesh Classes
21. Raytrace Classes
22. Convolution filters
23. Generator classes
24. Formula classes for embossing
} ;------------------------------------------- ; Quaternion/Hypercomplex math ;------------------------------------------- Class QH { import "common.ulb" ; Functions for Quaternion and Hypercomplex operations.
;

; For quaternions, multiplication is not commutative and division is always ; defined. ;

; For hypercomplex, multiplication is commutative and division is not always ; defined. The inverses which are not defined lieon two orthogonal ; 4D hyperplanes. ;

; The hypercomplex code is based upon the complex number methods of Clyde ; Davenport using his complex/complex model. ;

; Davenport's Website
;

; H1 = [a1,a2]
;

; where a1 and a2 are both complex numbers. This is the method used in Fractint. ; a1 and a2 are converted to two new complex numbers: ;

; fa1 = a1 - conj(flip(a2))
; fa2 = a1 + conj(flip(a2))
;

; These new complex numbers (and correspondingly fb1 and fb2) can be used for ; ordinary complex math, including multiplication, division, trancendental ; functions, powers, etc. For example, sqrt: ;

; fa1 = sqrt(fa1)
; fa2 = sqrt(fa2)
;

; A second conversion is done at the end of the operation(s): ;

; c1 = 0.5*(fa1+fa2)
; c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2)))
;

; H2 = [c1, c2]
; Operations for Spherical coordinates and 4D numbers added November 2009 ; public: ; Quaternian multiplication static func Qmul(Vector a, Vector b, Vector c) ; Q1*Q2 = [r1*r2 - V1.V2, r2*V1 + r1*V2 + V1xV2] ; calc V . V float dot = a.m_y*b.m_y + a.m_z*b.m_z + a.m_w*b.m_w ; calc V x V c.m_y = a.m_z*b.m_w - b.m_z*a.m_w c.m_z = -(a.m_y*b.m_w - b.m_y*a.m_w) c.m_w = a.m_y*b.m_z - b.m_y*a.m_z c.m_x = a.m_x*b.m_x-dot c.m_y = c.m_y + a.m_x*b.m_y + b.m_x*a.m_y c.m_z = c.m_z + a.m_x*b.m_z + b.m_x*a.m_z c.m_w = c.m_w + a.m_x*b.m_w + b.m_x*a.m_w endfunc ; Quaternian division calculated as Q2*(1/Q1) static func Qdiv(Vector a, Vector b, Vector c) ; 1/Q = [r, -V]/(r*r + V.V) ; then calculate Q2*(1/Q1) as for QMul float denom = 1/(b.m_x*b.m_x + b.m_y*b.m_y + b.m_z*b.m_z + b.m_w*b.m_w) ; calc V . V float dot = -(a.m_y*b.m_y + a.m_z*b.m_z + a.m_w*b.m_w) ; calc V x V c.m_y = -a.m_z*b.m_w + b.m_z*a.m_w c.m_z = a.m_y*b.m_w - b.m_y*a.m_w c.m_w = -a.m_y*b.m_z + b.m_y*a.m_z c.m_x = (a.m_x*b.m_x-dot)*denom c.m_y = (c.m_y - a.m_x*b.m_y + b.m_x*a.m_y)*denom c.m_z = (c.m_z - a.m_x*b.m_z + b.m_x*a.m_z)*denom c.m_w = (c.m_w - a.m_x*b.m_w + b.m_x*a.m_w)*denom endfunc ; Quaternian division calculated as 1/Q1)*Q2 static func Qdiv2(Vector a, Vector b, Vector c) ; 1/Q = [r, -V]/(r*r + V.V) ; then calculate (1/Q1)*Q2 as for QMul float denom = 1/(b.m_x*b.m_x + b.m_y*b.m_y + b.m_z*b.m_z + b.m_w*b.m_w) ; calc V . V float dot = -(a.m_y*b.m_y + a.m_z*b.m_z + a.m_w*b.m_w) ; calc V x V c.m_y = -b.m_z*a.m_w + a.m_z*b.m_w c.m_z = b.m_y*a.m_w - a.m_y*b.m_w c.m_w = -b.m_y*a.m_z + a.m_y*b.m_z c.m_x = (a.m_x*b.m_x-dot)*denom c.m_y = (c.m_y + b.m_x*a.m_y - a.m_x*b.m_y)*denom c.m_z = (c.m_z + b.m_x*a.m_z - a.m_x*b.m_z)*denom c.m_w = (c.m_w + b.m_x*a.m_w - a.m_x*b.m_w)*denom endfunc ; Quaternian square static func Qsqr(Vector a, Vector b) ; Q*Q = [r*r-V.V, 2*r*V] ; calc V . V float dot = a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w if dot == 0 dot = 1e-100 endif b.m_x = a.m_x*a.m_x-dot b.m_y = 2*a.m_x*a.m_y b.m_z = 2*a.m_x*a.m_z b.m_w = 2*a.m_x*a.m_w endfunc ; Quaternian square root static func Qsqrt(Vector a, Vector b) ; derived from the inverse of the equations for Qsqr ; PLEASE NOTE! ; There are infinitely many square roots of any negative real number, ; which are all purely imaginary and equidistant from the origin; and, ; also, that negative real numbers are the only quaternions that have ; this property. ; As a simplification for this case, the quaternion of a real negative ; number will be treated as a complex number. if a.m_x < 0 && a.m_y == 0 && a.m_z == 0 && a.m_w == 0 complex ir = a.m_x + flip(a.m_y) ir = sqrt(ir) b.init(real(ir),imag(ir),0,0) else float sdot = a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w if sdot == 0 sdot = 1e-100 endif b.m_x = sqrt((a.m_x + sqrt(a.m_x^2 + sdot))/2) float factor = 1/(2*b.m_x) b.m_y = a.m_y*factor b.m_z = a.m_z*factor b.m_w = a.m_w*factor endif endfunc ; Quaternian reciprocal or inverse static func Qrecip(Vector a, Vector b) ; 1/Q = [r, -V]/(r*r + V.V) float denom = 1/(a.m_x*a.m_x + a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) b.m_x = a.m_x*denom b.m_y = -a.m_y*denom b.m_z = -a.m_z*denom b.m_w = -a.m_w*denom endfunc ; Quaternian natural log static func Qlog(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = log(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian exponential static func Qexp(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = exp(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian power calculated as exp(ln(Q1)*Q2) static func Qpower(Vector a, Vector b, Vector c) ; Q1^Q2 = exp(ln(Q1)*Q2) ; Find the log of Q1 float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = log(z) float at = imag(z)/norm float x1 = real(z) float y1 = at*a.m_y float z1 = at*a.m_z float w1 = at*a.m_w ; Multiply log by Q2 float dot = y1*b.m_y + z1*b.m_z + w1*b.m_w ; calc V x V float y2 = z1*b.m_w - b.m_z*w1 float z2 = -(y1*b.m_w - b.m_y*w1) float w2 = y1*b.m_z - b.m_y*z1 float x2 = x1*b.m_x-dot y2 = y2 + x1*b.m_y + b.m_x*y1 z2 = z2 + x1*b.m_z + b.m_x*z1 w2 = w2 + x1*b.m_w + b.m_x*w1 ; Take the exponential norm = sqrt(y2*y2 + z2*z2 + w2*w2) if norm == 0 norm = 1e-100 endif z = x2 + flip(norm) z = exp(z) at = imag(z)/norm c.m_x = real(z) c.m_y = at*y2 c.m_z = at*z2 c.m_w = at*w2 endfunc ; Quaternian power calculated as exp(Q2*ln(Q1)) static func Qpower2(Vector a, Vector b, Vector c) ; Q1^Q2 = exp(Q2*ln(Q1)) ; Find the log of Q1 float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = log(z) float at = imag(z)/norm float x1 = real(z) float y1 = at*a.m_y float z1 = at*a.m_z float w1 = at*a.m_w ; Multiply log by Q2 float dot = y1*b.m_y + z1*b.m_z + w1*b.m_w ; calc V x V float y2 = -z1*b.m_w + b.m_z*w1 float z2 = (y1*b.m_w - b.m_y*w1) float w2 = -y1*b.m_z + b.m_y*z1 float x2 = x1*b.m_x-dot y2 = y2 + x1*b.m_y + b.m_x*y1 z2 = z2 + x1*b.m_z + b.m_x*z1 w2 = w2 + x1*b.m_w + b.m_x*w1 ; Take the exponential norm = sqrt(y2*y2 + z2*z2 + w2*w2) if norm == 0 norm = 1e-100 endif z = x2 + flip(norm) z = exp(z) at = imag(z)/norm c.m_x = real(z) c.m_y = at*y2 c.m_z = at*z2 c.m_w = at*w2 endfunc ; Quaternian sine static func Qsin(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = sin(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian arcsine static func Qasin(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = asin(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian cosine static func Qcos(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = cos(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian arccosine static func Qacos(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = acos(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian tangent static func Qtan(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = tan(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian hyperbolic tangent static func Qtanh(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = tanh(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian hyperbolic arctangent static func Qatanh(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = atanh(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian arctangent static func Qatan(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = atan(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian conjugate static func Qconj(Vector a, Vector b) ; conj(Q) = [r,-V] b.m_x = a.m_x b.m_y = -a.m_y b.m_z = -a.m_z b.m_w = -a.m_w endfunc ; Quaternian hyperbolic sine static func Qsinh(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = sinh(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian hyperbolic cosine static func Qcosh(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = cosh(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian hyperbolic arcsine static func Qasinh(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = asinh(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian hyperbolic arccosine static func Qacosh(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = acosh(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian cotangent static func Qcotan(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = cotan(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Quaternian hyperbolic cotangent static func Qcotanh(Vector a, Vector b) float norm = sqrt(a.m_y*a.m_y + a.m_z*a.m_z + a.m_w*a.m_w) if norm == 0 norm = 1e-100 endif complex z = a.m_x + flip(norm) z = cotanh(z) float at = imag(z)/norm b.m_x = real(z) b.m_y = at*a.m_y b.m_z = at*a.m_z b.m_w = at*a.m_w endfunc ; Hypercomplex multiplication static func Hmul(Vector a, Vector b, Vector c) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex b1 = b.m_x + flip(b.m_y) complex b2 = b.m_z + flip(b.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) complex fb1 = b1 - conj(flip(b2)) complex fb2 = b1 + conj(flip(b2)) fa1 = fa1*fb1 fa2 = fa2*fb2 c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) c.m_x = real(c1) c.m_y = imag(c1) c.m_z = real(c2) c.m_w = imag(c2) endfunc ; Hypercomplex division static func Hdiv(Vector a, Vector b, Vector c) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex b1 = b.m_x + flip(b.m_y) complex b2 = b.m_z + flip(b.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) complex fb1 = b1 - conj(flip(b2)) complex fb2 = b1 + conj(flip(b2)) fa1 = fa1/fb1 fa2 = fa2/fb2 c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) c.m_x = real(c1) c.m_y = imag(c1) c.m_z = real(c2) c.m_w = imag(c2) endfunc ; Hypercomplex square static func Hsqr(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = fa1*fa1 fa2 = fa2*fa2 c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex square root static func Hsqrt(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = sqrt(fa1) fa2 = sqrt(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex reciprocal or inverse static func Hrecip(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = 1/fa1 fa2 = 1/fa2 c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex natural log static func Hlog(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = log(fa1) fa2 = log(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex exponential static func Hexp(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = exp(fa1) fa2 = exp(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex power static func Hpower(Vector a, Vector b, Vector c) ; Q1^Q2 = exp(ln(Q1)*Q2) ; ; Find the log of Q1 complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex b1 = b.m_x + flip(b.m_y) complex b2 = b.m_z + flip(b.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) complex fb1 = b1 - conj(flip(b2)) complex fb2 = b1 + conj(flip(b2)) fa1 = log(fa1) fa2 = log(fa2) ; ; Multiply log by Q2 fa1 = fa1*fb1 fa2 = fa2*fb2 ; ; Take exponential fa1 = exp(fa1) fa2 = exp(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) c.m_x = real(c1) c.m_y = imag(c1) c.m_z = real(c2) c.m_w = imag(c2) endfunc static func Hsin(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = sin(fa1) fa2 = sin(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex cosine static func Hcos(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = cos(fa1) fa2 = cos(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex hyperbolic sine static func Hsinh(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = sinh(fa1) fa2 = sinh(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex hyperbolic cosine static func Hcosh(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = cosh(fa1) fa2 = cosh(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex conjugate static func Hconj(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = conj(fa1) fa2 = conj(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex tangent static func Htan(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = tan(fa1) fa2 = tan(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex arcsine static func Hasin(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = asin(fa1) fa2 = asin(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex arccosine static func Hacos(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = acos(fa1) fa2 = acos(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex arctangent static func Hatan(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = atan(fa1) fa2 = atan(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex hyperbolic tangent static func Htanh(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = tanh(fa1) fa2 = tanh(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex hyperbolic arcsine static func Hasinh(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = asinh(fa1) fa2 = asinh(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex hyperbolic arccosine static func Hacosh(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = acosh(fa1) fa2 = acosh(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex hyperbolic arctangent static func Hatanh(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = atanh(fa1) fa2 = atanh(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex cotangent static func Hcotan(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = cotan(fa1) fa2 = cotan(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc ; Hypercomplex hyperbolic cotangent static func Hcotanh(Vector a, Vector b) complex a1 = a.m_x + flip(a.m_y) complex a2 = a.m_z + flip(a.m_w) complex fa1 = a1 - conj(flip(a2)) complex fa2 = a1 + conj(flip(a2)) fa1 = cotanh(fa1) fa2 = cotanh(fa2) c1 = 0.5*(fa1+fa2) c2 = 0.5*(conj(flip(fa1)) - conj(flip(fa2))) b.m_x = real(c1) b.m_y = imag(c1) b.m_z = real(c2) b.m_w = imag(c2) endfunc default: title = "Quat Hyper Methods" int param v_quathyper caption = "Version (Quat Hyper Methods)" default = 100 hint = "This version parameter is used to detect when a change has been \ made to the formula that is incompatible with the previous version. \ When that happens, this field will reflect the old version number to \ alert you to the fact that an alternate rendering is being used." visible = @v_quathyper < 100 endparam } ;------------------------------------------- ; Misc 3D 4D Methods including mandelbulb and Msltoe 3D ;------------------------------------------- Class MD { $define debug import "common.ulb" ; Spherical power ; Spherical complex representation for s = x + iy + jz ; ; r = x^2 + y^2 +z^2 ; phi = atan2(x + iy) azimuth ; theta = atan2(cabs(x+iy) + iz) elevation ; ; x = r*cos(theta)*cos(phi) ; y = r*cos(theta)*sin(phi) ; z = r*sin(theta) ; static func Spower(bool quadcor, bool altel, float power, Vector a, Vector b, float pfactor, int flagtype) ; Power function for s = x + iy + jz expressed in spherical coordinates float r = 0 float phi = 0 float theta = 0 if flagtype == 6 if a.m_z* a.m_z < a.m_y* a.m_y r = a.m_x*a.m_x+a.m_y*a.m_y+a.m_z*a.m_z+4*a.m_y*a.m_y*a.m_z*a.m_z float r1 = sqrt(r)+1e-10 phi = atan2(a.m_x + flip(a.m_y)) theta = asin(a.m_z/r1) else r = a.m_x*a.m_x+a.m_y*a.m_y+a.m_z*a.m_z+4*a.m_y*a.m_y*a.m_z*a.m_z float r1 = sqrt(r)+1e-10 theta = atan2(a.m_x + flip(a.m_z)) phi = asin(a.m_y/r1) endif endif r = sqrt(a.m_x^2 + a.m_y^2 + a.m_z^2)+1e-10 if flagtype != 6 phi = atan2(a.m_x + flip(a.m_y)) ; azimuth theta = 0 endif float asa = 0 if flagtype ==0 || flagtype == 1 if altel theta = asin(a.m_z/r) else theta = asin(-a.m_z/r) endif elseif flagtype == 9 || flagtype == 10\ || flagtype == 11|| flagtype == 12|| flagtype == 13|| flagtype == 14\ || flagtype == 15|| flagtype == 16|| flagtype == 17|| flagtype == 18\ || flagtype == 19|| flagtype == 20|| flagtype == 21|| flagtype == 22\ || flagtype == 23|| flagtype == 24|| flagtype == 25|| flagtype == 26\ || flagtype == 27|| flagtype == 28|| flagtype == 29|| flagtype == 30\ || flagtype == 31|| flagtype == 32|| flagtype == 33|| flagtype == 34\ || flagtype == 35|| flagtype == 36|| flagtype == 37|| flagtype == 38\ || flagtype == 39|| flagtype == 40|| flagtype == 41 phi = atan2(a.m_x + flip(a.m_z)) theta = asin(a.m_y/r) elseif flagtype == 2 if altel theta = acos(-a.m_z/r) else theta = acos(a.m_z/r) endif elseif flagtype == 7 || flagtype == 8 if altel theta = acos(-a.m_y/r) else theta = acos(a.m_y/r) endif elseif flagtype == 3 if altel theta = atan2(-a.m_x + flip(a.m_z)) else theta = atan2(a.m_x + flip(a.m_z)) endif endif if flagtype == 42 || flagtype == 43 || flagtype == 44 || flagtype == 45\ || flagtype == 46 || flagtype == 47 || flagtype == 48 || flagtype == 49\ || flagtype == 50 || flagtype == 51 || (flagtype > 51 && flagtype <95) if altel theta = atan2(-a.m_x + flip(a.m_y)) else theta = atan2(a.m_x + flip(a.m_y)) endif phi = asin(a.m_z/r) endif if flagtype == 4 || flagtype == 5 phi = atan2(a.m_x + flip(a.m_y)) theta = asin(a.m_z/r) endif if flagtype == 7 || flagtype == 8 phi = atan2(a.m_x + flip(a.m_z)) theta = acos(a.m_y/r) endif r = r^power phi = power*phi theta = power*theta*pfactor if flagtype ==0 || flagtype == 1 if quadcor if theta > #pi/2 asa = sin(theta) theta = asin(asa) endif if theta < -#pi/2 asa = sin(theta) theta = asin(asa) endif endif elseif flagtype == 2 if quadcor if theta > #pi/2 asa = cos(theta) theta = acos(asa) endif if theta < -#pi/2 asa = cos(theta) theta = acos(asa) endif endif elseif flagtype == 7 || flagtype == 8 if quadcor if theta > #pi/2 asa = cos(theta) theta = acos(asa) endif if theta < -#pi/2 asa = cos(theta) theta = acos(asa) endif endif elseif flagtype == 3 if quadcor if theta > #pi/2 asa = tan(theta) theta = atan(asa) endif if theta < -#pi/2 asa = tan(theta) theta = atan(asa) endif endif endif if flagtype ==0 || flagtype == 1 b.m_x = r*cos(theta)*cos(phi) b.m_y = r*cos(theta)*sin(phi) if flagtype == 0 b.m_z = r*sin(theta) elseif flagtype == 1 b.m_z = -r*sin(theta) endif elseif flagtype == 2 b.m_x = r*sin(theta)*sin(phi) b.m_y = r*sin(theta)*cos(phi) b.m_z = r*cos(theta) elseif flagtype == 3 b.m_x = r*cos(theta)*cos(phi) b.m_y = r*cos(theta)*sin(phi) b.m_z = r*sin(theta) elseif flagtype == 4 || flagtype == 5 b.m_x = r*cos(phi)*cos(theta) b.m_z = r*cos(phi)*sin(theta) if flagtype == 4 b.m_y = -r*sin(phi) elseif flagtype == 5 b.m_y = r*sin(phi) endif elseif flagtype == 6 if a.m_z* a.m_z < a.m_y* a.m_y b.m_x = r*cos(theta)*cos(phi) b.m_y = r*sin(phi)*cos(theta) b.m_z = -r*sin(theta) else b.m_x = r*cos(theta)*cos(phi) b.m_y = -r*sin(theta) b.m_z = r*sin(phi)*cos(theta) endif elseif flagtype == 7 b.m_x = r*sin(theta)*sin(phi) b.m_y = r*cos(theta) b.m_z = r*sin(theta)*cos(phi) elseif flagtype == 8 b.m_x = r*sin(theta)*sin(phi) b.m_y = -r*cos(theta) b.m_z = r*sin(theta)*cos(phi) elseif flagtype == 9 b.m_x = r*sin(theta) b.m_y = -r*sin(phi)*cos(theta) b.m_z = r*cos(theta)*cos(phi) elseif flagtype == 10 b.m_x = -r*sin(theta) b.m_y = r*cos(phi)*cos(theta) b.m_z = r*cos(theta)*sin(phi) elseif flagtype == 11 b.m_x = r*cos(theta) b.m_y = -r*sin(phi)*sin(theta) b.m_z = r*cos(phi)*sin(theta ) elseif flagtype == 12 b.m_x = r*cos(theta) b.m_y = -r*sin(phi)*sin(theta) b.m_z = -r*cos(phi)*sin(theta ) elseif flagtype == 13 b.m_x = -r*sin(theta) b.m_y = -r*sin(phi)*cos(theta) b.m_z = r*cos(phi)*cos(theta) elseif flagtype == 14 b.m_x = r*sin(theta) b.m_y = r*sin(phi)*cos(theta) b.m_z = r*cos(phi)*cos(theta) elseif flagtype == 15 b.m_x = -r*sin(theta) b.m_y = r*sin(phi)*cos(theta) b.m_z = r*cos(phi)*cos(theta) elseif flagtype == 16 b.m_x = r*sin(phi)*cos(theta) b.m_y = -r*sin(theta) b.m_z = r*cos(phi)*cos(theta) elseif flagtype == 17 b.m_x = -r*sin(phi)*sin(theta) b.m_y = r*cos(theta) b.m_z = -r*cos(phi)*sin(theta) elseif flagtype == 18 b.m_x = -r*sin(phi)*sin(theta) b.m_y = r*cos(theta) b.m_z = r*cos(phi)*sin(theta) elseif flagtype == 19 b.m_x = r*sin(phi)*cos(theta) b.m_y = r*sin(theta) b.m_z = r*cos(phi)*cos(theta) elseif flagtype == 20 b.m_x = -r*sin(phi)*cos(theta) b.m_y = -r*sin(theta) b.m_z = r*cos(phi)*cos(theta) elseif flagtype == 21 b.m_x = -r*sin(phi)*cos(theta) b.m_y = r*sin(theta) b.m_z = r*cos(phi)*cos(theta) elseif flagtype == 22 b.m_x = r*sin(phi)*sin(theta) b.m_y = -r*cos(phi)*sin(theta) b.m_z = r*cos(theta) elseif flagtype == 23 b.m_x = -r*sin(phi)*cos(theta) b.m_y = r*cos(phi)*cos(theta) b.m_z = -r*sin(theta) elseif flagtype == 24 b.m_x = r*sin(phi)*cos(theta) b.m_y = r*cos(phi)*cos(theta) b.m_z = r*sin(theta) elseif flagtype == 25 b.m_x = -r*sin(phi)*sin(theta) b.m_y = r*cos(phi)*sin(theta) b.m_z = r*cos(theta) elseif flagtype == 26 b.m_x = -r*sin(phi)*sin(theta) b.m_y = -r*cos(phi)*sin(theta) b.m_z = r*cos(theta) elseif flagtype == 27 b.m_x = -r*sin(phi)*sin(theta) b.m_y = r*cos(phi)*sin(theta) b.m_z = r*cos(theta) elseif flagtype == 28 b.m_x = r*cos(theta) b.m_y = -r*cos(phi)*sin(theta) b.m_z = -r*sin(phi)*sin(theta) elseif flagtype == 29 b.m_x = r*cos(theta) b.m_y = r*cos(phi)*sin(theta) b.m_z = -r*sin(phi)*sin(theta) elseif flagtype == 30 b.m_x = r*sin(theta) b.m_y = r*cos(phi)*cos(theta) b.m_z = r*sin(phi)*cos(theta) elseif flagtype == 31 b.m_x = -r*sin(theta) b.m_y = r*cos(phi)*cos(theta) b.m_z = -r*sin(phi)*cos(theta) elseif flagtype == 32 b.m_x = r*sin(theta) b.m_y = r*cos(phi)*cos(theta) b.m_z = -r*sin(phi)*cos(theta) elseif flagtype == 33 b.m_x = -r*cos(phi)*sin(theta) b.m_y = r*cos(theta) b.m_z = r*sin(phi)*sin(theta) elseif flagtype == 34 b.m_x = r*cos(phi)*cos(theta) b.m_y = -r*sin(theta) b.m_z = -r*sin(phi)*cos(theta) elseif flagtype == 35 b.m_x = r*cos(phi)*cos(theta) b.m_y = r*sin(theta) b.m_z = r*sin(phi)*cos(theta) elseif flagtype == 36 b.m_x = r*cos(phi)*sin(theta) b.m_y = r*cos(theta) b.m_z = -r*sin(phi)*sin(theta) elseif flagtype == 37 b.m_x = -r*cos(phi)*sin(theta) b.m_y = r*cos(theta) b.m_z = -r*sin(phi)*sin(theta) elseif flagtype == 38 b.m_x = r*cos(phi)*sin(theta) b.m_y = r*cos(theta) b.m_z = r*sin(phi)*sin(theta) elseif flagtype == 39 b.m_x = r*cos(phi)*cos(theta) b.m_y = -r*sin(phi)*cos(theta) b.m_z = -r*sin(theta) elseif flagtype == 40 b.m_x = r*cos(phi)*cos(theta) b.m_y = -r*sin(phi)*cos(theta) b.m_z = r*sin(theta) elseif flagtype == 41 b.m_x = r*cos(phi)*sin(theta) b.m_y = -r*sin(phi)*sin(theta) b.m_z = r*cos(theta) elseif flagtype == 42 b.m_x = r*cos(theta) b.m_y = r*cos(phi) b.m_z = r*sin(theta) elseif flagtype == 43 b.m_x = r*cos(theta) b.m_y = -r*cos(phi) b.m_z = r*sin(theta) elseif flagtype == 44 b.m_x = r*cos(theta) b.m_y = -r*cos(phi) b.m_z = -r*sin(theta) elseif flagtype == 45 b.m_x = r*cos(theta) b.m_y = r*sin(theta) b.m_z = r*cos(phi) elseif flagtype == 46 b.m_x = r*cos(theta) b.m_y = r*sin(phi) b.m_z = r*cos(phi) elseif flagtype == 47 b.m_x = r*cos(theta) b.m_y = -r*sin(phi) b.m_z = -r*sin(theta) elseif flagtype == 48 b.m_x = -r*cos(theta) b.m_y = r*cos(phi) b.m_z = r*sin(theta) elseif flagtype == 49 b.m_x = -r*cos(theta) b.m_y = r*cos(phi) b.m_z = -r*sin(theta) elseif flagtype == 50 b.m_x = -r*cos(theta) b.m_y = r*cos(phi) b.m_z = r*sin(phi) elseif flagtype == 51 b.m_x = -r*cos(theta) b.m_y = r*cos(phi) b.m_z = -r*sin(phi) elseif flagtype == 52 b.m_x = r*cos(theta) b.m_y = r*sin(phi) b.m_z = r*sin(theta) elseif flagtype == 53 b.m_x = r*cos(theta) b.m_y = r*sin(phi) b.m_z = -r*sin(theta) elseif flagtype == 54 b.m_x = -r*cos(theta) b.m_y = -r*cos(phi) b.m_z = -r*sin(theta) elseif flagtype == 55 b.m_x = -r*cos(theta) b.m_y = -r*cos(phi) b.m_z = -r*sin(phi) elseif flagtype == 56 b.m_x = -r*cos(theta) b.m_y = r*sin(theta) b.m_z = r*cos(phi) elseif flagtype == 57 b.m_x = -r*cos(theta) b.m_y = r*sin(phi) b.m_z = r*cos(phi) elseif flagtype == 58 b.m_x = -r*cos(theta) b.m_y = r*sin(phi) b.m_z = r*sin(theta) elseif flagtype == 59 b.m_x = -r*cos(theta) b.m_y = r*sin(phi) b.m_z = -r*sin(theta) elseif flagtype == 60 b.m_x = -r*cos(theta) b.m_y = -r*sin(phi) b.m_z = r*cos(phi) elseif flagtype == 61 b.m_x = -r*cos(theta) b.m_y = -r*sin(phi) b.m_z = -r*cos(phi) elseif flagtype == 62 b.m_x = -r*cos(theta) b.m_y = -r*sin(phi) b.m_z = r*sin(theta) elseif flagtype == 63 b.m_x = -r*cos(theta) b.m_y = -r*sin(phi) b.m_z = -r*sin(theta) elseif flagtype == 64 b.m_x = r*cos(phi) b.m_y = r*sin(phi) b.m_z = r*cos(theta) elseif flagtype == 65 b.m_x = r*cos(phi) b.m_y = r*sin(phi) b.m_z = -r*cos(theta) elseif flagtype == 66 b.m_x = r*cos(phi) b.m_y = r*sin(phi) b.m_z = r*sin(theta) elseif flagtype == 67 b.m_x = r*cos(phi) b.m_y = -r*sin(phi) b.m_z = -r*cos(theta) elseif flagtype == 68 b.m_x = -r*cos(phi) b.m_y = r*sin(phi) b.m_z = r*cos(theta) elseif flagtype == 69 b.m_x = -r*cos(phi) b.m_y = r*sin(phi) b.m_z = -r*cos(theta) elseif flagtype == 70 b.m_x = -r*cos(phi) b.m_y = r*sin(phi) b.m_z = r*sin(theta) elseif flagtype == 71 b.m_x = -r*cos(phi) b.m_y = r*sin(phi) b.m_z = -r*sin(theta) elseif flagtype == 72 b.m_x = -r*cos(phi) b.m_y = -r*sin(phi) b.m_z = r*cos(theta) elseif flagtype == 73 b.m_x = -r*cos(phi) b.m_y = -r*sin(phi) b.m_z = -r*cos(theta) elseif flagtype == 74 b.m_x = -r*cos(phi) b.m_y = -r*sin(phi) b.m_z = r*sin(theta) elseif flagtype == 75 b.m_x = -r*cos(phi) b.m_y = -r*sin(phi) b.m_z = -r*sin(theta) elseif flagtype == 76 b.m_x = r*sin(theta) b.m_y = -r*cos(theta) b.m_z = r*sin(phi) elseif flagtype == 77 b.m_x = r*sin(theta) b.m_y = r*cos(phi) b.m_z = r*cos(theta) elseif flagtype == 78 b.m_x = r*sin(theta) b.m_y = r*sin(phi) b.m_z = r*cos(theta) elseif flagtype == 79 b.m_x = r*sin(theta) b.m_y = r*sin(phi) b.m_z = -r*cos(theta) elseif flagtype == 80 b.m_x = r*sin(theta) b.m_y = r*sin(phi) b.m_z = r*cos(phi) elseif flagtype == 81 b.m_x = -r*sin(theta) b.m_y = r*cos(theta) b.m_z = r*cos(phi) elseif flagtype == 82 b.m_x = -r*sin(theta) b.m_y = r*cos(phi) b.m_z = r*sin(phi) elseif flagtype == 83 b.m_x = -r*sin(theta) b.m_y = -r*cos(phi) b.m_z = -r*cos(theta) elseif flagtype == 84 b.m_x = -r*sin(theta) b.m_y = r*sin(phi) b.m_z = r*cos(theta) elseif flagtype == 85 b.m_x = -r*sin(theta) b.m_y = r*sin(phi) b.m_z = -r*cos(theta) elseif flagtype == 86 b.m_x = -r*sin(theta) b.m_y = -r*sin(phi) b.m_z = -r*cos(theta) elseif flagtype == 87 b.m_x = -r*sin(theta) b.m_y = -r*sin(phi) b.m_z = r*cos(phi) elseif flagtype == 88 b.m_x = r*sin(phi) b.m_y = -r*cos(phi) b.m_z = r*sin(theta) elseif flagtype == 89 b.m_x = r*sin(phi) b.m_y = -r*cos(phi) b.m_z = -r*sin(theta) elseif flagtype == 90 b.m_x = -r*sin(phi) b.m_y = r*cos(phi) b.m_z = r*cos(theta) elseif flagtype == 91 b.m_x = -r*sin(phi) b.m_y = r*cos(phi) b.m_z = -r*cos(theta) elseif flagtype == 92 b.m_x = r*sin(phi) b.m_y = r*cos(phi) b.m_z = r*sin(theta) elseif flagtype == 93 b.m_x = -r*sin(phi) b.m_y = r*cos(phi) b.m_z = -r*sin(theta) elseif flagtype == 94 b.m_x = -r*sin(phi) b.m_y = -r*cos(phi) b.m_z = -r*cos(theta) endif b.m_w = 0 endfunc ; r = x^2 + y^2 +z^2 ; theta = acos(a.m_z/r) elevation ; phi = atan2(x + iy) azimuth ; theta = theta*power; ; b.m_x = r*sin(theta)*cos(phi) ; b.m_y = r*sin(theta)*sin(phi) ; b.m_z = r*cos(theta) ; b.m_w = 0 ; theta = acos(b.m_z/r) elevation ; phi = atan2(b.m_x + ib.m_y) azimuth ; phi = phi*power; ; r = r^power ; b.m_x = r*sin(theta)*cos(phi) ; b.m_y = r*sin(theta)*sin(phi) ; b.m_z = r*cos(theta) ; b.m_w = 0 static func Spower2(float power, Vector a, Vector b) ; Alternate Power function for s = x + iy + jz expressed in spherical coordinates float r = sqrt(a.m_x^2 + a.m_y^2 + a.m_z^2)+1e-10 float phi = atan2(a.m_x + flip(a.m_y)) ; azimuth float theta = acos(a.m_z/r) theta = power*theta b.m_x = r*sin(theta)*cos(phi) b.m_y = r*sin(theta)*sin(phi) b.m_z = r*cos(theta) b.m_w = 0 theta = acos(b.m_z/r); elevation phi = atan2(b.m_x + flip(b.m_y)) ; azimuth phi = phi*power; r = r^power b.m_x = r*sin(theta)*cos(phi) b.m_y = r*sin(theta)*sin(phi) b.m_z = r*cos(theta) b.m_w = 0 endfunc static func SMult(bool quadcor,bool altel, Vector a, Vector b, Vector c, float pfactor, int flagtype) float ra = 0 float rb = 0 float r = 0 float phia = 0 float phib = 0 float thetaa = 0 float thetab = 0 if flagtype == 6 if a.m_z* a.m_z < a.m_y* a.m_y r = a.m_x*a.m_x+a.m_y*a.m_y+a.m_z*a.m_z+4*a.m_y*a.m_y*a.m_z*a.m_z float r1 = sqrt(r)+1e-10 phia = atan2(a.m_x + flip(a.m_y)) thetaa = asin(a.m_z/r1) else r = a.m_x*a.m_x+a.m_y*a.m_y+a.m_z*a.m_z+4*a.m_y*a.m_y*a.m_z*a.m_z float r1 = sqrt(r)+1e-10 thetaa = atan2(a.m_x + flip(a.m_z)) phia = asin(a.m_y/r1) endif if b.m_z* b.m_z < b.m_y* b.m_y r = b.m_x*b.m_x+b.m_y*b.m_y+b.m_z*b.m_z+4*b.m_y*b.m_y*b.m_z*b.m_z float r1 = sqrt(r)+1e-10 phib = atan2(b.m_x + flip(b.m_y)) thetab = asin(b.m_z/r1) else r = b.m_x*b.m_x+b.m_y*b.m_y+b.m_z*b.m_z+4*b.m_y*b.m_y*b.m_z*b.m_z float r1 = sqrt(r)+1e-10 thetab = atan2(b.m_x + flip(b.m_z)) phib = asin(b.m_y/r1) endif endif ra = sqrt(a.m_x^2 + a.m_y^2 + a.m_z^2)+1e-10 rb = sqrt(b.m_x^2 + b.m_y^2 + b.m_z^2)+1e-10 if flagtype != 6 float phia = atan2(a.m_x + flip(a.m_y)) ; azimuth float thetaa = 0 endif if flagtype == 7 || flagtype == 8 phia = atan2(a.m_x + flip(a.m_z)) thetaa = acos(a.m_y/ra) endif float asa = 0 if flagtype ==0 || flagtype == 1 if altel thetaa = asin(a.m_z/ra) else thetaa = asin(-a.m_z/ra) endif elseif flagtype == 9 || flagtype == 10\ || flagtype == 11|| flagtype == 12|| flagtype == 13|| flagtype == 14\ || flagtype == 15|| flagtype == 16|| flagtype == 17|| flagtype == 18\ || flagtype == 19|| flagtype == 20|| flagtype == 21|| flagtype == 22\ || flagtype == 23|| flagtype == 24|| flagtype == 25|| flagtype == 26\ || flagtype == 27|| flagtype == 28|| flagtype == 29|| flagtype == 30\ || flagtype == 31|| flagtype == 32|| flagtype == 33|| flagtype == 34\ || flagtype == 35|| flagtype == 36|| flagtype == 37|| flagtype == 38\ || flagtype == 39|| flagtype == 40|| flagtype == 41 phia = atan2(a.m_x + flip(a.m_z)) thetaa = asin(a.m_y/ra) elseif flagtype == 2 if altel thetaa = acos(-a.m_z/ra) else thetaa = acos(a.m_z/ra) endif elseif flagtype == 7 || flagtype == 8 if altel thetaa = acos(-a.m_y/ra) else thetaa = acos(a.m_y/ra) endif elseif flagtype == 3 if altel thetaa = atan2(-a.m_x + flip(a.m_z)) else thetaa = atan2(a.m_x + flip(a.m_z)) endif endif if flagtype == 42 || flagtype == 43 || flagtype == 44 || flagtype == 45\ || flagtype == 46 || flagtype == 47|| flagtype == 48 || flagtype == 49\ || flagtype == 50 || flagtype == 51 ||(flagtype > 51 && flagtype <95) if altel thetaa = atan2(-a.m_x + flip(a.m_y)) else thetaa = atan2(a.m_x + flip(a.m_y)) endif phia = asin(a.m_z/ra) endif if flagtype != 6 float phib = atan2(b.m_x + flip(b.m_y)) ; azimuth float thetab = 0 endif if flagtype == 7 || flagtype == 8 phib = atan2(b.m_x + flip(b.m_z)) thetab = acos(b.m_y/rb) endif if flagtype ==0 || flagtype == 1 if altel thetab = asin(b.m_z/rb) else thetab = asin(-b.m_z/rb) endif elseif flagtype == 9 || flagtype == 10\ || flagtype == 11|| flagtype == 12|| flagtype == 13|| flagtype == 14\ || flagtype == 15|| flagtype == 16|| flagtype == 17|| flagtype == 18\ || flagtype == 19|| flagtype == 20|| flagtype == 21|| flagtype == 22\ || flagtype == 23|| flagtype == 24|| flagtype == 25|| flagtype == 26\ || flagtype == 27|| flagtype == 28|| flagtype == 29|| flagtype == 30\ || flagtype == 31|| flagtype == 32|| flagtype == 33|| flagtype == 34\ || flagtype == 35|| flagtype == 36|| flagtype == 37|| flagtype == 38\ || flagtype == 39|| flagtype == 40|| flagtype == 41 phib = atan2(b.m_x + flip(b.m_z)) thetab = asin(b.m_y/rb) elseif flagtype == 2 if altel thetab = acos(-b.m_z/rb) else thetab = acos(b.m_z/rb) endif elseif flagtype == 7 || flagtype == 8 if altel thetab = acos(-b.m_y/rb) else thetab = acos(b.m_y/rb) endif elseif flagtype == 3 if altel thetab = atan2(-b.m_x + flip(b.m_z)) else thetab = atan2(b.m_x + flip(b.m_z)) endif endif if flagtype == 42 || flagtype == 43 || flagtype == 44 || flagtype == 45\ || flagtype == 46 || flagtype == 47|| flagtype == 48 || flagtype == 49\ || flagtype == 50 || flagtype == 51 ||(flagtype > 51 && flagtype <95) if altel thetab = atan2(-b.m_x + flip(b.m_y)) else thetab = atan2(b.m_x + flip(b.m_y)) endif phib = asin(b.m_z/rb) endif if flagtype == 4 || flagtype == 5 phia = atan2(a.m_x + flip(a.m_y)) phib = atan2(b.m_x + flip(b.m_y)) thetaa = asin(a.m_z/ra) thetab = asin(b.m_z/rb) endif float r = ra*rb float phi = phia + phib float theta = (thetaa + thetab)*pfactor if flagtype ==0 || flagtype == 1 if quadcor if theta > #pi/2 asa = sin(theta) theta = asin(asa) endif if theta < -#pi/2 asa = sin(theta) theta = asin(asa) endif endif elseif flagtype == 2 if quadcor if theta > #pi/2 asa = cos(theta) theta = acos(asa) endif if theta < -#pi/2 asa = cos(theta) theta = acos(asa) endif endif elseif flagtype == 3 if quadcor if theta > #pi/2 asa = tan(theta) theta = atan(asa) endif if theta < -#pi/2 asa = tan(theta) theta = atan(asa) endif endif elseif flagtype == 7 || flagtype == 8 if quadcor if theta > #pi/2 asa = tan(theta) theta = atan(asa) endif if theta < -#pi/2 asa = tan(theta) theta = atan(asa) endif endif endif if flagtype ==0 || flagtype == 1 c.m_x = r*cos(theta)*cos(phi) c.m_y = r*cos(theta)*sin(phi) if flagtype == 0 c.m_z = r*sin(theta) elseif flagtype == 1 c.m_z = -r*sin(theta) endif elseif flagtype == 2 c.m_x = r*sin(theta)*sin(phi) c.m_y = r*sin(theta)*cos(phi) c.m_z = r*cos(theta) elseif flagtype == 3 c.m_x = r*cos(theta)*cos(phi) c.m_y = r*cos(theta)*sin(phi) c.m_z = r*sin(theta) elseif flagtype == 4 || flagtype == 5 c.m_x = r*cos(phi)*cos(theta) c.m_z = r*cos(phi)*sin(theta) if flagtype == 4 c.m_y = -r*sin(phi) elseif flagtype == 5 c.m_y = r*sin(phi) endif elseif flagtype == 6 if a.m_z* a.m_z < a.m_y* a.m_y c.m_x = r*cos(theta)*cos(phi) c.m_y = r*sin(phi)*cos(theta) c.m_z = -r*sin(theta) else c.m_x = r*cos(theta)*cos(phi) c.m_y = -r*sin(theta) c.m_z = r*sin(phi)*cos(theta) endif elseif flagtype == 7 c.m_x = r*sin(theta)*sin(phi) c.m_y = r*cos(theta) c.m_z = r*sin(theta)*cos(phi) elseif flagtype == 8 c.m_x = r*sin(theta)*sin(phi) c.m_y = r*cos(theta) c.m_z = r*sin(theta)*cos(phi) elseif flagtype == 9 c.m_x = r*sin(theta) c.m_y = -r*sin(phi)*cos(theta) c.m_z = r*cos(theta)*cos(phi) elseif flagtype == 10 c.m_x = -r*sin(theta) c.m_y = r*cos(phi)*cos(theta) c.m_z = r*cos(theta)*sin(phi) elseif flagtype == 11 c.m_x = r*cos(theta) c.m_y = -r*sin(phi)*sin(theta) c.m_z = r*cos(phi)*sin(theta ) elseif flagtype == 12 c.m_x = r*cos(theta) c.m_y = -r*sin(phi)*sin(theta) c.m_z = -r*cos(phi)*sin(theta ) elseif flagtype == 13 c.m_x = -r*sin(theta) c.m_y = -r*sin(phi)*cos(theta) c.m_z = -r*cos(phi)*cos(theta) elseif flagtype == 14 c.m_x = r*sin(theta) c.m_y = r*sin(phi)*cos(theta) c.m_z = r*cos(phi)*cos(theta) elseif flagtype == 15 c.m_x = -r*sin(theta) c.m_y = r*sin(phi)*cos(theta) c.m_z = r*cos(phi)*cos(theta) elseif flagtype == 16 c.m_x = r*sin(phi)*cos(theta) c.m_y = -r*sin(theta) c.m_z = r*cos(phi)*cos(theta) elseif flagtype == 17 c.m_x = -r*sin(phi)*sin(theta) c.m_y = r*cos(theta) c.m_z = -r*cos(phi)*sin(theta) elseif flagtype == 18 c.m_x = -r*sin(phi)*sin(theta) c.m_y = r*cos(theta) c.m_z = r*cos(phi)*sin(theta) elseif flagtype == 19 c.m_x = r*sin(phi)*cos(theta) c.m_y = r*sin(theta) c.m_z = r*cos(phi)*cos(theta) elseif flagtype == 20 c.m_x = -r*sin(phi)*cos(theta) c.m_y = -r*sin(theta) c.m_z = r*cos(phi)*cos(theta) elseif flagtype == 21 c.m_x = -r*sin(phi)*cos(theta) c.m_y = r*sin(theta) c.m_z = r*cos(phi)*cos(theta) elseif flagtype == 22 c.m_x = r*sin(phi)*sin(theta) c.m_y = -r*cos(phi)*sin(theta) c.m_z = r*cos(theta) elseif flagtype == 23 c.m_x = -r*sin(phi)*cos(theta) c.m_y = r*cos(phi)*cos(theta) c.m_z = -r*sin(theta) elseif flagtype == 24 c.m_x = r*sin(phi)*cos(theta) c.m_y = r*cos(phi)*cos(theta) c.m_z = r*sin(theta) elseif flagtype == 25 c.m_x = -r*sin(phi)*sin(theta) c.m_y = r*cos(phi)*sin(theta) c.m_z = r*cos(theta) elseif flagtype == 26 c.m_x = -r*sin(phi)*sin(theta) c.m_y = -r*cos(phi)*sin(theta) c.m_z = r*cos(theta) elseif flagtype == 27 c.m_x = -r*sin(phi)*sin(theta) c.m_y = r*cos(phi)*sin(theta) c.m_z = r*cos(theta) elseif flagtype == 28 c.m_x = r*cos(theta) c.m_y = -r*cos(phi)*sin(theta) c.m_z = -r*sin(phi)*sin(theta) elseif flagtype == 29 c.m_x = r*cos(theta) c.m_y = r*cos(phi)*sin(theta) c.m_z = -r*sin(phi)*sin(theta) elseif flagtype == 30 c.m_x = r*sin(theta) c.m_y = r*cos(phi)*cos(theta) c.m_z = r*sin(phi)*cos(theta) elseif flagtype == 31 c.m_x = -r*sin(theta) c.m_y = r*cos(phi)*cos(theta) c.m_z = -r*sin(phi)*cos(theta) elseif flagtype == 32 c.m_x = r*sin(theta) c.m_y = r*cos(phi)*cos(theta) c.m_z = -r*sin(phi)*cos(theta) elseif flagtype == 33 c.m_x = -r*cos(phi)*sin(theta) c.m_y = r*cos(theta) c.m_z = r*sin(phi)*sin(theta) elseif flagtype == 34 c.m_x = r*cos(phi)*cos(theta) c.m_y = -r*sin(theta) c.m_z = -r*sin(phi)*cos(theta) elseif flagtype == 35 c.m_x = r*cos(phi)*cos(theta) c.m_y = r*sin(theta) c.m_z = r*sin(phi)*cos(theta) elseif flagtype == 36 c.m_x = r*cos(phi)*sin(theta) c.m_y = r*cos(theta) c.m_z = -r*sin(phi)*sin(theta) elseif flagtype == 37 c.m_x = -r*cos(phi)*sin(theta) c.m_y = r*cos(theta) c.m_z = -r*sin(phi)*sin(theta) elseif flagtype == 38 c.m_x = r*cos(phi)*sin(theta) c.m_y = r*cos(theta) c.m_z = r*sin(phi)*sin(theta) elseif flagtype == 39 c.m_x = r*cos(phi)*cos(theta) c.m_y = -r*sin(phi)*cos(theta) c.m_z = -r*sin(theta) elseif flagtype == 40 c.m_x = r*cos(phi)*cos(theta) c.m_y = -r*sin(phi)*cos(theta) c.m_z = r*sin(theta) elseif flagtype == 41 c.m_x = r*cos(phi)*sin(theta) c.m_y = -r*sin(phi)*sin(theta) c.m_z = r*cos(theta) elseif flagtype == 42 c.m_x = r*cos(theta) c.m_y = r*cos(phi) c.m_z = r*sin(theta) elseif flagtype == 43 c.m_x = r*cos(theta) c.m_y = -r*cos(phi) c.m_z = r*sin(theta) elseif flagtype == 44 c.m_x = r*cos(theta) c.m_y = -r*cos(phi) c.m_z = -r*sin(theta) elseif flagtype == 45 c.m_x = r*cos(theta) c.m_y = r*sin(theta) c.m_z = r*cos(phi) elseif flagtype == 46 c.m_x = r*cos(theta) c.m_y = r*sin(phi) c.m_z = r*cos(phi) elseif flagtype == 47 c.m_x = r*cos(theta) c.m_y = -r*sin(phi) c.m_z = -r*sin(theta) elseif flagtype == 48 c.m_x = -r*cos(theta) c.m_y = r*cos(phi) c.m_z = r*sin(theta) elseif flagtype == 49 c.m_x = -r*cos(theta) c.m_y = r*cos(phi) c.m_z = -r*sin(theta) elseif flagtype == 50 c.m_x = -r*cos(theta) c.m_y = r*cos(phi) c.m_z = r*sin(phi) elseif flagtype == 51 c.m_x = -r*cos(theta) c.m_y = r*cos(phi) c.m_z = -r*sin(phi) elseif flagtype == 52 c.m_x = r*cos(theta) c.m_y = r*sin(phi) c.m_z = r*sin(theta) elseif flagtype == 53 c.m_x = r*cos(theta) c.m_y = r*sin(phi) c.m_z = -r*sin(theta) elseif flagtype == 54 c.m_x = -r*cos(theta) c.m_y = -r*cos(phi) c.m_z = -r*sin(theta) elseif flagtype == 55 c.m_x = -r*cos(theta) c.m_y = -r*cos(phi) c.m_z = -r*sin(phi) elseif flagtype == 56 c.m_x = -r*cos(theta) c.m_y = r*sin(theta) c.m_z = r*cos(phi) elseif flagtype == 57 c.m_x = -r*cos(theta) c.m_y = r*sin(phi) c.m_z = r*cos(phi) elseif flagtype == 58 c.m_x = -r*cos(theta) c.m_y = r*sin(phi) c.m_z = r*sin(theta) elseif flagtype == 59 c.m_x = -r*cos(theta) c.m_y = r*sin(phi) c.m_z = -r*sin(theta) elseif flagtype == 60 c.m_x = -r*cos(theta) c.m_y = -r*sin(phi) c.m_z = r*cos(phi) elseif flagtype == 61 c.m_x = -r*cos(theta) c.m_y = -r*sin(phi) c.m_z = -r*cos(phi) elseif flagtype == 62 c.m_x = -r*cos(theta) c.m_y = -r*sin(phi) c.m_z = r*sin(theta) elseif flagtype == 63 c.m_x = -r*cos(theta) c.m_y = -r*sin(phi) c.m_z = -r*sin(theta) elseif flagtype == 64 c.m_x = r*cos(phi) c.m_y = r*sin(phi) c.m_z = r*cos(theta) elseif flagtype == 65 c.m_x = r*cos(phi) c.m_y = r*sin(phi) c.m_z = -r*cos(theta) elseif flagtype == 66 c.m_x = r*cos(phi) c.m_y = r*sin(phi) c.m_z = r*sin(theta) elseif flagtype == 67 c.m_x = r*cos(phi) c.m_y = -r*sin(phi) c.m_z = -r*cos(theta) elseif flagtype == 68 c.m_x = -r*cos(phi) c.m_y = r*sin(phi) c.m_z = r*cos(theta) elseif flagtype == 69 c.m_x = -r*cos(phi) c.m_y = r*sin(phi) c.m_z = -r*cos(theta) elseif flagtype == 70 c.m_x = -r*cos(phi) c.m_y = r*sin(phi) c.m_z = r*sin(theta) elseif flagtype == 71 c.m_x = -r*cos(phi) c.m_y = r*sin(phi) c.m_z = -r*sin(theta) elseif flagtype == 72 c.m_x = -r*cos(phi) c.m_y = -r*sin(phi) c.m_z = r*cos(theta) elseif flagtype == 73 c.m_x = -r*cos(phi) c.m_y = -r*sin(phi) c.m_z = -r*cos(theta) elseif flagtype == 74 c.m_x = -r*cos(phi) c.m_y = -r*sin(phi) c.m_z = r*sin(theta) elseif flagtype == 75 c.m_x = -r*cos(phi) c.m_y = -r*sin(phi) c.m_z = -r*sin(theta) elseif flagtype == 76 c.m_x = r*sin(theta) c.m_y = -r*cos(theta) c.m_z = r*sin(phi) elseif flagtype == 77 c.m_x = r*sin(theta) c.m_y = r*cos(phi) c.m_z = r*cos(theta) elseif flagtype == 78 c.m_x = r*sin(theta) c.m_y = r*sin(phi) c.m_z = r*cos(theta) elseif flagtype == 79 c.m_x = r*sin(theta) c.m_y = r*sin(phi) c.m_z = -r*cos(theta) elseif flagtype == 80 c.m_x = r*sin(theta) c.m_y = r*sin(phi) c.m_z = r*cos(phi) elseif flagtype == 81 c.m_x = -r*sin(theta) c.m_y = r*cos(theta) c.m_z = r*cos(phi) elseif flagtype == 82 c.m_x = -r*sin(theta) c.m_y = r*cos(phi) c.m_z = r*sin(phi) elseif flagtype == 83 c.m_x = -r*sin(theta) c.m_y = -r*cos(phi) c.m_z = -r*cos(theta) elseif flagtype == 84 c.m_x = -r*sin(theta) c.m_y = r*sin(phi) c.m_z = r*cos(theta) elseif flagtype == 85 c.m_x = -r*sin(theta) c.m_y = r*sin(phi) c.m_z = -r*cos(theta) elseif flagtype == 86 c.m_x = -r*sin(theta) c.m_y = -r*sin(phi) c.m_z = -r*cos(theta) elseif flagtype == 87 c.m_x = -r*sin(theta) c.m_y = -r*sin(phi) c.m_z = r*cos(phi) elseif flagtype == 88 c.m_x = r*sin(phi) c.m_y = -r*cos(phi) c.m_z = r*sin(theta) elseif flagtype == 89 c.m_x = r*sin(phi) c.m_y = -r*cos(phi) c.m_z = -r*sin(theta) elseif flagtype == 90 c.m_x = -r*sin(phi) c.m_y = r*cos(phi) c.m_z = r*cos(theta) elseif flagtype == 91 c.m_x = -r*sin(phi) c.m_y = r*cos(phi) c.m_z = -r*cos(theta) elseif flagtype == 92 c.m_x = r*sin(phi) c.m_y = r*cos(phi) c.m_z = r*sin(theta) elseif flagtype == 93 c.m_x = -r*sin(phi) c.m_y = r*cos(phi) c.m_z = -r*sin(theta) elseif flagtype == 94 c.m_x = -r*sin(phi) c.m_y = -r*cos(phi) c.m_z = -r*cos(theta) endif c.m_w = 0 endfunc static func SDiv(bool quadcor,bool altel, Vector a, Vector b, Vector c,float pfactor) ; Vector b is the divisor float ra = sqrt(a.m_x^2 + a.m_y^2 + a.m_z^2)+1e-10 float phia = atan2(a.m_x + flip(a.m_y)) ; azimuth float thetaa = 0 float asa = 0 if altel thetaa = asin(-a.m_z/ra) else thetaa = asin(a.m_z/ra) endif float rb = sqrt(b.m_x^2 + b.m_y^2 + b.m_z^2)+1e-10 float phib = atan2(b.m_x + flip(b.m_y)) ; azimuth float thetab = 0 if altel thetab = asin(-b.m_z/rb) else thetab = asin(b.m_z/rb) endif float r = ra/rb float phi = phia - phib float theta = (thetaa - thetab)*pfactor if quadcor if theta > #pi/2 asa = sin(theta) theta = asin(asa) endif if theta < -#pi/2 asa = sin(theta) theta = asin(asa) endif endif c.m_x = r*cos(theta)*cos(phi) c.m_y = r*cos(theta)*sin(phi) c.m_z = r^pfactor*sin(theta) c.m_w = 0 endfunc static func SExp(Vector a, Vector b) float t = a.m_z/sqrt(a.m_x^2+a.m_y^2) float p = t*a.m_x + a.m_y float m = t*a.m_x - a.m_y float m2 = a.m_x - t*a.m_y b.m_x = 0.5*exp(m2)*(cos(p) + exp(2*t*a.m_y)*cos(m)) b.m_y = 0.5*exp(m2)*(sin(p) - exp(2*t*a.m_y)*sin(m)) b.m_z = exp(sqrt(a.m_x^2+a.m_y^2))*sin(a.m_z) b.m_w = 0 endfunc static func SLn(Vector a, Vector b) float t = (a.m_x-1)^2 + a.m_y^2 b.m_x = 0.25*log((2*a.m_z^2*((a.m_x-1)*a.m_x+(a.m_y-1)*a.m_y)*((a.m_x-1)*a.m_x+a.m_y^2+a.m_y))/t \ + (a.m_x^2+a.m_y^2)^2 + a.m_z^4) b.m_y = 0.25*(-atan2(flip((a.m_x-1)*a.m_z-sqrt(t)*a.m_y)+sqrt(t)*a.m_x+a.m_y*a.m_z) \ +atan2(flip(sqrt(t)*a.m_y+(a.m_x-1)*a.m_z)+sqrt(t)*a.m_x-a.m_y*a.m_z) \ -atan2(flip(-sqrt(t)*a.m_y-a.m_x*a.m_z+a.m_z)+sqrt(t)*a.m_x-a.m_y*a.m_z) \ +atan2(flip(sqrt(t)*a.m_y-a.m_x*a.m_z+a.m_z)+sqrt(t)*a.m_x+a.m_y*a.m_z)) b.m_z = atan(a.m_z/(sqrt(t)+1)) b.m_w = 0 endfunc static func Tpower(Vector a, Vector b, Vector c, float pfactor, int flagtype) ; T1^T2 = exp(ln(T1)*T2) Vector d = new Vector(0,0,0,0) Vector f = new Vector(0,0,0,0) Sln(a,d) Smult(false,false,b,d,f,pfactor,flagtype) Sexp(f,c) c.m_w = 0 endfunc default: title = "Misc 3D 4D Methods" int param v_3D4D caption = "Version (Misc 3D 4D Methods)" default = 100 hint = "This version parameter is used to detect when a change has been \ made to the formula that is incompatible with the previous version. When \ that happens, this field will reflect the old version number to alert you \ to the fact that an alternate rendering is being used." visible = @v_3D4D < 100 endparam } Class LKM { import "common.ulb" ; 3D Mandelbrot ; 3D representation for s = x + ij + jz ; ; Multiplication table for unit vectors: ; ; | r i j ; ------------------ ; r | r i j ; i | i -j -r ; j | j -r -i ; static func LKMsqr(Vector a, Vector b) b.m_x = a.m_x^2 - 2*a.m_y*a.m_z b.m_y = 2*a.m_x*a.m_y - a.m_z^2 b.m_z = 2*a.m_x*a.m_z - a.m_y^2 b.m_w = 0 endfunc static func LKMmult(Vector a, Vector b, Vector c) c.m_x = a.m_x*b.m_x - a.m_y*b.m_z - a.m_z*b.m_y c.m_y = a.m_x*b.m_y + a.m_y*b.m_x - a.m_z*b.m_z c.m_z = a.m_x*b.m_z - a.m_y*b.m_y + a.m_z*b.m_x c.m_w = 0 endfunc ; 3D Mandelbrot2 ; 3D representation for s = x + ij + jz ; ; Multiplication table for unit vectors: ; ; | r i j ; ------------------ ; r | r i j ; i | i -r -j ; j | j -i -r ; static func REBsqr(Vector a, Vector b) b.m_x = a.m_x^2 - a.m_y^2 - a.m_z^2 b.m_y = 2*a.m_x*a.m_y - a.m_y*a.m_z b.m_z = 2*a.m_x*a.m_z - a.m_y*a.m_z b.m_w = 0 endfunc static func REBmult(Vector a, Vector b, Vector c) c.m_x = a.m_x*b.m_x - a.m_y*b.m_z - a.m_z*b.m_y c.m_y = a.m_x*b.m_y + a.m_y*b.m_x - a.m_z*b.m_z c.m_z = a.m_x*b.m_z - a.m_y*b.m_y + a.m_z*b.m_x c.m_w = 0 endfunc default: title = "3D Vector Methods" int param v_3D caption = "Version (3D Vector Methods)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_3D < 100 endparam } ;------------------------------------------- ; Mobius Transforms ;------------------------------------------- class Mobius { $define debug ; Creates Mobius transformations in a matrix format.
;

; T(z) = (az+b)/(cz+d)
;

; T is a Mobius Transformation were z, a, b, c and d are complex ; numbers. T is typically represented in normalized matrix form: ;

; T = | a b |
; | c d |
;

; T is normalized if the determinant of ad-bc = 1
;

; A Mobius Transformation can be viewed as a composition of translation, ; scaling and inversion. ;

; The Trace of T is TrT = a+ d public: ; Mobius constructor for T(a, b, c, d) ; @param a = a value ; @param b = b value ; @param c = c value ; @param d = d value func Mobius(complex a, complex b, complex c, complex d) m_a = a m_b = b m_c = c m_d = d m_TrT = m_a + m_d endfunc ; Circle to Mobius func CircToMob(Sphere s) ; Lines and Circles can be represented as Mobius Transforms. Lines and ; Circles are equivalent in Riemann space. For convenience circles are ; represented as sphere objects ; method from Curtis McMullen complex unit = 0 complex im = (0,1) if s.frad <= 0 ; matrix of line unit = cos(-#pi*s.frad) + flip(sin(-#pi*s.frad)) m_a = im*unit m_b = im*(conj(unit)*s.fcen-unit*conj(s.fcen)) m_c = 0 m_d = im*conj(unit) else ; matrix of circle m_a = s.fcen/s.frad m_b = s.frad-|s.fcen|/s.frad m_c = 1/s.frad m_d = -conj(s.fcen)/s.frad endif endfunc ; Mobius to Circle func MobToCirc(int level, int rgen, Sphere s) ; A Mobius Transform can be represented as a Line or Circle. In ; Reimann space a line is a circle with a negative radius. The ; 'level' and 'rgen' arguments are for the Kleinian inversion algorithms ; method from Curtis McMullen float LINEFUZZ = 1e-5 if real(m_c) < LINEFUZZ && real(m_c) > - LINEFUZZ ; matrix to line s.frad = -atan2(m_a)/#pi-1.5 s.fcen = -m_b*m_a/2 else ; matrix to circle s.fcen = m_a/m_c s.frad = cabs(1/real(m_c)) endif s.flevel = level s.fgen = rgen endfunc ; Hermitian to Circle func HermitToCirc(Circle C) ; A Hermitian matrix can be converted to a circle format. ; The method is from David Wright. In Riemann space both circles and ; lines are equivalent. The code handles both. im = (0,1) if m_a != 0 ;Hermitian is for a circle C.fcen = -m_b/m_a C.frad = sqrt(|m_b|-real(m_a)*real(m_d)) \ /cabs(m_a) else ;Hermitian is for a line C.fcen = -m_d/(2*m_c) C.frad = -atan2(im*m_b)/#pi while C.frad > 0 C.frad = C.frad-1 endwhile endif endfunc ; Circle to Hermitian func CircToHermit(Mobius H, Circle C) ; A circle can be converted to a Hermitian matrix. ; The method is from David Wright. In Riemann space both circles and ; lines are equivalent. The code handles both. float vector = tan(-#pi*C.frad) complex im = (0,1) if C.frad > 0 ;calculation for circle H.m_a = 1 H.m_b = -C.fcen H.m_c = conj(H.m_b) H.m_d = |C.fcen|-C.frad^2 else ;calculation for line H.m_a = 0 H.m_b = vector+im H.m_c = conj(H.m_b) H.m_d = -2*imag(C.fcen)*(1+vector^2) endif endfunc ; Mobius on Circle func MobOnCirc(Circle C) ; Applies a Mobius transform to a circle ; The method is from David Wright. In Riemann space both circles and ; lines are equivalent. The code handles both. Mobius I = new Mobius(m_d, -m_b, -m_c, m_a) Mobius CT = new Mobius(conj(I.m_a),conj(I.m_c),conj(I.m_b),conj(I.m_d)) Mobius H = new Mobius(0,0,0,0) this.CircToHermit(H,C) complex temp1 = H.m_a, complex temp2 = H.m_b complex temp3 = H.m_c, complex temp4 = H.m_d H.m_a = temp1*I.m_a+temp2*I.m_c, H.m_b = temp1*I.m_b+temp2*I.m_d H.m_c = temp3*I.m_a+temp4*I.m_c, H.m_d = temp3*I.m_b+temp4*I.m_d temp1 = H.m_a, temp2 = H.m_b temp3 = H.m_c, temp4 = H.m_d H.m_a = CT.m_a*temp1+CT.m_b*temp3, H.m_b = CT.m_a*temp2+CT.m_b*temp4 H.m_c = CT.m_c*temp1+CT.m_d*temp3, H.m_d = CT.m_c*temp2+CT.m_d*temp4 H.HermitToCirc(C) endfunc ; Normalize Mobius func Normalize(Mobius T) complex det = T.m_a*T.m_d-T.m_b*T.m_c det = 1/sqrt(det) T.m_a = m_a*det T.m_b = m_b*det T.m_c = m_c*det T.m_d = m_d*det endfunc ; Invert Mobius func Invert(Mobius T) complex det = m_a*m_d-m_b*m_c T.m_a = m_d T.m_b = -m_b T.m_c = -m_c T.m_d = m_a if real(det) <= 0 T.m_a = -conj(T.m_a) T.m_b = -conj(T.m_b) T.m_c = -conj(T.m_c) T.m_d = -conj(T.m_d) endif endfunc ; Multiplication func Mult(Mobius T1, Mobius T2) ; T2 = T * T1 This does not commute. ; complex det = m_a*m_d-m_b*m_c if real(det) <= 0 T2.m_a = m_a*conj(T1.m_a)+m_b*conj(T1.m_c) T2.m_b = m_a*conj(T1.m_b)+m_b*conj(T1.m_d) T2.m_c = m_c*conj(T1.m_a)+m_d*conj(T1.m_c) T2.m_d = m_c*conj(T1.m_b)+m_d*conj(T1.m_d) else T2.m_a = m_a*T1.m_a+m_b*T1.m_c T2.m_b = m_a*T1.m_b+m_b*T1.m_d T2.m_c = m_c*T1.m_a+m_d*T1.m_c T2.m_d = m_c*T1.m_b+m_d*T1.m_d endif endfunc ; Conjugate func MConj(Mobius T1,Mobius T2) ; T2 = T * T1 * inverse(T) Mobius igen = new Mobius(0,0,0,0) ; Inverse of T this.Invert(igen) Mobius prod1 = new Mobius(0,0,0,0) this.Mult(T1,prod1) prod1.Mult(igen,T2) endfunc ; Mobius Trace complex func Trace() return m_a + m_d endfunc complex m_a complex m_b complex m_c complex m_d complex m_TrT default: title = "Mobius Methods" int param v_mobius caption = "Version (Mobius Methods)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_mobius < 101 endparam } class MobiusArray(Array) { ; class for Mobius Transformation arrays public: import "common.ulb" ; Constructor for Mobius arrays ; @param plength = sets the size of the array func MobiusArray(int plength) setLength(m_T, plength) endfunc ; Get array length int func GetArrayLength() return length(m_T) endfunc ; Set array length func SetArrayLength(int plength) setLength(m_T, plength) endfunc ; Copy array func Copy(MobiusArray &dest) int l = this.GetArrayLength() if (dest == 0) dest = new MobiusArray(l) else dest.SetArrayLength(l) endif int j = 0 while (j < l) dest.m_T[j] = m_T[j] j = j + 1 endwhile endfunc Mobius m_T[] default: title = "Mobius Array" int param v_mobiusarray caption = "Version (Mobius Array)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_mobiusarray < 100 endparam } ;------------------------------------------- ; 3D Rotations ;------------------------------------------- Class Rot { import "common.ulb" static func Rotate(float &x, float &y, float &z, float angle, Vector a) float rmatrix[3,3] float cangle = cos(angle*#pi/180) float sangle = sin(angle*#pi/180) rmatrix[0,0] = cangle+a.m_x^2*(1-cangle) rmatrix[1,0] = a.m_x*a.m_y*(1-cangle)-a.m_z*sangle rmatrix[2,0] = a.m_x*a.m_z*(1-cangle)+a.m_y*sangle rmatrix[0,1] = a.m_x*a.m_y*(1-cangle)+a.m_z*sangle rmatrix[1,1] = cangle+a.m_y^2*(1-cangle) rmatrix[2,1] = a.m_y*a.m_z*(1-cangle)-a.m_x*sangle rmatrix[0,2] = a.m_x*a.m_z*(1-cangle)-a.m_y*sangle rmatrix[1,2] = a.m_y*a.m_z*(1-cangle)+a.m_x*sangle rmatrix[2,2] = cangle+a.m_z^2*(1-cangle) float tempx = x float tempy = y x = rmatrix[0,0]*x + rmatrix[1,0]*y + rmatrix[2,0]*z y = rmatrix[0,1]*tempx + rmatrix[1,1]*y + rmatrix[2,1]*z z = rmatrix[0,2]*tempx + rmatrix[1,2]*tempy + rmatrix[2,2]*z endfunc static func RotateX(float &x, float &y, float &z, float angle) float rmatrix[3,3] float cangle = cos(angle*#pi/180) float sangle = sin(angle*#pi/180) rmatrix[0,0] = 1 rmatrix[1,0] = 0 rmatrix[2,0] = 0 rmatrix[0,1] = 0 rmatrix[1,1] = cangle rmatrix[2,1] = -sangle rmatrix[0,2] = 0 rmatrix[1,2] = sangle rmatrix[2,2] = cangle float tempx = x float tempy = y x = rmatrix[0,0]*x + rmatrix[1,0]*y + rmatrix[2,0]*z y = rmatrix[0,1]*tempx + rmatrix[1,1]*y + rmatrix[2,1]*z z = rmatrix[0,2]*tempx + rmatrix[1,2]*tempy + rmatrix[2,2]*z endfunc static func RotateY(float &x, float &y, float &z, float angle) float rmatrix[3,3] float cangle = cos(angle*#pi/180) float sangle = sin(angle*#pi/180) rmatrix[0,0] = cangle rmatrix[1,0] = 0 rmatrix[2,0] = sangle rmatrix[0,1] = 0 rmatrix[1,1] = 1 rmatrix[2,1] = 0 rmatrix[0,2] = -sangle rmatrix[1,2] = 0 rmatrix[2,2] = cangle float tempx = x float tempy = y x = rmatrix[0,0]*x + rmatrix[1,0]*y + rmatrix[2,0]*z y = rmatrix[0,1]*tempx + rmatrix[1,1]*y + rmatrix[2,1]*z z = rmatrix[0,2]*tempx + rmatrix[1,2]*tempy + rmatrix[2,2]*z endfunc static func RotateZ(float &x, float &y, float &z, float angle) float rmatrix[3,3] float cangle = cos(angle*#pi/180) float sangle = sin(angle*#pi/180) rmatrix[0,0] = cangle rmatrix[1,0] = -sangle rmatrix[2,0] = 0 rmatrix[0,1] = sangle rmatrix[1,1] = cangle rmatrix[2,1] = 0 rmatrix[0,2] = 0 rmatrix[1,2] = 0 rmatrix[2,2] = 1 float tempx = x float tempy = y x = rmatrix[0,0]*x + rmatrix[1,0]*y + rmatrix[2,0]*z y = rmatrix[0,1]*tempx + rmatrix[1,1]*y + rmatrix[2,1]*z z = rmatrix[0,2]*tempx + rmatrix[1,2]*tempy + rmatrix[2,2]*z endfunc ; rotations for Turtle orientation using the the Abelson diSessa paradigm. ; The turtle is oriented using three vectors H (heading), L (left) and U (up). ; H x L = U static func RotateH(float &x, float &y, float &z, float angle) float rmatrix[3,3] float cangle = cos(angle*#pi/180) float sangle = sin(angle*#pi/180) rmatrix[0,0] = 1 rmatrix[1,0] = 0 rmatrix[2,0] = 0 rmatrix[0,1] = 0 rmatrix[1,1] = cangle rmatrix[2,1] = -sangle rmatrix[0,2] = 0 rmatrix[1,2] = sangle rmatrix[2,2] = cangle float tempx = x float tempy = y x = rmatrix[0,0]*x + rmatrix[1,0]*y + rmatrix[2,0]*z y = rmatrix[0,1]*tempx + rmatrix[1,1]*y + rmatrix[2,1]*z z = rmatrix[0,2]*tempx + rmatrix[1,2]*tempy + rmatrix[2,2]*z endfunc static func RotateL(float &x, float &y, float &z, float angle) float rmatrix[3,3] float cangle = cos(angle*#pi/180) float sangle = sin(angle*#pi/180) rmatrix[0,0] = cangle rmatrix[1,0] = 0 rmatrix[2,0] = -sangle rmatrix[0,1] = 0 rmatrix[1,1] = 1 rmatrix[2,1] = 0 rmatrix[0,2] = sangle rmatrix[1,2] = 0 rmatrix[2,2] = cangle float tempx = x float tempy = y x = rmatrix[0,0]*x + rmatrix[1,0]*y + rmatrix[2,0]*z y = rmatrix[0,1]*tempx + rmatrix[1,1]*y + rmatrix[2,1]*z z = rmatrix[0,2]*tempx + rmatrix[1,2]*tempy + rmatrix[2,2]*z endfunc static func RotateU(float &x, float &y, float &z, float angle) float rmatrix[3,3] float cangle = cos(angle*#pi/180) float sangle = sin(angle*#pi/180) rmatrix[0,0] = cangle rmatrix[1,0] = sangle rmatrix[2,0] = 0 rmatrix[0,1] = -sangle rmatrix[1,1] = cangle rmatrix[2,1] = 0 rmatrix[0,2] = 0 rmatrix[1,2] = 0 rmatrix[2,2] = 1 float tempx = x float tempy = y x = rmatrix[0,0]*x + rmatrix[1,0]*y + rmatrix[2,0]*z y = rmatrix[0,1]*tempx + rmatrix[1,1]*y + rmatrix[2,1]*z z = rmatrix[0,2]*tempx + rmatrix[1,2]*tempy + rmatrix[2,2]*z endfunc } ;------------------------------------------- ; 5. 3D Object classes ;------------------------------------------- class Point { ; class for creating 3D point objects public: ; Point constructor for (x, y, z) ; @param x = x value ; @param y = y value ; @param z = z value func Point(float x, float y, float z) fx = x fy = y fz = z endfunc float fx float fy float fz default: title = "Point" int param v_point caption = "Version (Point)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_point < 100 endparam } class PointArray(Array) { ; class for creating 3D point object arrays public: import "common.ulb" ; Constructor for plane arrays ; @param plength = sets the size of the array func PointArray(int plength) setLength(pt, plength) endfunc ; Get array length int func GetArrayLength() return length(pt) endfunc ; Set array length func SetArrayLength(int plength) setLength(pt, plength) endfunc ; Copy array func Copy(PointArray &dest) int l = this.GetArrayLength() if (dest == 0) dest = new PointArray(l) else dest.SetArrayLength(l) endif int j = 0 while (j < l) dest.pt[j] = pt[j] j = j + 1 endwhile endfunc Point pt[] default: title = "Point Array" int param v_pointarray caption = "Version (Point Array)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_pointarray < 100 endparam } class Line { ; class for creating line objects public: import "common.ulb" ; Line constructor for a line defined by 2 points (x1, y1, z1, x2, y2, z2) ; @param x1 = x1 value ; @param y1 = y1 value ; @param z1 = z1 value ; @param x2 = x2 value ; @param y2 = y2 value ; @param z2 = z2 value ; @param vis = line visibility ; @param lcol = line color gradient ; @param dcol = line color direct color ; @param depth = recursion depth ; @param poly = is polygon ; @param lwidth = line width ; @param brratio = branching thickness ratio func Line(float x1, float y1, float z1, float x2, float y2, float z2) fx1 = x1 fy1 = y1 fz1 = z1 fx2 = x2 fy2 = y2 fz2 = z2 llength = sqrt((fx2-fx1)^2 + (fy2-fy1)^2 + (fz2-fz1)^2) vis = true lcol = 0.5 depth = 0 lwidth = 1 dcol = rgba(1,1,1,1) poly = false brratio = 1 sign = 1 jump = false endfunc func SetLength() llength = sqrt((fx2-fx1)^2 + (fy2-fy1)^2 + (fz2-fz1)^2) endfunc func SetVis(bool svis) vis = svis endfunc func SetJump(bool sjump) jump = sjump endfunc func SetGradCol(float gradcol) lcol = gradcol endfunc func SetWidth(float width) lwidth = width endfunc func SetDirectColor(color dcolor) dcol = dcolor endfunc func SetDepth(int j) depth = j endfunc func SetPoly(bool ispoly) poly = ispoly endfunc func SetBranchRatio(float branchratio) brratio = branchratio endfunc func SetSign(float sign) sign = sign/abs(sign) endfunc func GetVector(Vector &vec) float x2 = fx2-fx1 float y2 = fy2-fy1 float z2 = fz2-fz1 vec = new Vector(x2,y2,z2,0) vec.Normalize(vec) endfunc func Resize(float setsize) fx1 = setsize*fx1 fy1 = setsize*fy1 fz1 = setsize*fz1 fx2 = setsize*fx2 fy2 = setsize*fy2 fz2 = setsize*fz2 llength = sqrt((fx2-fx1)^2 + (fy2-fy1)^2 + (fz2-fz1)^2) endfunc ; rotate around the point x1, y1, z1 func Rotate(float theta) float x1 = fx1-x1 float y1 = fy1-y1 float z1 = fz1-z1 float x2 = fx2-x1 float y2 = fy2-y1 float z2 = fz2-z1 vector vec = new Vector(x2,y2,z2,0) rot.rotate(x2,y2,z2,theta,vec) fx2 = x2+x1 fy2 = y2+y1 fz2 = z2+z1 endfunc float llength float lwidth float fx1 float fy1 float fz1 float fx2 float fy2 float fz2 bool vis float lcol color dcol int depth bool poly float brratio float sign bool jump default: title = "Line" int param v_line caption = "Version (Line)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_line < 100 endparam } class LineArray(Array) { ; class for creating 3D point object arrays public: import "common.ulb" ; Constructor for line arrays ; @param plength = sets the size of the array func LineArray(int plength) setLength(line, plength) endfunc ; Get array length int func GetArrayLength() return length(line) endfunc ; Set array length func SetArrayLength(int plength) setLength(line, plength) endfunc ; Copy array func Copy(LineArray &dest) int l = this.GetArrayLength() if (dest == 0) dest = new LineArray(l) else dest.SetArrayLength(l) endif int j = 0 while (j < l) dest.line[j] = line[j] j = j + 1 endwhile endfunc Line line[] default: title = "LineArray" int param v_linearray caption = "Version (Line Array)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_linearray < 100 endparam } class Plane { ; class for creating plane objects public: ; Plane constructor for Ax + By + C = 0 ; @param A = A value ; @param B = B value ; @param C = C value ; @param D = D value func Plane(float A, float B, float C, float D) float norm = sqrt(A^2+B^2+C^2) pnx = A/norm pny = B/norm pnz = C/norm pspot = D/norm pa = A pb = B pc = C pd = D endfunc ; Is a point on the plane bool func OnPlane(float x, float y, float z, float tol) bool opl = false if (pa*x+pb*y+pc*z+pd < tol) && (pa*x+pb*y+pc*z+pd > -tol) opl = true endif return opl endfunc float pnx float pny float pnz float pspot float pa float pb float pc float pd default: title = "Plane" int param v_plane caption = "Version (Plane)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_plane < 100 endparam } class PlaneArray(Array) { ; class for creating plane object arrays public: import "common.ulb" ; Constructor for plane arrays. func PlaneArray(int plength) setLength(pl, plength) endfunc ; Get array length int func GetArrayLength() return length(pl) endfunc ; Set array length func SetArrayLength(int plength) setLength(pl, plength) endfunc ; Copy array func Copy(PlaneArray &dest) int l = this.GetArrayLength() if (dest == 0) dest = new PlaneArray(l) else dest.SetArrayLength(l) endif int j = 0 while (j < l) dest.pl[j] = pl[j] j = j + 1 endwhile endfunc Plane pl[] default: title = "Plane Array" int param v_planearray caption = "Version (Plane Array)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_planearray < 100 endparam } class Triangle { ; class for creating triangle objects public: import "Common.ulb" ; Triangle constructor for (x1, y1, z1, x2, y2, z2, x3, y3, z3) ; @param x1 = x1 value ; @param y1 = y1 value ; @param z1 = z1 value ; @param x2 = x2 value ; @param y2 = y2 value ; @param z2 = z2 value ; @param x2 = x3 value ; @param y2 = y3 value ; @param z2 = z3 value func Triangle(float x1, float y1, float z1, float x2, float y2, float z2, \ float x3, float y3, float z3) fx1 = x1 fy1 = y1 fz1 = z1 fx2 = x2 fy2 = y2 fz2 = z2 fx3 = x3 fy3 = y3 fz3 = z3 r_fz1 = z1 r_fz2 = z2 r_fz3 = z3 t_norm = new Vector(0,0,0,0) Norm() t_norm.Normalize(t_norm) ; P*N + pspot = 0 this is the equation for the plane of the triangle pspot = -(t_norm.m_x*fx1+t_norm.m_y*fy1+t_norm.m_z*fz1) endfunc ; used to re-initialize the triangle parameters func Init(float x1, float y1, float z1, float x2, float y2, float z2, \ float x3, float y3, float z3) fx1 = x1 fy1 = y1 fz1 = z1 fx2 = x2 fy2 = y2 fz2 = z2 fx3 = x3 fy3 = y3 fz3 = z3 Norm() t_norm.Normalize(t_norm) ; P*N + pspot = 0 this is the equation for the plane of the triangle pspot = -(t_norm.m_x*fx1+t_norm.m_y*fy1+t_norm.m_z*fz1) xy_ave = (fx1+fx2+fx3)/3 + flip((fy1+fy2+fy3)/3) z_ave = (fz1+fz2+fz3)/3 endfunc ; 1 -> 2 ->3 must be counterclockwise func Norm() Vector V1 = new Vector(fx1-fx2, fy1-fy2, fz1-fz2, 0) Vector V2 = new Vector(fx3-fx2, fy3-fy2, fz3-fz2, 0) V1.Cross(V2, t_norm) t_norm.m_w = 0 endfunc ; determine vector from camera to center of triangle float fx1 float fy1 float fz1 float fx2 float fy2 float fz2 float fx3 float fy3 float fz3 float r_fz1 float r_fz2 float r_fz3 Vector t_norm float pspot complex xy_ave float z_ave default: title = "Triangle" int param v_triangle caption = "Version (Triangle)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_triangle < 100 endparam } class TriangleArray(Array) { ; class for creating 3D Triangle object arrays public: import "common.ulb" ; Constructor for triangle arrays ; @param plength = sets the size of the array func TriangleArray(int plength) setLength(tr, plength) endfunc ; Get array length int func GetArrayLength() return length(tr) endfunc ; Set array length func SetArrayLength(int plength) setLength(tr, plength) endfunc ; Copy array func Copy(TriangleArray &dest) int l = this.GetArrayLength() if (dest == 0) dest = new TriangleArray(l) else dest.SetArrayLength(l) endif int j = 0 while (j < l) dest.tr[j] = tr[j] j = j + 1 endwhile endfunc Triangle tr[] default: title = "Triangle Array" int param v_Trianglearray caption = "Version (Triangle Array)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Trianglearray < 100 endparam } class Sphere { ; class for creating sphere objects
;

; The sphere object contains arguments for recursion level and ; generator sphere identifier for facilitate use with Sphere ; Inversions public: ; Sphere constructor ; @param center = (x,y) coordinates of the sphere center ; @param height = z coordinate of sphere center ; @param radius = sphere radius ; @param level = recursion level of the sphere ; @param generator = index of generator sphere func Sphere(complex center, float height, float radius, int level, int generator) fCen = center fRad = radius fZ = height fLevel = level fGen = generator endfunc int fLevel complex fCen float fRad float fZ int fGen default: title = "Sphere" int param v_sphere caption = "Version (Sphere)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_sphere < 100 endparam } class SphereArray(Array) { ; class for sphere arrays public: import "common.ulb" ; Sphere array constructor ; @param plength = size of the sphere array func SphereArray(int plength) setLength(sph, plength) endfunc ; Get array length int func GetArrayLength() return length(sph) endfunc ; Set array length func SetArrayLength(int plength) setLength(sph, plength) endfunc ; Copy Array ; @param dest = SphereArray object to copy all values into ; previous contents of dest will be discarded. func Copy(SphereArray &dest) int l = this.GetArrayLength() if (dest == 0) dest = new SphereArray(l) else dest.SetArrayLength(l) endif int j = 0 while (j < l) dest.sph[j] = sph[j] j = j + 1 endwhile endfunc Sphere sph[] default: title = "Sphere Array" int param v_spherearray caption = "Version (Sphere Array)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_spherearray < 100 endparam } class Circle { ; class for creating circle objects
;

public: ; Circle constructor ; @param center = (x,y) coordinates of the sphere center ; @param radius = sphere radius func Circle(complex center, float radius) fCen = center fRad = radius endfunc complex fCen float fRad default: title = "Circle" int param v_circle caption = "Version (Circle)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_circle < 100 endparam } class CircleArray(Array) { ; class for circle arrays public: import "common.ulb" ; Circle array constructor ; @param plength = size of the circle array func CircleArray(int plength) setLength(cir, plength) endfunc ; Get array length int func GetArrayLength() return length(cir) endfunc ; Set array length func SetArrayLength(int plength) setLength(cir, plength) endfunc ; Copy Array ; @param dest = CircleArray object to copy all values into ; previous contents of dest will be discarded. func Copy(CircleArray &dest) int l = this.GetArrayLength() if (dest == 0) dest = new CircleArray(l) else dest.SetArrayLength(l) endif int j = 0 while (j < l) dest.cir[j] = cir[j] j = j + 1 endwhile endfunc Circle cir[] default: title = "Circle Array" int param v_circlearray caption = "Version (Circle Array)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_circlearray < 100 endparam } ;-------------------------------------------- ; 3D Inversion Classes ;-------------------------------------------- Class InvertSphere(common.ulb:Generic) { ; sphere inversions starting with a tetrahedral geometery for the base set
; this is the base class
; it contains methods for
; 1. sphere initialization for base and generator sets
; 2. sphere inversion
; 3. recursion
; 4. heapsort and duplicate removal
; $define debug public: import "common.ulb" ; constructor for sphere inversions with a tetrahedral geometry func InvertSphere(Generic pparent) ; ; dynamically allocate the maximum number of spheres ; s = new SphereArray(50000000) flength = 50000000, fscle = 3 + sqrt(6), fks = 4, fk = fks, fii = 5, fjj = 5 rlevel = 5, fminsphere = @minsphere, mlevel = @MaxLevel, fbaserad = sqrt(2) thresh = fminsphere/1000, scale = 0.3, reflect = @reflect, xrot = (0,1)^(@xang/90), yrot = (0,1)^(@yang/90), zrot = (0,1)^(#angle*2/#pi), sflag = true crad = 0, circles = false, showc = true, lace = false, cir3 = false zsort = @zsort initSpheres() endfunc ; Initializes base and generator spheres func InitSpheres() complex Fc[10] float Fz[10] float Fr[10] complex temp = 0 int i = 0 while i < 4 Fc[i] = (1,1)*exp(flip(i)*#pi/2)*fscle Fr[i] = (fscle-1)*2 if i%2 == 0 Fz[i] = -fscle else Fz[i] = fscle endif i = i + 1 endwhile Fc[i] = (0,0) Fr[i] = 1 Fz[i] = 0 i = i + 1 while i < 9 Fc[i] = (1,1)*exp(flip(i-5)*#pi/2) Fr[i] = fbaserad if i%2 == 0 Fz[i] = -1 else Fz[i] = 1 endif i = i + 1 endwhile Fc[i] = (0,0) Fr[i] = sqrt(2)+sqrt(3) Fz[i] = 0 ; scale and translate the spheres to screen dimensions i = 0 repeat if reflect Fc[i] = -conj(Fc[i]) else Fc[i] = Fc[i] endif ; Z axis rotation Fc[i] = Fc[i]*zrot ; Y axis rotation temp = real(Fc[i]) + flip(Fz[i]) temp = temp*yrot Fc[i] = real(temp) + flip(imag(Fc[i])) Fz[i] = imag(temp) ; X axis rotation temp = imag(Fc[i]) + flip(Fz[i]) temp = temp*xrot Fc[i] = real(Fc[i]) + flip(real(temp)) Fz[i] = imag(temp) ; scaling Fc[i] = Fc[i]*#magn*scale Fz[i] = Fz[i]*#magn*scale if i > 4 Fr[i] = Fr[i]*#magn*scale*@bradadj else Fr[i] = Fr[i]*#magn*scale*@radadj endif i = i+1 until i == 10 ; declare the generator spheres ; tetrahedron i = 0 while i <= 4 fg[i] = new Sphere(Fc[i],Fz[i],Fr[i],0,i) i = i + 1 endwhile ; ; declare the base Spheres ; tetrahedron while i <= 9 fb[i-5] = new Sphere(Fc[i],Fz[i],Fr[i],0,i-5) i = i + 1 endwhile bradius = fb[0].frad i = 0 while i < 4 s.sph[i] = fb[i] i = i + 1 endwhile endfunc ; Inverts a sphere ; @param target = sphere to be inverted ; @param inverter = sphere used for the inversion ; @param level = recursion level ; @param gen = index of generator (inverter) sphere Sphere func Inverse(Sphere target, Sphere inverter, int level, int gen) rgen = gen if target != 0 && inverter != 0 float ar = inverter.frad float br = target.frad complex a = inverter.fcen complex b = target.fcen float ha = inverter.fz float hb = target.fz float temp = ar^2/(|a-b|+(ha-hb)^2-br^2) float rad = abs(temp*br) if lace && circles && cir3 rad = temp*br endif complex cen = temp*(b-a) + a float z = temp*(hb-ha) + ha return new Sphere(cen,z,rad,level,rgen) else return new Sphere((0,0),0,0,0,0) endif endfunc ; Top level recursion function - calls the function recurse2 func Recurse() if mlevel > 0 int level = 0 level = level + 1 int ii = 0 int jj = 0 fk = fks while ii < fii while jj < fjj && fk < flength if (|fb[jj].fcen-fg[ii].fcen|+ (fb[jj].fz-fg[ii].fz)^2)> \ (fb[jj].frad+fg[ii].frad)^2 s.sph[fk] = Inverse(fb[jj],fg[ii],level,jj) fk = fk + 1 endif jj = jj + 1 endwhile ii = ii + 1 jj = 0 endwhile ; ; The exeception to the rule of target and generator are external to each other ; s.sph[fk] = Inverse(fb[fjj-1],fg[fii-1],level,fjj-1) if circles crad = s.sph[fk].frad endif fk = fk + 1 int j = fjj-1 if level < mlevel while j < fjj-1 + rlevel recurse2(level,j) j = j + 1 endwhile endif if sflag heapsort(s,fk) vanquish(s,fk) endif endif if @zsort heapsortz(s,fk) endif endfunc ; Function for recursive sphere inversion ; @param level = recursion level ; @param tarvalue = index of new sphere func recurse2(int level, int tarvalue) level = level + 1 int k = 0 while k < fii && fk < flength if lace && circles && cir3 if (|s.sph[tarvalue].fcen-fg[k].fcen| + \ (s.sph[tarvalue].fz-fg[k].fz)^2)> \ (s.sph[tarvalue].frad+fg[k].frad)^2 && s.sph[tarvalue].frad > \ fminSphere s.sph[fk] = Inverse(s.sph[tarvalue],fg[k],level,s.sph[tarvalue].fgen) fk = fk + 1 if level < mlevel recurse2(level,fk-1) endif endif else if (|s.sph[tarvalue].fcen-fg[k].fcen| + \ (s.sph[tarvalue].fz-fg[k].fz)^2)> \ (s.sph[tarvalue].frad+fg[k].frad)^2 && abs(s.sph[tarvalue].frad) > \ fminSphere s.sph[fk] = Inverse(s.sph[tarvalue],fg[k],level,s.sph[tarvalue].fgen) fk = fk + 1 if level < mlevel recurse2(level,fk-1) endif endif endif k = k + 1 endwhile endfunc ; Find the overall bounding volume for a set of spheres ; @param sa = sphere array to be bounded ; @param count = index range to be bounded ; @param xmin = min x boundary ; @param ymin = min y boundary ; @param zmin = min z boundary ; @param xmax = max x boundary ; @param ymax = max y boundary ; @param zmax = max z boundary func findbound(SphereArray sa, int count, float &xmin, float &ymin, \ float &zmin, float &xmax, float &ymax, float &zmax) xmin = 1e10 ymin = 1e10 zmin = 1e10 xmax = -1e10 xmax = -1e10 xmax = -1e10 float temp = 0 int i = 0 while i < count temp = real(sa.sph[i].fcen) - abs(sa.sph[i].frad) if temp < xmin xmin = temp endif temp = real(sa.sph[i].fcen) + abs(sa.sph[i].frad) if temp > xmax xmax = temp endif temp = imag(sa.sph[i].fcen) - abs(sa.sph[i].frad) if temp < ymin ymin = temp endif temp = imag(sa.sph[i].fcen) + abs(sa.sph[i].frad) if temp > ymax ymax = temp endif temp = sa.sph[i].fz - abs(sa.sph[i].frad) if temp < zmin zmin = temp endif temp = sa.sph[i].fz + abs(sa.sph[i].frad) if temp > zmax zmax = temp endif i = i + 1 endwhile endfunc ; Sort spheres in preparation for duplicate removal ; @param sa = sphere array to be sorted ; @param count = index range to be sorted func heapsort(SphereArray sa,int count) heapify(sa, count) int end = count-1 while end > 0 swap(sa,end,0) end = end-1 siftDown(sa, 0, end) endwhile endfunc ; Sort spheres by z value. func heapsortz(SphereArray sa,int count) heapifyz(sa, count) int end = count-1 while end > 0 swap(sa,end,0) end = end-1 siftDownz(sa, 0, end) endwhile endfunc ; A helper function for heapsort ; @param sa = sphere array to be sorted ; @param count = index range to be sorted func heapify(SphereArray sa,int count) int start = round((count-1)/2) while start >= 0 siftDown(sa, start, count-1) start = start-1 endwhile endfunc ; A helper function for heapsortz func heapifyz(SphereArray sa,int count) int start = round((count-1)/2) while start >= 0 siftDownz(sa, start, count-1) start = start-1 endwhile endfunc ; A helper function for heapsort ; @param sa = sphere array to be sorted ; @param start = start of the index index range ; @param end = end of the index range func siftdown(SphereArray sa, int start,int end) int root = start, float dx = 0, float dy = 0, float dz = 0, float dr = 0 int c = 0 while (root*2+1) <= end int child = root*2+1 if sa.sph[child] != 0 && sa.sph[child+1] != 0 dx = real(sa.sph[child].fcen) - real(sa.sph[child + 1].fcen) dy = imag(sa.sph[child].fcen) - imag(sa.sph[child + 1].fcen) dz = sa.sph[child].fz - sa.sph[child + 1].fz dr = sa.sph[child].frad - sa.sph[child + 1].frad else dx = 0 dy = 0 dz = 0 dr = 0 endif if child < end if dr < -thresh c = -1 elseif dr > thresh c = 1 elseif dy < -thresh c = -1 elseif dy > thresh c = 1 elseif dz < -thresh c = -1 elseif dz > thresh c = 1 elseif dx < -thresh c = -1 elseif dx > thresh c = 1 else c = 0 endif if c < 0 child = child+1 endif endif if sa.sph[child] != 0 && sa.sph[root] != 0 dx = real(sa.sph[root].fcen) - real(sa.sph[child].fcen) dy = imag(sa.sph[root].fcen) - imag(sa.sph[child].fcen) dz = sa.sph[root].fz - sa.sph[child].fz dr = sa.sph[root].frad - sa.sph[child].frad else dx = 0 dy = 0 dz = 0 dr = 0 endif if dr < -thresh c = -1 elseif dr > thresh c = 1 elseif dy < -thresh c = -1 elseif dy > thresh c = 1 elseif dz < -thresh c = -1 elseif dz > thresh c = 1 elseif dx < -thresh c = -1 elseif dx > thresh c = 1 else c = 0 endif if c < 0 swap(s,root,child) root = child else return endif endwhile endfunc ; A helper function for heapsortz func siftdownz(SphereArray sa, int start,int end) int root = start, float dz = 0 int c = 0 while (root*2+1) < end int child = root*2+1 dz = sa.sph[child].fz - sa.sph[child+1].fz if child < end if dz < -thresh c = -1 elseif dz > thresh c = 1 else c = 0 endif if c > 0 child = child+1 endif endif dz = sa.sph[root].fz - sa.sph[child].fz if dz < -thresh c = -1 elseif dz > thresh c = 1 else c = 0 endif if c > 0 swap(s,root,child) root = child else return endif endwhile endfunc ; A helper function for heapsort ; @param i = index of the first sphere to be swapped ; @param j = index of the second sphere to be swapped func swap(SphereArray sa, int i, int j) Sphere temp = sa.sph[j] sa.sph[j] = sa.sph[i] sa.sph[i] = temp endfunc ; Removes duplicates from a sorted array ; @param sa = sphere array for duplicate element removal ; @param count = index range for duplicate removal ;------------------------------------------------ func vanquish(SphereArray sa, int count) float dx = 0, float dy = 0, float dz = 0, float dr = 0, int c = 0 int ir = 1, int l = 0 while ir < count if sa.sph[ir] != 0 && sa.sph[ir-1] != 0 dx = real(sa.sph[ir].fcen) - real(sa.sph[ir-1].fcen) dy = imag(sa.sph[ir].fcen) - imag(sa.sph[ir-1].fcen) dz = sa.sph[ir].fz - sa.sph[ir-1].fz dr = sa.sph[ir].frad - sa.sph[ir-1].frad else dx = 0 dy = 0 dz = 0 dr = 0 endif if dr < -thresh c = -1 elseif dr > thresh c = 1 elseif dy < -thresh c = -1 elseif dy > thresh c = 1 elseif dz < -thresh c = -1 elseif dz > thresh c = 1 elseif dx < -thresh c = -1 elseif dx > thresh c = 1 else c = 0 endif if c == 0 ir = ir + 1 else sa.sph[l] = sa.sph[ir] ir = ir +1 l = l + 1 endif endwhile fk = l endfunc Sphere fg[14] float fscle int flength float fminSphere Sphere fb[22] int fk int rgen int mlevel int fks int fii int fjj int rlevel float fbaserad float fp float fip spherearray s float thresh float scale bool reflect complex xrot complex yrot complex zrot float bradius bool sflag float crad bool circles bool showc bool lace bool cir3 bool zsort float rcen default: title = "Tetrahedron" int param v_tetrahedron caption = "Version (Tetrahedron)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_tetrahedron < 100 endparam heading text = "Do not use 'Sort by depth' with reflections, refractions or \ transformations." endheading bool param zsort caption = "Sort by depth" default = false hint = "Allows intersection test for simple raytracing to terminate \ at first hit." endparam float param minsphere caption = "Min sphere size" default = 0.01 min = 0.00001 endparam int param maxLevel caption = "Recursion level" default = 2 min = 0 max = 1000 endparam float param radadj caption = "Gen Rad adj" default = 1.0 endparam float param bradadj caption = "Base Rad adj" default = 1.0 endparam bool param reflect caption = "Reflect Object" default = false endparam float param xang caption = "X Axis Rotation" default = 0.0 endparam float param yang caption = "Y Axis Rotation" default = 0.0 endparam } Class InvertCube(InvertSphere) { ; sphere inversions starting with a cubic geometery
; this is a child of InvertSphere public: import "common.ulb" ; constructor for sphere inversions with a cubic geometry func InvertCube(Generic pparent) InvertSphere.InvertSphere(0) fscle = 3 + sqrt(3), fbaserad = sqrt(6)+sqrt(2) scale = 0.34, fii = 7, fjj = 9, fks = 8, fk = fks, rlevel = 25 initSpheres() endfunc ; Initializes base and generator spheres func InitSpheres() complex Fc[16] float Fz[16] float Fr[16] int i = 0 complex grot = exp(flip(1)*#pi/2) while i < 4 Fc[i] = (1,0)*grot^i*fscle Fz[i] = 0 Fr[i] = fbaserad i = i + 1 endwhile Fc[4] = Fc[5] = Fc[6] = (0,0) Fz[4] = fscle Fz[5] = -fscle Fz[6] = 0 Fr[4] = Fr[5] = fbaserad Fr[6] = sqrt(2) i = 7 while i < 15 Fc[i] = (1,1)*grot^(i-7) if i < 11 Fz[i] = 1 else Fz[i] = -1 endif Fr[i] = 1 i = i + 1 endwhile Fc[i] = (0,0) Fz[i] = 0 Fr[i] = 1+sqrt(3) ; scale and translate the spheres to screen dimensions ; i = 0 repeat if reflect Fc[i] = -conj(Fc[i]) else Fc[i] = Fc[i] endif ; Z axis rotation Fc[i] = Fc[i]*zrot ; Y axis rotation temp = real(Fc[i]) + flip(Fz[i]) temp = temp*yrot Fc[i] = real(temp) + flip(imag(Fc[i])) Fz[i] = imag(temp) ; X axis rotation temp = imag(Fc[i]) + flip(Fz[i]) temp = temp*xrot Fc[i] = real(Fc[i]) + flip(real(temp)) Fz[i] = imag(temp) ; scaling Fc[i] = Fc[i]*#magn*scale Fz[i] = Fz[i]*#magn*scale if i > 6 Fr[i] = Fr[i]*#magn*scale*@bradadj else Fr[i] = Fr[i]*#magn*scale*@radadj endif i = i+1 until i == 16 ; declare the generator spheres ; ; cube i = 0 while i < 7 fg[i] = new Sphere(Fc[i],Fz[i],Fr[i],0,i) i = i + 1 endwhile ; ; declare the base Spheres ; ; cube while i < 16 fb[i-7] = new Sphere(Fc[i],Fz[i],Fr[i],0,i-7) i = i + 1 endwhile bradius = fb[0].frad i = 0 while i < 8 s.sph[i] = fb[i] i = i + 1 endwhile endfunc default: title = "Cube" int param v_cube caption = "Version (Cube)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_cube < 100 endparam } Class InvertOctahedron(InvertSphere) { ; sphere inversions starting with a octahedral geometery
; this is a child of InvertSphere public: import "common.ulb" ; constructor for sphere inversions with an octahedral geometry func InvertOctahedron(Generic pparent) InvertSphere.InvertSphere(0) fscle = 1+sqrt(2)/2, fbaserad = 1+sqrt(2), scale = 0.5, fii = 9, fjj = 7 fks = 6, fk = fks, rlevel = 25 initSpheres() endfunc ; Initializes base and generator spheres func InitSpheres() complex Fc[22] float Fz[22] float Fr[22] Fc[0] = (1,1)*fscle, Fc[1] = (-1,1)*fscle, Fc[2] = (1,-1)*fscle, Fc[3] = (1,1)*fscle Fc[4] = (-1,-1)*fscle, Fc[5] = (-1,1)*fscle, Fc[6] = (1,-1)*fscle, Fc[7] = (-1,-1)*fscle Fc[8] = (0,0), Fc[9] = (1,0), Fc[10] = (0,-1), Fc[11] = (0,0), Fc[12] = (-1,0) Fc[13] = (0,1), Fc[14] = (0,0), Fc[15] = (0,0), Fc[16] = (1,0), Fc[17] = (0,-1) Fc[18] = (0,0), Fc[19] = (-1,0), Fc[20] = (0,1), Fc[21] = (0,0) Fz[0] = fscle, Fz[1] = fscle, Fz[2] = fscle, Fz[3] = -fscle, Fz[4] = fscle Fz[5] = -fscle, Fz[6] = -fscle, Fz[7] = -fscle, Fz[8] = 0, Fz[9] = 0, Fz[10] = 0 Fz[11] = 1, Fz[12] = 0, Fz[13] = 0, Fz[14] = -1, Fz[15] = 0, Fz[16] = 0 Fz[17] = 0, Fz[18] = 1, Fz[19] = 0, Fz[20] = 0, Fz[21] = -1 Fr[0] = fbaserad, Fr[1] = fbaserad, Fr[2] = fbaserad, Fr[3] = fbaserad, Fr[4] = fbaserad Fr[5] = fbaserad, Fr[6] = fbaserad, Fr[7] = fbaserad, Fr[8] = sqrt(2)/2, Fr[9] = sqrt(2)/2 Fr[10] = sqrt(2)/2, Fr[11] = sqrt(2)/2, Fr[12] = sqrt(2)/2, Fr[13] = sqrt(2)/2 Fr[14] = sqrt(2)/2, Fr[15] = 1+sqrt(2)/2, Fr[16] = sqrt(2)/2, Fr[17] = sqrt(2)/2 Fr[18] = sqrt(2)/2, Fr[19] = sqrt(2)/2, Fr[20] = sqrt(2)/2, Fr[21] = sqrt(2)/2 int i = 0 ; scale and translate the spheres to screen dimensions ; repeat if reflect Fc[i] = -conj(Fc[i]) else Fc[i] = Fc[i] endif ; Z axis rotation Fc[i] = Fc[i]*zrot ; Y axis rotation temp = real(Fc[i]) + flip(Fz[i]) temp = temp*yrot Fc[i] = real(temp) + flip(imag(Fc[i])) Fz[i] = imag(temp) ; X axis rotation temp = imag(Fc[i]) + flip(Fz[i]) temp = temp*xrot Fc[i] = real(Fc[i]) + flip(real(temp)) Fz[i] = imag(temp) ; scaling Fc[i] = Fc[i]*#magn*scale Fz[i] = Fz[i]*#magn*scale if i > 8 Fr[i] = Fr[i]*#magn*scale*@bradadj else Fr[i] = Fr[i]*#magn*scale*@radadj endif i = i+1 until i == 22 ; declare the generator spheres ; ; octahedron fg[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0), fg[1] = new Sphere(Fc[1],Fz[1],Fr[1],0,1) fg[2] = new Sphere(Fc[2],Fz[2],Fr[2],0,2), fg[3] = new Sphere(Fc[3],Fz[3],Fr[3],0,3) fg[4] = new Sphere(Fc[4],Fz[4],Fr[4],0,4), fg[5] = new Sphere(Fc[5],Fz[5],Fr[5],0,5) fg[6] = new Sphere(Fc[6],Fz[6],Fr[6],0,6), fg[7] = new Sphere(Fc[7],Fz[7],Fr[7],0,7) fg[8] = new Sphere(Fc[8],Fz[8],Fr[8],0,8) ; ; declare the base Spheres ; ; octahedron fb[0] = new Sphere(Fc[9],Fz[9],Fr[9],0,0), fb[1] = new Sphere(Fc[10],Fz[10],Fr[10],0,1) fb[2] = new Sphere(Fc[11],Fz[11],Fr[11],0,2), fb[3] = new Sphere(Fc[12],Fz[12],Fr[12],0,3) fb[4] = new Sphere(Fc[13],Fz[13],Fr[13],0,4), fb[5] = new Sphere(Fc[14],Fz[14],Fr[14],0,5) fb[6] = new Sphere(Fc[15],Fz[15],Fr[15],0,6) bradius = fb[0].frad s.sph[0] = new Sphere(Fc[16],Fz[16],Fr[16],0,0), s.sph[1] = new Sphere(Fc[17],Fz[17],Fr[17],0,1) s.sph[2] = new Sphere(Fc[18],Fz[18],Fr[18],0,2), s.sph[3] = new Sphere(Fc[19],Fz[19],Fr[19],0,3) s.sph[4] = new Sphere(Fc[20],Fz[20],Fr[20],0,4), s.sph[5] = new Sphere(Fc[21],Fz[21],Fr[21],0,5) endfunc default: title = "Octahedron" int param v_octahedron caption = "Version (Octahedron)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_octahedron < 100 endparam } Class InvertDodecahedron(InvertSphere) { ; sphere inversions starting with a dodecahedral geometery
; this is a child of InvertSphere public: import "common.ulb" ; constructor for sphere inversions with a dodecahedral geometry func InvertDodecahedron(Generic pparent) InvertSphere.InvertSphere(0) p = (1+sqrt(5))/2, ip = 1/p, fscle = (3+sqrt(3)*(p-1))/(p+1), fbaserad = fscle*2*sqrt(3)/3 scale = 0.4, fii = 13, fjj = 21, fks = 20, fk = fks, rlevel = 181 initSpheres() endfunc ; Initializes base and generator spheres func InitSpheres() complex Fc[54] float Fz[54] float Fr[54] Fc[0] = (1,0)*fscle, Fc[1] = (1,0)*fscle, Fc[2] = (-1,0)*fscle, Fc[3] = (-1,0)*fscle Fc[4] = flip(p)*fscle, Fc[5] = flip(p)*fscle, Fc[6] = -flip(p)*fscle, Fc[7] = -flip(p)*fscle Fc[8] = (p+flip(1))*fscle, Fc[9] = (p-flip(1))*fscle, Fc[10] = (-p+flip(1))*fscle Fc[11] = (-p-flip(1))*fscle, Fc[12] = (0,0), Fc[13] = (1,1), Fc[14] = (-1,1) Fc[15] = (1,-1), Fc[16] = (1,1), Fc[17] = (-1,-1), Fc[18] = (-1,1), Fc[19] = (1,-1) Fc[20] = (-1,-1), Fc[21] = flip(ip), Fc[22] = -flip(ip), Fc[23] = flip(ip) Fc[24] = -flip(ip), Fc[25] = ip+flip(p), Fc[26] = -ip+flip(p), Fc[27] = ip-flip(p) Fc[28] = -ip-flip(p), Fc[29] = p, Fc[30] = -p, Fc[31] = p, Fc[32] = -p, Fc[33] = (0,0) Fc[34] = (1,1), Fc[35] = (-1,1), Fc[36] = (1,-1), Fc[37] = (1,1), Fc[38] = (-1,-1) Fc[39] = (-1,1), Fc[40] = (1,-1), Fc[41] = (-1,-1), Fc[42] = flip(ip), Fc[43] = -flip(ip) Fc[44] = flip(ip), Fc[45] = -flip(ip), Fc[46] = ip+flip(p), Fc[47] = -ip+flip(p) Fc[48] = ip-flip(p), Fc[49] = -ip-flip(p), Fc[50] = p, Fc[51] = -p, Fc[52] = p, Fc[53] = -p Fz[0] = p*fscle, Fz[1] = -p*fscle, Fz[2] = p*fscle, Fz[3] = -p*fscle, Fz[4] = fscle Fz[5] = -fscle, Fz[6] = fscle, Fz[7] = -fscle, Fz[8] = 0, Fz[9] = 0, Fz[10] = 0 Fz[11] = 0, Fz[12] = 0, Fz[13] = 1, Fz[14] = 1, Fz[15] = 1, Fz[16] = -1, Fz[17] = 1 Fz[18] = -1, Fz[19] = -1, Fz[20] = -1, Fz[21] = p, Fz[22] = p, Fz[23] = -p,, Fz[24] = -p Fz[25] = 0, Fz[26] = 0, Fz[27] = 0, Fz[28] = 0, Fz[29] = ip, Fz[30] = ip, Fz[31] = -ip Fz[32] = -ip, Fz[33] = 0, Fz[34] = 1, Fz[35] = 1, Fz[36] = 1, Fz[37] = -1, Fz[38] = 1 Fz[39] = -1, Fz[40] = -1, Fz[41] = -1, Fz[42] = p, Fz[43] = p, Fz[44] = -p Fz[45] = -p, Fz[46] = 0, Fz[47] = 0, Fz[48] = 0, Fz[49] = 0, Fz[50] = ip, Fz[51] = ip Fz[52] = -ip, Fz[53] = -ip Fr[0] = fbaserad, Fr[1] = fbaserad, Fr[2] = fbaserad, Fr[3] = fbaserad, Fr[4] = fbaserad Fr[5] = fbaserad, Fr[6] = fbaserad, Fr[7] = fbaserad, Fr[8] = fbaserad, Fr[9] = fbaserad Fr[10] = fbaserad, Fr[11] = fbaserad, Fr[12] = p, Fr[13] = p-1, Fr[14] = p-1 Fr[15] = p-1, Fr[16] = p-1, Fr[17] = p-1, Fr[18] = p-1, Fr[19] = p-1, Fr[20] = p-1 Fr[21] = p-1, Fr[22] = p-1, Fr[23] = p-1, Fr[24] = p-1, Fr[25] = p-1, Fr[26] = p-1 Fr[27] = p-1, Fr[28] = p-1, Fr[29] = p-1, Fr[30] = p-1, Fr[31] = p-1, Fr[32] = p-1 Fr[33] = sqrt(3)+p-1, Fr[34] = p-1, Fr[35] = p-1, Fr[36] = p-1, Fr[37] = p-1 Fr[38] = p-1, Fr[39] = p-1, Fr[40] = p-1, Fr[41] = p-1, Fr[42] = p-1, Fr[43] = p-1 Fr[44] = p-1, Fr[45] = p-1, Fr[46] = p-1, Fr[47] = p-1, Fr[48] = p-1, Fr[49] = p-1 Fr[50] = p-1, Fr[51] = p-1, Fr[52] = p-1, Fr[53] = p-1 int i = 0 ; scale and translate the spheres to screen dimensions ; repeat if reflect Fc[i] = -conj(Fc[i]) else Fc[i] = Fc[i] endif ; Z axis rotation Fc[i] = Fc[i]*zrot ; Y axis rotation temp = real(Fc[i]) + flip(Fz[i]) temp = temp*yrot Fc[i] = real(temp) + flip(imag(Fc[i])) Fz[i] = imag(temp) ; X axis rotation temp = imag(Fc[i]) + flip(Fz[i]) temp = temp*xrot Fc[i] = real(Fc[i]) + flip(real(temp)) Fz[i] = imag(temp) ; scaling Fc[i] = Fc[i]*#magn*scale Fz[i] = Fz[i]*#magn*scale if i > 12 Fr[i] = Fr[i]*#magn*scale*@bradadj else Fr[i] = Fr[i]*#magn*scale*@radadj endif i = i+1 until i == 54 ; declare the generator spheres ; ; dodecahedron fg[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0), fg[1] = new Sphere(Fc[1],Fz[1],Fr[1],0,1) fg[2] = new Sphere(Fc[2],Fz[2],Fr[2],0,2), fg[3] = new Sphere(Fc[3],Fz[3],Fr[3],0,3) fg[4] = new Sphere(Fc[4],Fz[4],Fr[4],0,4), fg[5] = new Sphere(Fc[5],Fz[5],Fr[5],0,5) fg[6] = new Sphere(Fc[6],Fz[6],Fr[6],0,6), fg[7] = new Sphere(Fc[7],Fz[7],Fr[7],0,7) fg[8] = new Sphere(Fc[8],Fz[8],Fr[8],0,8), fg[9] = new Sphere(Fc[9],Fz[9],Fr[9],0,9) fg[10] = new Sphere(Fc[10],Fz[10],Fr[10],0,10), fg[11] = new Sphere(Fc[11],Fz[11],Fr[11],0,11) fg[12] = new Sphere(Fc[12],Fz[12],Fr[12],0,12) ; ; declare the base Spheres ; ; dodecahedron fb[0] = new Sphere(Fc[13],Fz[13],Fr[13],0,0), fb[1] = new Sphere(Fc[14],Fz[14],Fr[14],0,1) fb[2] = new Sphere(Fc[15],Fz[15],Fr[15],0,2), fb[3] = new Sphere(Fc[16],Fz[16],Fr[16],0,3) fb[4] = new Sphere(Fc[17],Fz[17],Fr[17],0,4), fb[5] = new Sphere(Fc[18],Fz[18],Fr[18],0,5) fb[6] = new Sphere(Fc[19],Fz[19],Fr[19],0,6), fb[7] = new Sphere(Fc[20],Fz[20],Fr[20],0,7) fb[8] = new Sphere(Fc[21],Fz[21],Fr[21],0,8), fb[9] = new Sphere(Fc[22],Fz[22],Fr[22],0,9) fb[10] = new Sphere(Fc[23],Fz[23],Fr[23],0,10), fb[11] = new Sphere(Fc[24],Fz[24],Fr[24],0,11) fb[12] = new Sphere(Fc[25],Fz[25],Fr[25],0,12), fb[13] = new Sphere(Fc[26],Fz[26],Fr[26],0,13) fb[14] = new Sphere(Fc[27],Fz[27],Fr[27],0,14), fb[15] = new Sphere(Fc[28],Fz[28],Fr[28],0,15) fb[16] = new Sphere(Fc[29],Fz[29],Fr[29],0,16), fb[17] = new Sphere(Fc[30],Fz[30],Fr[30],0,17) fb[18] = new Sphere(Fc[31],Fz[31],Fr[31],0,18), fb[19] = new Sphere(Fc[32],Fz[32],Fr[32],0,19) fb[20] = new Sphere(Fc[33],Fz[33],Fr[33],0,20) bradius = fb[0].frad s.sph[0] = new Sphere(Fc[34],Fz[34],Fr[34],0,0), s.sph[1] = new Sphere(Fc[35],Fz[35],Fr[35],0,1) s.sph[2] = new Sphere(Fc[36],Fz[36],Fr[36],0,2), s.sph[3] = new Sphere(Fc[37],Fz[37],Fr[37],0,3) s.sph[4] = new Sphere(Fc[38],Fz[38],Fr[38],0,4), s.sph[5] = new Sphere(Fc[39],Fz[39],Fr[39],0,5) s.sph[6] = new Sphere(Fc[40],Fz[40],Fr[40],0,6), s.sph[7] = new Sphere(Fc[41],Fz[41],Fr[41],0,7) s.sph[8] = new Sphere(Fc[42],Fz[42],Fr[42],0,8), s.sph[9] = new Sphere(Fc[43],Fz[43],Fr[43],0,9) s.sph[10] = new Sphere(Fc[44],Fz[44],Fr[44],0,10), s.sph[11] = new Sphere(Fc[45],Fz[45],Fr[45],0,11) s.sph[12] = new Sphere(Fc[46],Fz[46],Fr[46],0,12), s.sph[13] = new Sphere(Fc[47],Fz[47],Fr[47],0,13) s.sph[14] = new Sphere(Fc[48],Fz[48],Fr[48],0,14), s.sph[15] = new Sphere(Fc[49],Fz[49],Fr[49],0,15) s.sph[16] = new Sphere(Fc[50],Fz[50],Fr[50],0,16), s.sph[17] = new Sphere(Fc[51],Fz[51],Fr[51],0,17) s.sph[18] = new Sphere(Fc[52],Fz[52],Fr[52],0,18), s.sph[19] = new Sphere(Fc[53],Fz[53],Fr[53],0,19) endfunc float p float ip default: title = "Dodecahedron" int param v_dodecahedron caption = "Version (Dodecahedron)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_dodecahedron < 100 endparam } Class InvertCircles(InvertSphere) { ; ; circle inversions
;

; This is a child of InvertSphere. For the case of 3 base circles ; (Apollonian Gasket) methods for perturbation of the initiating circles ; are available. ;

$define debug public: import "common.ulb" ; constructor for circle inversions using spheres func InvertCircles(Generic pparent) InvertSphere.InvertSphere(0) ang = 2*#pi/@ncircle ipi = flip(#pi) cpi = flip(#pi/@ncircle) complex cr1 = exp((0,0)*ang+ipi) complex cr2 = exp((0,1)*ang+ipi) float rdd = cabs(cr1-cr2)/2 dd = cabs(cr1) float dtan = sqrt(dd*dd-rdd*rdd) fscle = (dd+rdd)/dtan pert = @pert pert = 11 - pert fscle2 = 1 fbaserad = fscle*2*sqrt(3)/3 fii = @ncircle+1 fjj = @ncircle+1 fks = @ncircle fk = fks g = 0 b = 0 circles = true showc = @showc lace = @lace if @ncircle == 3 rlevel = 4 scale = 0.5 if @ptype == "Inner Circle" && pert <= 2 cir3 = true endif if @ptype == "None" fscle = 2 + sqrt(3) fscle2 = 1 elseif @ptype == "Outer Circles" fscle = (2 + sqrt(3))*cos(#pi/(pert+6)) fscle2 = (fscle-sqrt(3)-1.5)/0.5 else if pert == 10 fscle2 = 1.0041268407 elseif pert == 9 fscle2 = 1.0049465720 elseif pert == 8 fscle2 = 1.0060422243 elseif pert == 7 fscle2 = 1.0075560883 elseif pert == 6 fscle2 = 1.0097381547 elseif pert == 5 fscle2 = 1.0130643119 elseif pert == 4 fscle2 = 1.0185254 elseif pert == 3 fscle2 = 1.0286754 elseif pert == 2 fscle2 = 1.0515254 elseif pert == 1 fscle2 = 1.1277437913 endif endif elseif @ncircle == 4 rlevel = 9 scale = 0.55 elseif @ncircle == 5 rlevel = 16 scale = 0.6 elseif @ncircle == 6 rlevel = 25 scale = 0.65 elseif @ncircle == 7 rlevel = 36 scale = 0.65 elseif @ncircle == 8 rlevel = 49 scale = 0.7 elseif @ncircle == 9 rlevel = 64 scale = 0.7 elseif @ncircle == 10 rlevel = 81 scale = 0.7 elseif @ncircle == 11 rlevel = 100 scale = 0.7 elseif @ncircle == 12 rlevel = 121 scale = 0.7 endif initSpheres() endfunc ; Initializes base and generator spheres func InitSpheres() complex Fc[26] float Fz[26] float Fr[26] ; generator set int i = 0 while i < @ncircle Fc[i] = exp(flip(i)*ang+ipi)*fscle Fz[i] = 0 i = i + 1 endwhile Fc[i] = 0 if @ncircle == 3 Fr[0] = sqrt(3)+1.5 else Fr[0] = cabs(Fc[0]-Fc[1])/2 endif i = 1 while i < @ncircle Fr[i] = Fr[0] i = i + 1 endwhile if @ncircle == 3 if @ptype == "None" Fr[3] = 0.5 elseif @ptype == "Outer Circles" Fr[3] = fscle-sqrt(3)-1.5 elseif @ptype == "Inner Circle" if pert == 10 Fr[3] = 0.5151714074 elseif pert == 9 Fr[3] = 0.5181320854 elseif pert == 8 Fr[3] = 0.5220631074 elseif pert == 7 Fr[3] = 0.5274464005 elseif pert == 6 Fr[3] = 0.5351105381 elseif pert == 5 Fr[3] = 0.5465863845 elseif pert == 4 Fr[3] = 0.564987 elseif pert == 3 Fr[3] = 0.597588 elseif pert == 2 Fr[3] = 0.665053 elseif pert == 1 Fr[3] = 0.8524941755 endif endif else Fr[i] = cabs(Fc[0])-Fr[0] endif g = i ; Base set i = i + 1 if @ncircle%2 == 0 while i < 2*@ncircle+1 Fc[i] = exp(flip(i-4)*ang+cpi)*fscle2 Fz[i] = 0 i = i + 1 endwhile else sflag = false while i < 2*@ncircle+1 Fc[i] = exp(flip(i-3)*ang)*fscle2 Fz[i] = 0 i = i + 1 endwhile endif Fc[i] = 0 if @ncircle == 3 if @ptype == "Outer Circles" || @ptype == "None" Fr[4] = sqrt(3)/2*fscle2 Fr[7] = Fr[4]+fscle2 elseif @ptype == "Inner Circle" if pert == 10 Fr[4] = 0.8618985631 elseif pert == 9 Fr[4] = 0.8610788318 elseif pert == 8 Fr[4] = 0.8599831795 elseif pert == 7 Fr[4] = 0.8584693155 elseif pert == 6 Fr[4] = 0.8562872491 elseif pert == 5 Fr[4] = 0.8529610919 elseif pert == 4 Fr[4] = 0.8475 elseif pert == 3 Fr[4] = 0.83735 elseif pert == 2 Fr[4] = 0.8145 elseif pert == 1 Fr[4] = 0.7382816125 endif Fr[7] = Fr[4] + 1 endif else Fr[@ncircle+1] = cabs(Fc[@ncircle+1]-Fc[@ncircle+2])/2 endif i = @ncircle+2 while i < 2*@ncircle+1 Fr[i] = Fr[@ncircle+1] i = i + 1 endwhile if @ncircle != 3 dd = cabs(Fc[0]) Fr[i] = sqrt(dd*dd-Fr[0]*Fr[0]) endif b = i i = 0 ; scale and translate the spheres to screen dimensions ; repeat if reflect Fc[i] = -conj(Fc[i]) else Fc[i] = Fc[i] endif ; Z axis rotation Fc[i] = Fc[i]*zrot ; Y axis rotation temp = real(Fc[i]) + flip(Fz[i]) temp = temp*yrot Fc[i] = real(temp) + flip(imag(Fc[i])) Fz[i] = imag(temp) ; X axis rotation temp = imag(Fc[i]) + flip(Fz[i]) temp = temp*xrot Fc[i] = real(Fc[i]) + flip(real(temp)) Fz[i] = imag(temp) ; scaling Fc[i] = Fc[i]*#magn*scale Fz[i] = Fz[i]*#magn*scale if i > 12 Fr[i] = Fr[i]*#magn*scale*@bradadj else Fr[i] = Fr[i]*#magn*scale*@radadj endif i = i+1 until i == 2*@ncircle+2 ; ; declare the generator spheres i = 0 while i <= g fg[i] = new Sphere(Fc[i],Fz[i],Fr[i],0,i) i = i + 1 endwhile ; declare the base Spheres i = 0 while i <= g fb[i] = new Sphere(Fc[i+g+1],Fz[i+g+1],Fr[i+g+1],0,i) i = i + 1 endwhile bradius = fb[0].frad i = 0 while i <= g s.sph[i] = fb[i] i = i + 1 endwhile endfunc int g int b float ang complex ipi complex cpi float dd int pert float fscle2 bool showc default: title = "Circle Inversions" int param v_invcircle caption = "Version (Circle Inversions)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_invcircle < 100 endparam int param ncircle caption = "# of Circles (3-12)" default = 3 min = 3 max = 12 endparam int param maxLevel caption = "Recursion level" default = 20 min = 0 max = 200 endparam bool param showc caption = "Show Center Circle" default = true endparam bool param lace caption = "Display as Lace" default = false visible = @ptype == "Inner Circle" && (@pert >=8) && @ncircle == 3 endparam heading text = "Perturbation of Inversion Circles \ by overlap." visible = @ncircle == 3 endheading param ptype caption = "Perturb Type" default = 0 enum = "None" "Outer Circles" "Inner Circle" visible = @ncircle == 3 endparam param pert caption = "Perturb Level (1-10)" default = 1 min = 1 max = 10 visible = @ptype != "None" && @ncircle == 3 endparam float param xang caption = "X Axis Rotation" default = 0.0 endparam float param yang caption = "Y Axis Rotation" default = 0.0 endparam } class InvertMobius(InvertSphere) { ;

; Derived from the public C code of Curtis McMullen and ; material from Indra's Pearls by Mumford, Series and Wright ; A new method for InitSpheres is needed, as both spheres ; and Kleinian Group matricies must be initalized. ; public: import "common.ulb" $define debug ; constructor for Mobius (Kleinian) sphere inversions func InvertMobius(Generic pparent) invertSphere.Invertsphere(0) PARAFUZZ = 1e-3, LINEFUZZ = 1e-5, im = (0,1),gi = 0 fii = 4, fks = 1, fk = fks, scale = 0.7, sscale = 1, iend = 4 ss = new SphereArray(50000000) InitSpheresK() endfunc ; Initialize spheres, inversion matricies and trace values func InitSpheresK() ; This function initializes the base sphere(s), the Kleinian group ; inversion matrices and the trace values complex Fc[4] float Fz[4] float Fr[4] int i = 0 complex ta = @ta complex tb = @tb float cir = @cir complex cira = @cira Complex cirs = @cirs float rada = @rada float rads = @rads float radam = @radam complex m = @m complex tab = 0 complex gz0 = 0 complex gz = 0 complex gQ = 0 complex gR = 0 complex tabAB = @tabAB Fz[0] = 0 Fz[1] = 0 Fz[2] = 0 Fz[3] = 0 if @cusptype == "Nearby group" ta = (1.91,-0.05) tb = (2,0) cir = 0.297 elseif @cusptype == "Accident" ta = (1.9021130325903071442328786667588,0) tb = (1.9021130325903071442328786667588,0) elseif @cusptype == "Troel's Point" ta = (1.6168866453,-0.7056734968) tb = (2,0) cir = 0.13091 elseif @cusptype == "Degenerate Spiral" ta = (1.9264340533,-0.0273817919) tb = (2,0) cir = 0.2419 elseif @cusptype == "Double Cusp" tb = (2,0) if @cusp == "0/1" ta = (2,0) cir = 0.5 elseif @cusp == "1/100" ta = (1.99599050389291,-0.000302826761310194) cir = 0.3091 elseif @cusp == "2/99" ta = (1.99599050389291,-0.000302826761310194) cir = 0.2676 elseif @cusp == "3/100" ta = (1.99118310579765,-0.000982081178197968) cir = 0.2427 elseif @cusp == "4/99" ta = (1.98427416931522,-0.00237401043014847) cir = 0.2351 elseif @cusp == "1/15" ta = (1.95859103011179,-0.0112785606117653) cir = 0.32870768 elseif @cusp == "1/10" ta = (1.91342329586682,-0.0362880775225429) cir = 0.32365169 elseif @cusp == "2/19" ta = (1.90377999779718,-0.0395799512688805) cir = 0.2604321 elseif @cusp == "1/9" ta = (1.89640725094921,-0.0487530128986506) cir = 0.32176507 elseif @cusp == "7/43" ta = (1.80785523999043,-0.136998687907137) cir = 0.229796 elseif @cusp == "3/10" ta = (1.65831239517773,-0.5) cir = 0.2316625 elseif @cusp == "2/5" ta = (1.64213876865348,-0.766588417465459) cir = 0.2665884 elseif @cusp == "1/2" ta = (1.73205080756888,-1) cir = 0.36602539 elseif @cusp == "21/34" ta = (1.6179907967521,-1.29170028664218) cir = 0.166461 endif endif ; Grandma's Special algorithm if !(@cusptype == "Grandma's Special #2" || @cusptype == "Maskit") if @showcusp == "Both" Fc[0] = 1-cir Fr[0] = cir Fc[1] = -(1-cir) Fr[1] = cir Fc[2] = (0,0) Fr[2] = 1 s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) s.sph[1] = new Sphere(Fc[1],Fz[1],Fr[1],0,0) s.sph[2] = new Sphere(Fc[2],Fz[2],Fr[2],0,0) ss.sph[0] = s.sph[0] ss.sph[1] = s.sph[1] ss.sph[2] = s.sph[2] elseif @showcusp == "Alternate" Fc[0] = (1-cir) Fr[0] = cir Fc[1] = -(1-cir) Fr[1] = cir s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) s.sph[1] = new Sphere(Fc[1],Fz[1],Fr[1],0,0) ss.sph[0] = s.sph[0] ss.sph[1] = s.sph[1] elseif @showcusp == "Standard" Fc[0] = (0,0) Fr[0] = 1 s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) ss.sph[0] = s.sph[0] endif complex tab = (ta*tb+sqrt(ta*ta*tb*tb-4*(ta*ta+tb*tb)))/2 if @alttab tab = (ta*tb-sqrt(ta*ta*tb*tb-4*(ta*ta+tb*tb)))/2 endif complex gz0 = (tab-2)*tb/(tb*tab-2*ta+2*(0,1)*tab) mob[0] = new Mobius((tb-(0,2))/2, tb/2, tb/2, conj((tb-(0,2))/2)) mob[1] = new Mobius(mob[0].m_d, -mob[0].m_b, -mob[0].m_c, mob[0].m_a) mob[2] = new Mobius(ta/2, (ta*tab-2*tb-(0,4))*gz0/(2*tab-4), \ (ta*tab-2*tb+(0,4))/((2*tab+4)*gz0), ta/2) if @trans temp1 = mob[2].m_b mob[2].m_b = mob[2].m_c mob[2].m_c = temp1 endif mob[3] = new Mobius(mob[2].m_d, -mob[2].m_b, -mob[2].m_c, mob[2].m_a) endif ; Figure 11.1 from the Indra's Pearls book if @cusptype == "Indra 11.1" tabAB = (0,0) tb = (2,0) sscale = 2.4 ta = (1.924781, 0.047529) rads = 0.41421381 cirs = (0, 0.272591599) cira = (0.168208, 0) rada = 0.2211131 endif ; Grandma's Special #2 algorithm if !(@cusptype == "Grandma's Special" || @cusptype == "Maskit" ||\ @cusptype == "Double Cusp" || @cusptype == "Nearby Group" ||\ @cusptype == "Troel's Point"|| @cusptype == "Degenerate Spiral") if @showcusp == "Both" Fc[0] = cirs Fr[0] = rads-cabs(cirs) if @lines Fr[0] = -Fr[0] endif Fc[1] = -cirs Fr[1] = Fr[0] Fc[2] = cira Fr[2] = rada-cabs(cira) if @linea Fr[2] = -Fr[2] endif Fc[3] = -cira Fr[3] = Fr[2] s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) s.sph[1] = new Sphere(Fc[1],Fz[1],Fr[1],0,0) s.sph[2] = new Sphere(Fc[2],Fz[2],Fr[2],0,0) s.sph[3] = new Sphere(Fc[3],Fz[3],Fr[3],0,0) ss.sph[0] = s.sph[0] ss.sph[1] = s.sph[1] ss.sph[2] = s.sph[2] ss.sph[3] = s.sph[3] elseif @showcusp == "Alternate" Fc[0] = cira Fr[0] = rada-cabs(cira) if @linea Fr[0] = -Fr[0] endif Fc[1] = -cira Fr[1] = Fr[0] s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) s.sph[1] = new Sphere(Fc[1],Fz[1],Fr[1],0,0) ss.sph[0] = s.sph[0] ss.sph[1] = s.sph[1] else Fc[0] = cirs Fr[0] = rads-cabs(cirs) if @lines Fr[0] = -Fr[0] endif Fc[1] = -cirs Fr[1] = Fr[0] s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) s.sph[1] = new Sphere(Fc[1],Fz[1],Fr[1],0,0) ss.sph[0] = s.sph[0] ss.sph[1] = s.sph[1] endif gz = 0.5*sqrt(ta^2*tb^2-4*ta^2-4*tb^2+4*tabAB+8) tab = 0.5*ta*tb-gz if @alttab tab = 0.5*ta*tb+gz endif gQ = sqrt(2-tabAB) gR = sqrt(2+tabAB) if cabs(tabAB+im*gQ*gR)<2 gR = -gR endif gz0 = (tab-2)*(tb+gR)/(tb*tab-2*ta+im*gQ*tab) mob[0] = new Mobius((tb-im*gQ)/2, (tb*tab-2*ta-im*gQ*tab)/((2*tab+4)*gz0),\ (tb*tab-2*ta+im*gQ*tab)*gz0/(2*tab-4), (tb+im*gQ)/2) mob[1] = new Mobius(mob[0].m_d, -mob[0].m_b, -mob[0].m_c, mob[0].m_a) mob[2] = new Mobius(ta/2, (ta*tab-2*tb+2*im*gQ)/((2*tab+4)*gz0), \ (ta*tab-2*tb-2*im*gQ)*gz0/(2*tab-4), ta/2) if @trans temp1 = mob[2].m_b mob[2].m_b = mob[2].m_c mob[2].m_c = temp1 endif mob[3] = new Mobius(mob[2].m_d, -mob[2].m_b, -mob[2].m_c, mob[2].m_a) endif if @cusptype == "Maskit" if @showcuspm == "Predefined" if @cuspm == "0/1" m = (0,2) radam = 0.5 elseif @cuspm == "1/15" m = (-0.0112785606117653, 1.95859103011179) radam = 0.489661311 elseif @cuspm == "1/10" m = (-0.0362880775225429,1.91342329586682) radam = 0.47852888 elseif @cuspm == "2/19" m = (-0.0395799512688805,1.90377999779718) radam = 0.35214005 elseif @cuspm == "1/9" m = (-0.0487530128986506,1.89640725094921) radam = 0.4744165 elseif @cuspm == "7/43" m = (-0.136998687907137,1.80785523999043) radam = 0.2983515 elseif @cuspm == "3/10" m = (-0.5,1.65831239517773) radam = 0.3015111 elseif @cuspm == "2/5" m = (-0.766588417465459,1.64213876865348) radam = 0.363491 elseif @cuspm == "1/2" m = (-1,1.73205080756888) radam = 0.57735015 elseif @cuspm == "21/34" m = (1.29170028664218,1.6179907967521) radam = 0.1997052 endif endif if @showcuspm == "Both" || (@showcuspm == "Predefined" \ && @showcuspm2 == "Both") Fc[0] = 1 + flip(radam) Fr[0] = radam Fc[1] = (1,0) Fr[1] = 0 s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) s.sph[1] = new Sphere(Fc[1],Fz[1],Fr[1],0,0) ss.sph[0] = s.sph[0] ss.sph[1] = s.sph[1] elseif @showcuspm == "Alternate" || (@showcuspm == "Predefined" \ && @showcuspm2 == "Alternate") Fc[0] = 1 + flip(radam) Fr[0] = radam s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) ss.sph[0] = s.sph[0] else Fc[0] = (1,0) Fr[0] = 0 s.sph[0] = new Sphere(Fc[0],Fz[0],Fr[0],0,0) ss.sph[0] = s.sph[0] endif mob[0] = new Mobius(m, 1, 1, 0) mob[1] = new Mobius(mob[0].m_d, -mob[0].m_b, -mob[0].m_c, mob[0].m_a) mob[2] = new Mobius(1, 0, 2, 1) mob[3] = new Mobius(mob[2].m_d, -mob[2].m_b, -mob[2].m_c, mob[2].m_a) endif ; normalize the matrices i = 0 while i < 4 mob[i].Normalize(mob[i]) i = i + 1 endwhile endfunc ; Inverts a sphere - Mobius inversion The return value may be a sphere or a plane.
; @param target = sphere to be inverted ; @param inverter = not used. ; @param level = recursion level ; @param gen = index of generator matrix ;------------------------------------------------ Sphere func Inverse(Sphere target, Sphere inverter, int level, int gen) mob[5] = new Mobius(0,0,0,0) mob[5].CircToMob(target) mob[gen].MConj(mob[5],mob[5]) Sphere ns = new Sphere(0,0,0,0,0) mob[5].MobToCirc(level,gen,ns) return ns endfunc ; Top level recursion function func Recurse() int l = 0 int ir = 0 int si = 0 int sj = 0 int j = 0 bool done = false int c = 0 float ddx = 0 float ddy = 0 float ddr = 0 sphere rra bool continue = false int ifinal = 0 int istack = 0 int nold = 0 int nfinal = 1 int iii = 0 int k = 0 int lev = 0 if @showcusp == "Both" j = 3 iii = 2 elseif @showcusp == "Standard" j = 1 iii = 0 else j = 2 iii = 1 endif if @cusptype == "Grandma's Special #2" if @showcusp == "Both" j = 4 iii = 3 else j = 2 iii = 1 endif endif if @cusptype == "Maskit" if @showcuspm == "Both" || (@showcuspm == "Predefined" && \ @showcuspm2 == "Both") j = 2 iii = 1 else j = 1 iii = 0 endif endif iii = iii + 1 lev = 1 while lev <= mlevel && j < flength gi = 0 while gi < iend && j < flength k = 0 while k <= iii && j < flength ss.sph[j] = Inverse(ss.sph[k],ss.sph[0],lev,gi) if ss.sph[j].frad >= 0 && abs(ss.sph[j].frad) < fminsphere j = j - 1 endif if j > flength lev = mlevel + 1 k = iii + 1 endif j = j+1 k = k + 1 endwhile if j > flength gi = 5 endif gi = gi + 1 endwhile ; sort array by circle identity l = round(j/2)+1 ir = j continue = true repeat if l > 1 l = l-1 rra = ss.sph[l-1] else rra = ss.sph[ir-1] ss.sph[ir-1] = ss.sph[0] ir = ir-1 if ir == 0 ss.sph[0] = rra continue = false endif endif if continue == true si = l sj = 2*l endif while (sj <= ir) && (continue == true) if sj < ir ddx = real(ss.sph[sj-1].fcen)-real(ss.sph[sj].fcen) ddy = imag(ss.sph[sj-1].fcen)-imag(ss.sph[sj].fcen) ddr = ss.sph[sj-1].frad-ss.sph[sj].frad c = 0 done = false ; Lines precede circles if ss.sph[sj-1].frad <= 0 && ss.sph[sj].frad > 0 c = -1 done = true elseif ss.sph[sj].frad <= 0 && ss.sph[sj-1].frad > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif ss.sph[sj-1].frad <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 sj = sj + 1 endif endif ddx = real(rra.fcen)-real(ss.sph[sj-1].fcen) ddy = imag(rra.fcen)-imag(ss.sph[sj-1].fcen) ddr = rra.frad-ss.sph[sj-1].frad c = 0 done = false ; ; Lines precede circles if rra.frad <= 0 && ss.sph[sj-1].frad > 0 c = -1 done = true elseif ss.sph[sj-1].frad <= 0 && rra.frad > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif rra.frad <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 ss.sph[si-1] = ss.sph[sj-1] si = sj sj = sj + sj else sj = ir + 1 endif endwhile if (continue == true) ss.sph[si-1] = rra endif until continue == false ; eliminate duplicates in place ; ir = oldj-iii+1 ; l = oldj-iii ir = j+1 l = j while ir < j ddx = real(ss.sph[ir].fcen)-real(ss.sph[ir-1].fcen) ddy = imag(ss.sph[ir].fcen)-imag(ss.sph[ir-1].fcen) ddr = ss.sph[ir].frad-ss.sph[ir-1].frad c = 0 done = false ; Lines precede circles if ss.sph[ir].frad <= 0 && ss.sph[ir-1].frad > 0 c = -1 done = true elseif ss.sph[ir-1].frad <= 0 && ss.sph[ir].frad > 0 c = 1 done = true elseif ddx < -thresh && !done c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif ss.sph[ir].frad <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c == 0 ir = ir + 1 else ss.sph[l] = ss.sph[ir] ir = ir +1 l = l + 1 endif endwhile j = j-(ir-l)+1 ; move to final array, skipping dups ifinal = 0 istack = 0 nold = nfinal while ifinal < nold && istack < j && nfinal < flength ddx = real(s.sph[ifinal].fcen)-real(ss.sph[istack].fcen) ddy = imag(s.sph[ifinal].fcen)-imag(ss.sph[istack].fcen) ddr = s.sph[ifinal].frad-ss.sph[istack].frad c = 0 done = false ; Lines precede circles if s.sph[ifinal].frad <= 0 && ss.sph[istack].frad > 0 c = -1 done = true elseif ss.sph[istack].frad <= 0 && s.sph[ifinal].frad > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif s.sph[ifinal].frad <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 ifinal = ifinal + 1 endif if c == 0 istack = istack + 1 endif if c > 0 s.sph[nfinal] = ss.sph[istack] nfinal = nfinal + 1 istack = istack + 1 endif endwhile while istack < j && nfinal < flength s.sph[nfinal] = ss.sph[istack] nfinal = nfinal + 1 istack = istack + 1 endwhile ir = nold while ir 1 l = l-1 rra = s.sph[l-1] else rra = s.sph[ir-1] s.sph[ir-1] = s.sph[0] ir = ir-1 if ir == 0 s.sph[0] = rra continue = false endif endif if continue == true si = l sj = 2*l endif while (sj <= ir) && (continue == true) if sj < ir ddx = real(s.sph[sj-1].fcen)-real(s.sph[sj].fcen) ddy = imag(s.sph[sj-1].fcen)-imag(s.sph[sj].fcen) ddr = s.sph[sj-1].frad-s.sph[sj].frad c = 0 done = false ; Lines precede circles if s.sph[sj-1].frad <= 0 && s.sph[sj].frad > 0 c = -1 done = true elseif s.sph[sj].frad <= 0 && s.sph[sj-1].frad > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif s.sph[sj-1].frad <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 sj = sj + 1 endif endif ddx = real(rra.fcen)-real(s.sph[sj-1].fcen) ddy = imag(rra.fcen)-imag(s.sph[sj-1].fcen) ddr = rra.frad-s.sph[sj-1].frad c = 0 done = false ; Lines precede circles if rra.frad <= 0 && s.sph[sj-1].frad > 0 c = -1 done = true elseif s.sph[sj-1].frad <= 0 && rra.frad > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif rra.frad <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 s.sph[si-1] = s.sph[sj-1] si = sj sj = sj + sj else sj = ir + 1 endif endwhile if (continue == true) s.sph[si-1] = rra endif until continue == false iii = j-1 if j == 0 lev = mlevel+1 else lev = lev+1 endif endwhile fk = nfinal-1 ss = 0 heapsort(s,fk) vanquish(s,fk) SizeAndRot() if @zsort heapsortz(s, fk) endif endfunc ; Size and rotate spheres func SizeAndRot() if @cusptype == "Nearby group" && @trans sscale = 0.05 elseif @cusptype == "Double Cusp" && @trans if @cusp == "1/15" sscale = 0.015 elseif @cusp == "0/1" sscale = 0.5 elseif @cusp == "2/19" sscale = 0.025 elseif @cusp == "1/9" sscale = 0.04 elseif @cusp == "7/43" sscale = 0.035 elseif @cusp == "2/5" sscale = 0.2 endif endif int i = 0 while i < fk if s.sph[i].frad > 0 ; size routines if s.sph[i].frad > @maxsphere s.sph[i].frad = 0 endif if @cusptype == "Maskit" s.sph[i].fcen = (s.sph[i].fcen+(0,-1))*#magn*scale*sscale else s.sph[i].fcen = s.sph[i].fcen*#magn*scale*sscale endif s.sph[i].fz = s.sph[i].fz*#magn*scale*sscale s.sph[i].frad = s.sph[i].frad*#magn*scale*sscale ; rotation around the z axis ; float fx = real(s.sph[i].fcen) float fy = imag(s.sph[i].fcen) float fz = s.sph[i].fz float xx = real(s.sph[i].fcen) fx = fx*cos(#angle) - fy*sin(#angle) fy = fy*cos(#angle) + xx*sin(#angle) s.sph[i].fcen = fx + flip(fy) ; rotation around the y axis ; xx = fx fx = fz*sin(@yang*#pi/180) + fx*cos(@yang*#pi/180) fz = fz*cos(@yang*#pi/180) - xx*sin(@yang*#pi/180) s.sph[i].fcen = fx + flip(fy) s.sph[i].fz = fz ; rotation around the x axis ; float yy = fy fy = fy*cos(@xang*#pi/180) - fz*sin(@xang*#pi/180) fz = yy*sin(@xang*#pi/180) + fz*cos(@xang*#pi/180) s.sph[i].fcen = fx + flip(fy) s.sph[i].fz = fz endif i = i + 1 endwhile endfunc float PARAFUZZ float LINEFUZZ complex im Mobius mob[6] int gi int iend float sscale spherearray ss default: title = "Mobius Inversions" int param v_mobinvert caption = "Version (Mobius Inversions)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_mobinvert < 101 endparam float param minsphere caption = "Min sphere size" default = 0.001 min = 0.000001 endparam float param maxsphere caption = "Max sphere size" default = 0.7 endparam int param maxLevel caption = "Recursion level" default = 100 min = 0 max = 1000 endparam float param radadj caption = "Gen Rad adj" default = 1.0 visible = false endparam float param bradadj caption = "Base Rad adj" default = 1.0 visible = false endparam bool param reflect caption = "Reflect Object" default = false endparam float param xang caption = "X Axis Rotation" default = 0.0 endparam float param yang caption = "Y Axis Rotation" default = 0.0 endparam heading text = "For rotation around the Z Axis use the rotation angle on the Location Tab." endheading heading text = "Use these methods with care, as only certain combinations of \ parameters will give satisfactory results. Use of the help file \ is essential. Use of the 'Explore' feature is not recommended." visible = @cusptype == "Grandma's Special" || @cusptype == "Grandma's Special #2" \ || @cusptype == "Maskit" endheading heading text = "The Grandma algorithms come from 'Indra's Pearls' by Mumford, \ Series and Wright. Consult the book for use of the trace parameters." visible = @cusptype == "Grandma's Special" || @cusptype == "Grandma's Special #2" endheading heading text = "The Maskit algorithm comes from 'Indra's Pearls' by Mumford, \ Series and Wright. Consult the book for use of the Maskit parameters." visible = @cusptype == "Maskit" endheading param cusptype caption = "Group" default = 7 enum = "Accident" "Indra 11.1" "Degenerate Spiral" "Double Cusp" \ "Grandma's Special" "Grandma's Special #2" "Maskit" "Nearby Group" \ "Troel's Point" endparam param cusp caption = "Cusp" default = 5 enum = "0/1" "1/100" "2/99" "3/100" "4/99" "1/15" "1/10" "2/19" "1/9" \ "7/43" "3/10" "2/5" "1/2" "21/34" visible = @cusptype == "Double Cusp" endparam param showcusp caption = "Cusp view" default = 1 enum = "Both" "Standard" "Alternate" visible = !(@cusptype == "Maskit" || @cusptype == "Accident") endparam param showcuspm caption = "Cusp view" default = 1 enum = "Both" "Standard" "Alternate" "Predefined" visible = @cusptype == "Maskit" endparam param showcuspm2 caption = "Cusp view" default = 1 enum = "Both" "Standard" "Alternate" visible = @cusptype == "Maskit" && @showcuspm == "Predefined" endparam heading text = "Slowly increase 'gen circle' until good circle packing is observed." visible = @cusptype == "Grandma's special"&& @showcusp != "Standard" endheading param @cir caption ="Gen circle" default = 0.01 hint = "Slowly increase until good circle packing is observed." visible = @cusptype == "Grandma's special"&& @showcusp != "Standard" endparam heading text = "These parameters set the size and position of the 'Standard' \ generator circles." visible = @cusptype == "Grandma's special #2"&& @showcusp != "Alternate" endheading param @cirs caption ="Gen circle std" default = (0,0) visible = (@cusptype == "Grandma's special #2"&& @showcusp != "Alternate") endparam param @rads caption ="Rad ref std" default = 1.0 visible = (@cusptype == "Grandma's special #2"&& @showcusp != "Alternate") endparam bool param @lines caption ="Generate as line" default = false visible = (@cusptype == "Grandma's special #2"&& @showcusp != "Alternate") endparam heading text = "These parameters set the size and position of the 'Alternate' \ generator circles." visible = @cusptype == "Grandma's special #2"&& @showcusp != "Standard" endheading param @cira caption ="Gen circle alt" default = (0,0) visible = (@cusptype == "Grandma's special #2"&& @showcusp != "Standard") endparam param @rada caption ="Rad ref alt" default = 1.0 visible = (@cusptype == "Grandma's special #2"&& @showcusp != "Standard") endparam heading text = "This parameter set the size and position of the 'Alternate' \ generator circle." visible = @cusptype == "Maskit"&& @showcusp != "Standard" endheading param @radam caption ="Rad ref" default = 0.5 visible = @cusptype == "Maskit"&& @showcuspm != "Standard" && \ @showcuspm != "Predefined" endparam bool param @linea caption ="Generate as line" default = false visible = (@cusptype == "Grandma's special #2"&& @showcusp != "Standard") endparam complex param m caption = "Maskit param" default = (0.0112785606117653,1.95859103011179) visible = @cusptype == "Maskit" && @showcuspm != "Predefined" endparam param cuspm caption = "Cusp" default = 1 enum = "0/1" "1/15" "1/10" "2/19" "1/9" "7/43" "3/10" "2/5" "1/2" "21/34" visible = @cusptype == "Maskit" && @showcuspm == "Predefined" endparam complex param ta caption = "Trace a" default = (1.95,0.02) visible = @cusptype == "Grandma's Special" || @cusptype == "Grandma's Special #2" endparam complex param tb caption = "Trace b" default = 3 visible = @cusptype == "Grandma's Special" || @cusptype == "Grandma's Special #2" endparam bool param alttab caption ="Alternate trace ab" default = false visible = @cusptype == "Grandma's Special" || @cusptype == "Grandma's Special #2" endparam complex param tabAB caption = "Trace abAB" default = -2 visible = @cusptype == "Grandma's Special #2" endparam bool param trans caption = "Transpose transform" default = false visible = @cusptype != "Maskit" endparam } ;------------------------------------------- ; Trap shape classes ;--------------------------------------------- ; general references to 2D curves:
; Mathematical Curves
;
;

class REB_TrapShapeIkenaga(common.ulb:TrapShape) { ; Uses the Ikenaga fractal function as the trap public: import "common.ulb" ; Constructor func REB_TrapShapeIkenaga(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) complex p = pz*@scale p = @fn1(p) int ike_iter = 0 complex c = #pixel while ike_iter < @max_iterations p = p*p*p +(c-1)*p - c ike_iter = ike_iter + 1 endwhile m_LastZ = @fn2(p) float d = abs(|pz| - |m_LastZ|) return d endfunc default: title = "Ikenaga" int param v_trapshapeikenaga caption = "Version (Trap Shape Ikenaga)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeikenaga < 101 endparam float param scale caption = "Scale" default = 1.0 endparam param max_iterations caption = "Ikenaga iterations" hint = "This is the number of iterations for the Ikenaga formula." default = 1 endparam func fn1 caption = "Pre Function" default = atan() endfunc func fn2 caption = "Post Function" default = sinh() endfunc } class REB_TrapShapePlatonicSolids(common.ulb:TrapShape) { public: import "common.ulb" import "reb.ulb" $define debug ; Constructor func REB_TrapShapePlatonicSolids(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; call before each iteration func Init(complex pz) TrapShape.Init(pz) twopi = 2*#pi mx = 0 my = 0 i = 0 x = 0.0 y = 0.0 out = false rotx = @rotx+1e-10 roty = @roty+1e-10 rotz = @rotz+1e-10 if @polygontype == "Tetrahedron" vertex = 4 side = 6 i = 0 vx[0] = 0.5 vy[0] = 0.5 vz[0] = 0.5 vx[1] = -0.5 vy[1] = -0.5 vz[1] = 0.5 vx[2] = 0.5 vy[2] = -0.5 vz[2] = 0.5 vx[3] = -0.5 vy[3] = 0.5 vz[3] = -0.5 repeat rot.rotatex(vx[i],vy[i],vz[i],rotx) rot.rotatey(vx[i],vy[i],vz[i],roty) rot.rotatez(vx[i],vy[i],vz[i],rotz) i = i + 1 until i == vertex i = 0 repeat v[i] = vx[i] + flip(vy[i]) i = i+1 until i == vertex elseif @polygontype == "Cube" vertex = 8 side = 12 i = 0 vx[0] = 0.5 vy[0] = 0.5 vz[0] = 0.5 vx[1] = 0.5 vy[1] = -0.5 vz[1] = 0.5 vx[2] = -0.5 vy[2] = -0.5 vz[2] = 0.5 vx[3] = -0.5 vy[3] = 0.5 vz[3] = 0.5 vx[4] = -0.5 vy[4] = 0.5 vz[4] = -0.5 vx[5] = 0.5 vy[5] = 0.5 vz[5] = -0.5 vx[6] = 0.5 vy[6] = -0.5 vz[6] = -0.5 vx[7] = -0.5 vy[7] = -0.5 vz[7] = -0.5 repeat rot.rotatex(vx[i],vy[i],vz[i],rotx) rot.rotatey(vx[i],vy[i],vz[i],roty) rot.rotatez(vx[i],vy[i],vz[i],rotz) i = i + 1 until i == vertex i = 0 repeat v[i] = vx[i] + flip(vy[i]) i = i+1 until i == vertex elseif @polygontype == "Octahedron" vertex = 6 side = 12 i = 0 vx[0] = 0.7071 vy[0] = 0 vz[0] = 0 vx[1] = 0 vy[1] = -0.7071 vz[1] = 0 vx[2] = 0 vy[2] = 0 vz[2] = 0.7071 vx[3] = 0 vy[3] = 1 vz[3] = 0 vx[4] = -0.7071 vy[4] = 0 vz[4] = 0 vx[5] = 0 vy[5] = 0 vz[5] = -0.7071 repeat rot.rotatex(vx[i],vy[i],vz[i],rotx) rot.rotatey(vx[i],vy[i],vz[i],roty) rot.rotatez(vx[i],vy[i],vz[i],rotz) i = i + 1 until i == vertex i = 0 repeat v[i] = vx[i] + flip(vy[i]) i = i+1 until i == vertex elseif @polygontype == "Icosahedron" vertex = 12 side = 30 i = 0 vx[0] = 0 vy[0] = 0 vz[0] = 1 vx[1] = 0.894 vy[1] = 0 vz[1] = 0.447 vx[2] = 0.276 vy[2] = 0.851 vz[2] = 0.447 vx[3] = -0.724 vy[3] = 0.526 vz[3] = 0.447 vx[4] = -0.724 vy[4] = -0.526 vz[4] = 0.447 vx[5] = 0.276 vy[5] = -0.851 vz[5] = 0.447 vx[6] = 0.724 vy[6] = 0.526 vz[6] = -0.447 vx[7] = -0.276 vy[7] = 0.851 vz[7] = -0.447 vx[8] = -0.894 vy[8] = 0 vz[8] = -0.447 vx[9] = -0.276 vy[9] = -0.851 vz[9] = -0.447 vx[10] = 0.724 vy[10] = -0.526 vz[10] = -0.447 vx[11] = 0 vy[11] = 0 vz[11] = -1 repeat rot.rotatex(vx[i],vy[i],vz[i],rotx) rot.rotatey(vx[i],vy[i],vz[i],roty) rot.rotatez(vx[i],vy[i],vz[i],rotz) i = i + 1 until i == vertex i = 0 repeat v[i] = vx[i] + flip(vy[i]) i = i+1 until i == vertex elseif @polygontype == "Dodecahedron" vertex = 20 side = 30 i = 0 vx[0] = 0.607 vy[0] = 0 vz[0] = 0.795 vx[1] = 0.188 vy[1] = 0.577 vz[1] = 0.795 vx[2] = -0.491 vy[2] = 0.357 vz[2] = 0.795 vx[3] = -0.491 vy[3] = -0.357 vz[3] = 0.795 vx[4] = 0.188 vy[4] = -0.577 vz[4] = 0.795 vx[5] = 0.982 vy[5] = 0 vz[5] = 0.188 vx[6] = 0.304 vy[6] = 0.934 vz[6] = 0.188 vx[7] = -0.795 vy[7] = 0.577 vz[7] = 0.188 vx[8] = -0.894 vy[8] = -0.577 vz[8] = 0.188 vx[9] = 0.304 vy[9] = -0.934 vz[9] = 0.188 vx[10] = 0.795 vy[10] = 0.577 vz[10] = -0.188 vx[11] = -0.304 vy[11] = 0.934 vz[11] = -0.188 vx[12] = -0.982 vy[12] = 0.000 vz[12] = -0.188 vx[13] = -0.304 vy[13] = -0.934 vz[13] = -0.188 vx[14] = 0.795 vy[14] = -0.577 vz[14] = -0.188 vx[15] = 0.491 vy[15] = 0.357 vz[15] = -0.795 vx[16] = -0.188 vy[16] = 0.577 vz[16] = -0.795 vx[17] = -0.607 vy[17] = 0 vz[17] = -0.795 vx[18] = -0.188 vy[18] = -0.577 vz[18] = -0.795 vx[19] = 0.491 vy[19] = -0.357 vz[19] = -0.795 repeat rot.rotatex(vx[i],vy[i],vz[i],rotx) rot.rotatey(vx[i],vy[i],vz[i],roty) rot.rotatez(vx[i],vy[i],vz[i],rotz) i = i + 1 until i == vertex i = 0 repeat v[i] = (vx[i] + flip(vy[i]))/0.713644 i = i+1 until i == vertex endif endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) d = 1e10 size = @size complex pzs = pz/size i = 0 ; ; calculate r[i] and t[i] for first n-1 sides ; if @polygontype == "Tetrahedron" ; ; front face repeat t[i]=(pzs-v[i])/(v[i+1]-v[i]) x=real(t[i]) y=imag(t[i]) if y > 0 out = false endif if(x<0.0) r[i]=sqr(x)+sqr(y) elseif(x>1.0) r[i]=sqr(x-1.0)+sqr(y) else r[i]=sqr(y) endif r[i]=sqrt(r[i])*cabs(v[i+1]-v[i]) i = i + 1 until i == 3 ; ; calculate r[i] and t[i] for the last side of front face ; t[2]=(pzs-v[2])/(v[0]-v[2]) x=real(t[2]) y=imag(t[2]) if y > 0 out = false endif if(x<0.0) r[2]=sqr(x)+sqr(y) elseif(x>1.0) r[2]=sqr(x-1.0)+sqr(y) else r[2]=sqr(y) endif r[2]=sqrt(r[2])*cabs(v[0]-v[2]) ; ; right side ; t[3]=(pzs-v[3])/(v[0]-v[3]) x=real(t[3]) y=imag(t[3]) if y > 0 out = false endif if(x<0.0) r[3]=sqr(x)+sqr(y) elseif(x>1.0) r[3]=sqr(x-1.0)+sqr(y) else r[3]=sqr(y) endif r[3]=sqrt(r[3])*cabs(v[0]-v[3]) t[4]=(pzs-v[3])/(v[1]-v[3]) x=real(t[4]) y=imag(t[4]) if y > 0 out = false endif if(x<0.0) r[4]=sqr(x)+sqr(y) elseif(x>1.0) r[4]=sqr(x-1.0)+sqr(y) else r[4]=sqr(y) endif r[4]=sqrt(r[4])*cabs(v[1]-v[3]) ; ; left side ; t[5]=(pzs-v[3])/(v[2]-v[3]) x=real(t[5]) y=imag(t[5]) if y > 0 out = false endif if(x<0.0) r[5]=sqr(x)+sqr(y) elseif(x>1.0) r[5]=sqr(x-1.0)+sqr(y) else r[5]=sqr(y) endif r[5]=sqrt(r[5])*cabs(v[2]-v[3]) elseif @polygontype == "Cube" ; ; front face repeat t[i]=(pzs-v[i])/(v[i+1]-v[i]) x=real(t[i]) y=imag(t[i]) if y > 0 out = false endif if(x<0.0) r[i]=sqr(x)+sqr(y) elseif(x>1.0) r[i]=sqr(x-1.0)+sqr(y) else r[i]=sqr(y) endif r[i]=sqrt(r[i])*cabs(v[i+1]-v[i]) i = i + 1 until i == (vertex-5) ; ; calculate r[i] and t[i] for the last side of front face ; t[vertex-5]=(pzs-v[vertex-5])/(v[0]-v[vertex-5]) x=real(t[vertex-5]) y=imag(t[vertex-5]) if y > 0 out = false endif if(x<0.0) r[vertex-5]=sqr(x)+sqr(y) elseif(x>1.0) r[vertex-5]=sqr(x-1.0)+sqr(y) else r[vertex-5]=sqr(y) endif r[vertex-5]=sqrt(r[vertex-5])*cabs(v[0]-v[vertex-5]) ; ; top face ; t[4]=(pzs-v[4])/(v[3]-v[4]) x=real(t[4]) y=imag(t[4]) if y > 0 out = false endif if(x<0.0) r[4]=sqr(x)+sqr(y) elseif(x>1.0) r[4]=sqr(x-1.0)+sqr(y) else r[4]=sqr(y) endif r[4]=sqrt(r[4])*cabs(v[3]-v[4]) t[5]=(pzs-v[5])/(v[4]-v[5]) x=real(t[5]) y=imag(t[5]) if y > 0 out = false endif if(x<0.0) r[5]=sqr(x)+sqr(y) elseif(x>1.0) r[5]=sqr(x-1.0)+sqr(y) else r[5]=sqr(y) endif r[5]=sqrt(r[5])*cabs(v[4]-v[5]) t[6]=(pzs-v[5])/(v[0]-v[5]) x=real(t[6]) y=imag(t[6]) if y > 0 out = false endif if(x<0.0) r[6]=sqr(x)+sqr(y) elseif(x>1.0) r[6]=sqr(x-1.0)+sqr(y) else r[6]=sqr(y) endif r[6]=sqrt(r[6])*cabs(v[0]-v[5]) ; ; right face ; t[7]=(pzs-v[6])/(v[1]-v[6]) x=real(t[7]) y=imag(t[7]) if y > 0 out = false endif if(x<0.0) r[7]=sqr(x)+sqr(y) elseif(x>1.0) r[7]=sqr(x-1.0)+sqr(y) else r[7]=sqr(y) endif r[7]=sqrt(r[7])*cabs(v[1]-v[6]) t[8]=(pzs-v[6])/(v[5]-v[6]) x=real(t[8]) y=imag(t[8]) if y > 0 out = false endif if(x<0.0) r[8]=sqr(x)+sqr(y) elseif(x>1.0) r[8]=sqr(x-1.0)+sqr(y) else r[8]=sqr(y) endif r[8]=sqrt(r[8])*cabs(v[5]-v[6]) ; ; bottom face ; t[9]=(pzs-v[7])/(v[2]-v[7]) x=real(t[9]) y=imag(t[9]) if y > 0 out = false endif if(x<0.0) r[9]=sqr(x)+sqr(y) elseif(x>1.0) r[9]=sqr(x-1.0)+sqr(y) else r[9]=sqr(y) endif r[9]=sqrt(r[9])*cabs(v[2]-v[7]) t[10]=(pzs-v[7])/(v[6]-v[7]) x=real(t[10]) y=imag(t[10]) if y > 0 out = false endif if(x<0.0) r[10]=sqr(x)+sqr(y) elseif(x>1.0) r[10]=sqr(x-1.0)+sqr(y) else r[10]=sqr(y) endif r[10]=sqrt(r[10])*cabs(v[6]-v[7]) ; ; back face ; t[11]=(pzs-v[7])/(v[4]-v[7]) x=real(t[11]) y=imag(t[11]) if y > 0 out = false endif if(x<0.0) r[11]=sqr(x)+sqr(y) elseif(x>1.0) r[11]=sqr(x-1.0)+sqr(y) else r[11]=sqr(y) endif r[11]=sqrt(r[11])*cabs(v[4]-v[7]) elseif @polygontype == "Octahedron" ; ; lower right face ; repeat t[i]=(pzs-v[i])/(v[i+1]-v[i]) x=real(t[i]) y=imag(t[i]) if y > 0 out = false endif if(x<0.0) r[i]=sqr(x)+sqr(y) elseif(x>1.0) r[i]=sqr(x-1.0)+sqr(y) else r[i]=sqr(y) endif r[i]=sqrt(r[i])*cabs(v[i+1]-v[i]) i = i + 1 until i == 3 ; endif t[2]=(pzs-v[2])/(v[0]-v[2]) x=real(t[2]) y=imag(t[2]) if y > 0 out = false endif if(x<0.0) r[2]=sqr(x)+sqr(y) elseif(x>1.0) r[2]=sqr(x-1.0)+sqr(y) else r[2]=sqr(y) endif r[2]=sqrt(r[2])*cabs(v[0]-v[2]) ; ; upper right face ; t[3]=(pzs-v[3])/(v[0]-v[3]) x=real(t[3]) y=imag(t[3]) if y > 0 out = false endif if(x<0.0) r[3]=sqr(x)+sqr(y) elseif(x>1.0) r[3]=sqr(x-1.0)+sqr(y) else r[3]=sqr(y) endif r[3]=sqrt(r[3])*cabs(v[0]-v[3]) t[7]=(pzs-v[3])/(v[2]-v[3]) x=real(t[7]) y=imag(t[7]) if y > 0 out = false endif if(x<0.0) r[7]=sqr(x)+sqr(y) elseif(x>1.0) r[7]=sqr(x-1.0)+sqr(y) else r[7]=sqr(y) endif r[7]=sqrt(r[7])*cabs(v[2]-v[3]) ; ; lower left face ; t[4]=(pzs-v[4])/(v[1]-v[4]) x=real(t[4]) y=imag(t[4]) if y > 0 out = false endif if(x<0.0) r[4]=sqr(x)+sqr(y) elseif(x>1.0) r[4]=sqr(x-1.0)+sqr(y) else r[4]=sqr(y) endif r[4]=sqrt(r[4])*cabs(v[1]-v[4]) t[6]=(pzs-v[4])/(v[2]-v[4]) x=real(t[6]) y=imag(t[6]) if y > 0 out = false endif if(x<0.0) r[6]=sqr(x)+sqr(y) elseif(x>1.0) r[6]=sqr(x-1.0)+sqr(y) else r[6]=sqr(y) endif r[6]=sqrt(r[6])*cabs(v[2]-v[4]) ; ; upper left face ; t[7]=(pzs-v[3])/(v[2]-v[3]) x=real(t[7]) y=imag(t[7]) if y > 0 out = false endif if(x<0.0) r[7]=sqr(x)+sqr(y) elseif(x>1.0) r[7]=sqr(x-1.0)+sqr(y) else r[7]=sqr(y) endif r[7]=sqrt(r[7])*cabs(v[2]-v[3]) t[5]=(pzs-v[4])/(v[3]-v[4]) x=real(t[5]) y=imag(t[5]) if y > 0 out = false endif if(x<0.0) r[5]=sqr(x)+sqr(y) elseif(x>1.0) r[5]=sqr(x-1.0)+sqr(y) else r[5]=sqr(y) endif r[5]=sqrt(r[5])*cabs(v[3]-v[4]) ; ; lower right face back ; t[8]=(pzs-v[5])/(v[0]-v[5]) x=real(t[8]) y=imag(t[8]) if y > 0 out = false endif if(x<0.0) r[8]=sqr(x)+sqr(y) elseif(x>1.0) r[8]=sqr(x-1.0)+sqr(y) else r[8]=sqr(y) endif r[8]=sqrt(r[8])*cabs(v[0]-v[5]) t[9]=(pzs-v[5])/(v[1]-v[5]) x=real(t[9]) y=imag(t[9]) if y > 0 out = false endif if(x<0.0) r[9]=sqr(x)+sqr(y) elseif(x>1.0) r[9]=sqr(x-1.0)+sqr(y) else r[9]=sqr(y) endif r[9]=sqrt(r[9])*cabs(v[1]-v[5]) ; ; upper right face back ; t[10]=(pzs-v[5])/(v[3]-v[5]) x=real(t[10]) y=imag(t[10]) if y > 0 out = false endif if(x<0.0) r[10]=sqr(x)+sqr(y) elseif(x>1.0) r[10]=sqr(x-1.0)+sqr(y) else r[10]=sqr(y) endif r[10]=sqrt(r[10])*cabs(v[3]-v[5]) ; ; upper left face back ; t[11]=(pzs-v[5])/(v[4]-v[5]) x=real(t[11]) y=imag(t[11]) if y > 0 out = false endif if(x<0.0) r[11]=sqr(x)+sqr(y) elseif(x>1.0) r[11]=sqr(x-1.0)+sqr(y) else r[11]=sqr(y) endif r[11]=sqrt(r[11])*cabs(v[4]-v[5]) elseif @polygontype == "Icosahedron" ; ; 0,1,2 ; repeat t[i]=(pzs-v[i])/(v[i+1]-v[i]) x=real(t[i]) y=imag(t[i]) if y > 0 out = false endif if(x<0.0) r[i]=sqr(x)+sqr(y) elseif(x>1.0) r[i]=sqr(x-1.0)+sqr(y) else r[i]=sqr(y) endif r[i]=sqrt(r[i])*cabs(v[i+1]-v[i]) i = i + 1 until i == 3 ; endif t[2]=(pzs-v[2])/(v[0]-v[2]) x=real(t[2]) y=imag(t[2]) if y > 0 out = false endif if(x<0.0) r[2]=sqr(x)+sqr(y) elseif(x>1.0) r[2]=sqr(x-1.0)+sqr(y) else r[2]=sqr(y) endif r[2]=sqrt(r[2])*cabs(v[0]-v[2]) ; ; 0,2,3 ; t[3]=(pzs-v[3])/(v[0]-v[3]) x=real(t[3]) y=imag(t[3]) if y > 0 out = false endif if(x<0.0) r[3]=sqr(x)+sqr(y) elseif(x>1.0) r[3]=sqr(x-1.0)+sqr(y) else r[3]=sqr(y) endif r[3]=sqrt(r[3])*cabs(v[0]-v[3]) t[4]=(pzs-v[3])/(v[2]-v[3]) x=real(t[4]) y=imag(t[4]) if y > 0 out = false endif if(x<0.0) r[4]=sqr(x)+sqr(y) elseif(x>1.0) r[4]=sqr(x-1.0)+sqr(y) else r[4]=sqr(y) endif r[4]=sqrt(r[4])*cabs(v[2]-v[3]) ; ; 0,3,4 ; t[5]=(pzs-v[3])/(v[4]-v[3]) x=real(t[5]) y=imag(t[5]) if y > 0 out = false endif if(x<0.0) r[5]=sqr(x)+sqr(y) elseif(x>1.0) r[5]=sqr(x-1.0)+sqr(y) else r[5]=sqr(y) endif r[5]=sqrt(r[5])*cabs(v[4]-v[3]) t[6]=(pzs-v[4])/(v[0]-v[4]) x=real(t[6]) y=imag(t[6]) if y > 0 out = false endif if(x<0.0) r[6]=sqr(x)+sqr(y) elseif(x>1.0) r[6]=sqr(x-1.0)+sqr(y) else r[6]=sqr(y) endif r[6]=sqrt(r[6])*cabs(v[0]-v[4]) ; ; 0,4,5 ; t[7]=(pzs-v[5])/(v[4]-v[5]) x=real(t[7]) y=imag(t[7]) if y > 0 out = false endif if(x<0.0) r[7]=sqr(x)+sqr(y) elseif(x>1.0) r[7]=sqr(x-1.0)+sqr(y) else r[7]=sqr(y) endif r[7]=sqrt(r[7])*cabs(v[4]-v[5]) t[8]=(pzs-v[0])/(v[5]-v[0]) x=real(t[8]) y=imag(t[8]) if y > 0 out = false endif if(x<0.0) r[8]=sqr(x)+sqr(y) elseif(x>1.0) r[8]=sqr(x-1.0)+sqr(y) else r[8]=sqr(y) endif r[8]=sqrt(r[8])*cabs(v[5]-v[0]) ; ; 0,5,1 ; t[9]=(pzs-v[5])/(v[1]-v[5]) x=real(t[9]) y=imag(t[9]) if y > 0 out = false endif if(x<0.0) r[9]=sqr(x)+sqr(y) elseif(x>1.0) r[9]=sqr(x-1.0)+sqr(y) else r[9]=sqr(y) endif r[9]=sqrt(r[9])*cabs(v[1]-v[5]) ; ; 1,2,6 ; t[10]=(pzs-v[6])/(v[1]-v[6]) x=real(t[10]) y=imag(t[10]) if y > 0 out = false endif if(x<0.0) r[10]=sqr(x)+sqr(y) elseif(x>1.0) r[10]=sqr(x-1.0)+sqr(y) else r[10]=sqr(y) endif r[10]=sqrt(r[10])*cabs(v[1]-v[6]) t[11]=(pzs-v[6])/(v[2]-v[6]) x=real(t[11]) y=imag(t[11]) if y > 0 out = false endif if(x<0.0) r[11]=sqr(x)+sqr(y) elseif(x>1.0) r[11]=sqr(x-1.0)+sqr(y) else r[11]=sqr(y) endif r[11]=sqrt(r[11])*cabs(v[2]-v[6]) ; ; 2,3,7 ; t[12]=(pzs-v[7])/(v[2]-v[7]) x=real(t[12]) y=imag(t[12]) if y > 0 out = false endif if(x<0.0) r[12]=sqr(x)+sqr(y) elseif(x>1.0) r[12]=sqr(x-1.0)+sqr(y) else r[12]=sqr(y) endif r[12]=sqrt(r[12])*cabs(v[2]-v[7]) t[13]=(pzs-v[7])/(v[3]-v[7]) x=real(t[13]) y=imag(t[13]) if y > 0 out = false endif if(x<0.0) r[13]=sqr(x)+sqr(y) elseif(x>1.0) r[13]=sqr(x-1.0)+sqr(y) else r[13]=sqr(y) endif r[13]=sqrt(r[13])*cabs(v[3]-v[7]) ; ; 3,4,8 ; t[14]=(pzs-v[8])/(v[3]-v[8]) x=real(t[14]) y=imag(t[14]) if y > 0 out = false endif if(x<0.0) r[14]=sqr(x)+sqr(y) elseif(x>1.0) r[14]=sqr(x-1.0)+sqr(y) else r[14]=sqr(y) endif r[14]=sqrt(r[14])*cabs(v[3]-v[8]) t[15]=(pzs-v[8])/(v[4]-v[8]) x=real(t[15]) y=imag(t[15]) if y > 0 out = false endif if(x<0.0) r[15]=sqr(x)+sqr(y) elseif(x>1.0) r[15]=sqr(x-1.0)+sqr(y) else r[15]=sqr(y) endif r[15]=sqrt(r[15])*cabs(v[4]-v[8]) ; ; 4,5,9 ; t[16]=(pzs-v[9])/(v[4]-v[9]) x=real(t[16]) y=imag(t[16]) if y > 0 out = false endif if(x<0.0) r[16]=sqr(x)+sqr(y) elseif(x>1.0) r[16]=sqr(x-1.0)+sqr(y) else r[16]=sqr(y) endif r[16]=sqrt(r[16])*cabs(v[4]-v[9]) t[17]=(pzs-v[9])/(v[5]-v[9]) x=real(t[17]) y=imag(t[17]) if y > 0 out = false endif if(x<0.0) r[17]=sqr(x)+sqr(y) elseif(x>1.0) r[17]=sqr(x-1.0)+sqr(y) else r[17]=sqr(y) endif r[17]=sqrt(r[17])*cabs(v[5]-v[9]) ; ; 5,1,10 ; t[18]=(pzs-v[10])/(v[1]-v[10]) x=real(t[18]) y=imag(t[18]) if y > 0 out = false endif if(x<0.0) r[18]=sqr(x)+sqr(y) elseif(x>1.0) r[18]=sqr(x-1.0)+sqr(y) else r[18]=sqr(y) endif r[18]=sqrt(r[18])*cabs(v[1]-v[10]) t[19]=(pzs-v[10])/(v[5]-v[10]) x=real(t[19]) y=imag(t[19]) if y > 0 out = false endif if(x<0.0) r[19]=sqr(x)+sqr(y) elseif(x>1.0) r[19]=sqr(x-1.0)+sqr(y) else r[19]=sqr(y) endif r[19]=sqrt(r[19])*cabs(v[5]-v[10]) ; ; 6,7,2 ; t[20]=(pzs-v[7])/(v[6]-v[7]) x=real(t[20]) y=imag(t[20]) if y > 0 out = false endif if(x<0.0) r[20]=sqr(x)+sqr(y) elseif(x>1.0) r[20]=sqr(x-1.0)+sqr(y) else r[20]=sqr(y) endif r[20]=sqrt(r[20])*cabs(v[6]-v[7]) ; ; 7,8,3 ; t[21]=(pzs-v[8])/(v[7]-v[8]) x=real(t[21]) y=imag(t[21]) if y > 0 out = false endif if(x<0.0) r[21]=sqr(x)+sqr(y) elseif(x>1.0) r[21]=sqr(x-1.0)+sqr(y) else r[21]=sqr(y) endif r[21]=sqrt(r[21])*cabs(v[7]-v[8]) ; ; 8,9,4 ; t[22]=(pzs-v[9])/(v[8]-v[9]) x=real(t[22]) y=imag(t[22]) if y > 0 out = false endif if(x<0.0) r[22]=sqr(x)+sqr(y) elseif(x>1.0) r[22]=sqr(x-1.0)+sqr(y) else r[22]=sqr(y) endif r[22]=sqrt(r[22])*cabs(v[8]-v[9]) ; ; 9,10,5 ; t[23]=(pzs-v[9])/(v[10]-v[9]) x=real(t[23]) y=imag(t[23]) if y > 0 out = false endif if(x<0.0) r[23]=sqr(x)+sqr(y) elseif(x>1.0) r[23]=sqr(x-1.0)+sqr(y) else r[23]=sqr(y) endif r[23]=sqrt(r[23])*cabs(v[10]-v[9]) ; ; 10,6,1 ; t[24]=(pzs-v[6])/(v[10]-v[6]) x=real(t[24]) y=imag(t[24]) if y > 0 out = false endif if(x<0.0) r[24]=sqr(x)+sqr(y) elseif(x>1.0) r[24]=sqr(x-1.0)+sqr(y) else r[24]=sqr(y) endif r[24]=sqrt(r[24])*cabs(v[10]-v[6]) ; ; 11,6,7 ; t[25]=(pzs-v[11])/(v[6]-v[11]) x=real(t[25]) y=imag(t[25]) if y > 0 out = false endif if(x<0.0) r[25]=sqr(x)+sqr(y) elseif(x>1.0) r[25]=sqr(x-1.0)+sqr(y) else r[25]=sqr(y) endif r[25]=sqrt(r[25])*cabs(v[6]-v[11]) t[26]=(pzs-v[11])/(v[7]-v[11]) x=real(t[26]) y=imag(t[26]) if y > 0 out = false endif if(x<0.0) r[26]=sqr(x)+sqr(y) elseif(x>1.0) r[26]=sqr(x-1.0)+sqr(y) else r[26]=sqr(y) endif r[26]=sqrt(r[26])*cabs(v[7]-v[11]) ; ; 11,7,8 ; t[27]=(pzs-v[11])/(v[8]-v[11]) x=real(t[27]) y=imag(t[27]) if y > 0 out = false endif if(x<0.0) r[27]=sqr(x)+sqr(y) elseif(x>1.0) r[27]=sqr(x-1.0)+sqr(y) else r[27]=sqr(y) endif r[27]=sqrt(r[27])*cabs(v[8]-v[11]) ; ; 11,8,9 ; t[28]=(pzs-v[11])/(v[9]-v[11]) x=real(t[28]) y=imag(t[28]) if y > 0 out = false endif if(x<0.0) r[28]=sqr(x)+sqr(y) elseif(x>1.0) r[28]=sqr(x-1.0)+sqr(y) else r[28]=sqr(y) endif r[28]=sqrt(r[28])*cabs(v[9]-v[11]) ; ; 11,9,10 ; t[29]=(pzs-v[11])/(v[10]-v[11]) x=real(t[29]) y=imag(t[29]) if y > 0 out = false endif if(x<0.0) r[29]=sqr(x)+sqr(y) elseif(x>1.0) r[29]=sqr(x-1.0)+sqr(y) else r[29]=sqr(y) endif r[29]=sqrt(r[29])*cabs(v[10]-v[11]) elseif @polygontype == "Dodecahedron" ; ; 0,1,2,3,4 ; repeat t[i]=(pzs-v[i])/(v[i+1]-v[i]) x=real(t[i]) y=imag(t[i]) if y > 0 out = false endif if(x<0.0) r[i]=sqr(x)+sqr(y) elseif(x>1.0) r[i]=sqr(x-1.0)+sqr(y) else r[i]=sqr(y) endif r[i]=sqrt(r[i])*cabs(v[i+1]-v[i]) i = i + 1 until i == 5 t[4]=(pzs-v[4])/(v[0]-v[4]) x=real(t[4]) y=imag(t[4]) if y > 0 out = false endif if(x<0.0) r[4]=sqr(x)+sqr(y) elseif(x>1.0) r[4]=sqr(x-1.0)+sqr(y) else r[4]=sqr(y) endif r[4]=sqrt(r[4])*cabs(v[0]-v[4]) ; ; 0,1,6,10,5 ; t[5]=(pzs-v[5])/(v[0]-v[5]) x=real(t[5]) y=imag(t[5]) if y > 0 out = false endif if(x<0.0) r[5]=sqr(x)+sqr(y) elseif(x>1.0) r[5]=sqr(x-1.0)+sqr(y) else r[5]=sqr(y) endif r[5]=sqrt(r[5])*cabs(v[0]-v[5]) t[6]=(pzs-v[5])/(v[10]-v[5]) x=real(t[6]) y=imag(t[6]) if y > 0 out = false endif if(x<0.0) r[6]=sqr(x)+sqr(y) elseif(x>1.0) r[6]=sqr(x-1.0)+sqr(y) else r[6]=sqr(y) endif r[6]=sqrt(r[6])*cabs(v[10]-v[5]) t[7]=(pzs-v[6])/(v[10]-v[6]) x=real(t[7]) y=imag(t[7]) if y > 0 out = false endif if(x<0.0) r[7]=sqr(x)+sqr(y) elseif(x>1.0) r[7]=sqr(x-1.0)+sqr(y) else r[7]=sqr(y) endif r[7]=sqrt(r[7])*cabs(v[10]-v[6]) t[8]=(pzs-v[6])/(v[1]-v[6]) x=real(t[8]) y=imag(t[8]) if y > 0 out = false endif if(x<0.0) r[8]=sqr(x)+sqr(y) elseif(x>1.0) r[8]=sqr(x-1.0)+sqr(y) else r[8]=sqr(y) endif r[8]=sqrt(r[8])*cabs(v[1]-v[6]) ; ; 1,2,7,11,6 ; t[9]=(pzs-v[7])/(v[2]-v[7]) x=real(t[9]) y=imag(t[9]) if y > 0 out = false endif if(x<0.0) r[9]=sqr(x)+sqr(y) elseif(x>1.0) r[9]=sqr(x-1.0)+sqr(y) else r[9]=sqr(y) endif r[9]=sqrt(r[9])*cabs(v[2]-v[7]) ; t[10]=(pzs-v[11])/(v[7]-v[11]) x=real(t[10]) y=imag(t[10]) if y > 0 out = false endif if(x<0.0) r[10]=sqr(x)+sqr(y) elseif(x>1.0) r[10]=sqr(x-1.0)+sqr(y) else r[10]=sqr(y) endif r[10]=sqrt(r[10])*cabs(v[7]-v[11]) t[11]=(pzs-v[11])/(v[6]-v[11]) x=real(t[11]) y=imag(t[11]) if y > 0 out = false endif if(x<0.0) r[11]=sqr(x)+sqr(y) elseif(x>1.0) r[11]=sqr(x-1.0)+sqr(y) else r[11]=sqr(y) endif r[11]=sqrt(r[11])*cabs(v[6]-v[11]) ; ; 2,3,8,12,7 ; t[12]=(pzs-v[8])/(v[3]-v[8]) x=real(t[12]) y=imag(t[12]) if y > 0 out = false endif if(x<0.0) r[12]=sqr(x)+sqr(y) elseif(x>1.0) r[12]=sqr(x-1.0)+sqr(y) else r[12]=sqr(y) endif r[12]=sqrt(r[12])*cabs(v[3]-v[8]) t[13]=(pzs-v[12])/(v[8]-v[12]) x=real(t[13]) y=imag(t[13]) if y > 0 out = false endif if(x<0.0) r[13]=sqr(x)+sqr(y) elseif(x>1.0) r[13]=sqr(x-1.0)+sqr(y) else r[13]=sqr(y) endif r[13]=sqrt(r[13])*cabs(v[8]-v[12]) t[14]=(pzs-v[12])/(v[7]-v[12]) x=real(t[14]) y=imag(t[14]) if y > 0 out = false endif if(x<0.0) r[14]=sqr(x)+sqr(y) elseif(x>1.0) r[14]=sqr(x-1.0)+sqr(y) else r[14]=sqr(y) endif r[14]=sqrt(r[14])*cabs(v[7]-v[12]) ; ; 3,4,9,13,8 ; t[15]=(pzs-v[9])/(v[4]-v[9]) x=real(t[15]) y=imag(t[15]) if y > 0 out = false endif if(x<0.0) r[15]=sqr(x)+sqr(y) elseif(x>1.0) r[15]=sqr(x-1.0)+sqr(y) else r[15]=sqr(y) endif r[15]=sqrt(r[15])*cabs(v[4]-v[9]) t[16]=(pzs-v[13])/(v[9]-v[13]) x=real(t[16]) y=imag(t[16]) if y > 0 out = false endif if(x<0.0) r[16]=sqr(x)+sqr(y) elseif(x>1.0) r[16]=sqr(x-1.0)+sqr(y) else r[16]=sqr(y) endif r[16]=sqrt(r[16])*cabs(v[9]-v[13]) t[17]=(pzs-v[8])/(v[13]-v[8]) x=real(t[17]) y=imag(t[17]) if y > 0 out = false endif if(x<0.0) r[17]=sqr(x)+sqr(y) elseif(x>1.0) r[17]=sqr(x-1.0)+sqr(y) else r[17]=sqr(y) endif r[17]=sqrt(r[17])*cabs(v[13]-v[8]) ; ; 4,0,5,14,9 ; t[18]=(pzs-v[5])/(v[14]-v[5]) x=real(t[18]) y=imag(t[18]) if y > 0 out = false endif if(x<0.0) r[18]=sqr(x)+sqr(y) elseif(x>1.0) r[18]=sqr(x-1.0)+sqr(y) else r[18]=sqr(y) endif r[18]=sqrt(r[18])*cabs(v[14]-v[5]) t[19]=(pzs-v[9])/(v[14]-v[9]) x=real(t[19]) y=imag(t[19]) if y > 0 out = false endif if(x<0.0) r[19]=sqr(x)+sqr(y) elseif(x>1.0) r[19]=sqr(x-1.0)+sqr(y) else r[19]=sqr(y) endif r[19]=sqrt(r[19])*cabs(v[14]-v[9]) ; ; 15,16,11,6,10 ; t[20]=(pzs-v[16])/(v[11]-v[16]) x=real(t[20]) y=imag(t[20]) if y > 0 out = false endif if(x<0.0) r[20]=sqr(x)+sqr(y) elseif(x>1.0) r[20]=sqr(x-1.0)+sqr(y) else r[20]=sqr(y) endif r[20]=sqrt(r[20])*cabs(v[11]-v[16]) t[21]=(pzs-v[15])/(v[16]-v[15]) x=real(t[21]) y=imag(t[21]) if y > 0 out = false endif if(x<0.0) r[21]=sqr(x)+sqr(y) elseif(x>1.0) r[21]=sqr(x-1.0)+sqr(y) else r[21]=sqr(y) endif r[21]=sqrt(r[21])*cabs(v[16]-v[15]) t[22]=(pzs-v[10])/(v[15]-v[10]) x=real(t[22]) y=imag(t[22]) if y > 0 out = false endif if(x<0.0) r[22]=sqr(x)+sqr(y) elseif(x>1.0) r[22]=sqr(x-1.0)+sqr(y) else r[22]=sqr(y) endif r[22]=sqrt(r[22])*cabs(v[15]-v[10]) ; ; 16,17,12,7,11 ; t[23]=(pzs-v[17])/(v[12]-v[17]) x=real(t[23]) y=imag(t[23]) if y > 0 out = false endif if(x<0.0) r[23]=sqr(x)+sqr(y) elseif(x>1.0) r[23]=sqr(x-1.0)+sqr(y) else r[23]=sqr(y) endif r[23]=sqrt(r[23])*cabs(v[12]-v[17]) t[24]=(pzs-v[16])/(v[17]-v[16]) x=real(t[24]) y=imag(t[24]) if y > 0 out = false endif if(x<0.0) r[24]=sqr(x)+sqr(y) elseif(x>1.0) r[24]=sqr(x-1.0)+sqr(y) else r[24]=sqr(y) endif r[24]=sqrt(r[24])*cabs(v[17]-v[16]) ; ; 17,18,13,8,12 ; t[25]=(pzs-v[18])/(v[13]-v[18]) x=real(t[25]) y=imag(t[25]) if y > 0 out = false endif if(x<0.0) r[25]=sqr(x)+sqr(y) elseif(x>1.0) r[25]=sqr(x-1.0)+sqr(y) else r[25]=sqr(y) endif r[25]=sqrt(r[25])*cabs(v[13]-v[18]) t[26]=(pzs-v[17])/(v[18]-v[17]) x=real(t[26]) y=imag(t[26]) if y > 0 out = false endif if(x<0.0) r[26]=sqr(x)+sqr(y) elseif(x>1.0) r[26]=sqr(x-1.0)+sqr(y) else r[26]=sqr(y) endif r[26]=sqrt(r[26])*cabs(v[18]-v[17]) ; ; 18,19,14,9,13 ; t[27]=(pzs-v[19])/(v[14]-v[19]) x=real(t[27]) y=imag(t[27]) if y > 0 out = false endif if(x<0.0) r[27]=sqr(x)+sqr(y) elseif(x>1.0) r[27]=sqr(x-1.0)+sqr(y) else r[27]=sqr(y) endif r[27]=sqrt(r[27])*cabs(v[14]-v[19]) t[28]=(pzs-v[18])/(v[19]-v[18]) x=real(t[28]) y=imag(t[28]) if y > 0 out = false endif if(x<0.0) r[28]=sqr(x)+sqr(y) elseif(x>1.0) r[28]=sqr(x-1.0)+sqr(y) else r[28]=sqr(y) endif r[28]=sqrt(r[28])*cabs(v[19]-v[18]) ; ; 19,15,10,5,14 ; t[29]=(pzs-v[15])/(v[19]-v[15]) x=real(t[29]) y=imag(t[29]) if y > 0 out = false endif if(x<0.0) r[29]=sqr(x)+sqr(y) elseif(x>1.0) r[29]=sqr(x-1.0)+sqr(y) else r[29]=sqr(y) endif r[29]=sqrt(r[29])*cabs(v[19]-v[15]) endif i = 0 repeat if r[i] < @thick if r[i] != 0 d = r[i] endif m_LastZ = m_LastZ + t[i] endif i = i + 1 until i == side m_lastZ = m_lastZ/(side)^2 return d endfunc protected: float r[30] float vx[20] float vy[20] float vz[20] complex v[30] complex t[30] float twopi int seed float mx float my int i float x float y bool out int vertex int side float d float rotx float roty float rotz default: title = "Platonic Solids" int param v_trapshapeplatonicsolids caption = "Version (Trap Shape Platonic Solids)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeplatonicsolids < 100 endparam heading text = "This is a TrapShape that is still under development. I will try to \ maintain backwards compatibility, but I cannot guarantee it. The \ Trapshape creates solid and outline regular polygons from 3 sides \ to 10 sides." endheading param polygontype caption = "Polygon Type" default = 1 enum = "Tetrahedron" "Cube" "Octahedron" "Icosahedron" "Dodecahedron" endparam heading text = "Rotations around the X, Y and Z axes." endheading float param rotx caption = "X axis" default = 20 endparam float param roty caption = "Y axis" default = 20 endparam float param rotz caption = "Z axis" default = 0 endparam float param size caption = "Polygon size" default = 0.2 endparam float param thick caption = "Line thickness" default = 0.02 endparam } class REB_TrapShapeSolid_OutlinePolygons(common.ulb:TrapShape) { public: import "common.ulb" import "reb.ulb" $define debug ; Constructor func REB_TrapShapeSolid_OutlinePolygons(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; call before each iteration func Init(complex pz) TrapShape.Init(pz) twopi = 2*#pi seed = @mseed mx = 0 my = 0 i = 0 x = 0.0 y = 0.0 out = false repeat if @morph seed = random (seed) mx = 0.1*seed/#randomrange seed = random(seed) my = 0.1*seed/#randomrange endif if @inside vx[i] = sin(i*twopi/@sides)*(1+10*mx/@sides) vy[i] = cos(i*twopi/@sides)*(1+10*my/@sides) else vx[i] = cos(i*twopi/@sides)*(1+10*mx/@sides) vy[i] = sin(i*twopi/@sides)*(1+10*my/@sides) endif v[i] = vx[i] + flip(vy[i]) i = i + 1 until i == @sides endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) complex lim = (100,0) if !@inside d = 1e10 else d = 0 endif size = @size if @inside if @sides == 3 size = size/350.877 elseif @sides == 4 size = size/200.000 elseif @sides == 5 size = size/145.985 elseif @sides == 6 size = size/115.607 elseif @sides == 7 size = size/96.618 elseif @sides == 8 size = size/82.987 elseif @sides == 9 size = size/72.993 elseif @sides == 10 size = size/65.146 endif endif complex pzs = pz/size i = 0 ; ; calculate r[i] and t[i] for first n-1 sides ; repeat t[i]=(pzs-v[i])/(v[i+1]-v[i]) x=real(t[i]) y=imag(t[i]) if y > 0 out = false endif if(x<0.0) r[i]=sqr(x)+sqr(y) elseif(x>1.0) r[i]=sqr(x-1.0)+sqr(y) else r[i]=sqr(y) endif r[i]=sqrt(r[i])*cabs(v[i+1]-v[i]) i = i + 1 until i == (@sides-1) ; ; calculate r[i] and t[i] for the last side ; t[@sides-1]=(pzs-v[@sides-1])/(v[0]-v[@sides-1]) x=real(t[@sides-1]) y=imag(t[@sides-1]) if y > 0 out = false endif if(x<0.0) r[@sides-1]=sqr(x)+sqr(y) elseif(x>1.0) r[@sides-1]=sqr(x-1.0)+sqr(y) else r[@sides-1]=sqr(y) endif r[@sides-1]=sqrt(r[@sides-1])*cabs(v[0]-v[@sides-1]) i = 0 repeat if ((r[i] < @thick)&&!@inside) || (!out && t[i] > lim) d = r[i] m_LastZ = m_LastZ + t[i] endif i = i + 1 until i == @sides m_lastZ = m_lastZ/@sides^2 return d endfunc protected: complex v[10] complex t[10] float r[10] float vx[10] float vy[10] float twopi int seed float mx float my int i float x float y bool out float d default: title = "Polygons" int param v_trapshapesolidpolygon caption = "Version (Trap Shape Solid and Outlined Polygons)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesolidpolygon < 100 endparam heading text = "This is a TrapShape that is still under development. I will try to \ maintain backwards compatibility, but I cannot guarantee it. The \ Trapshape creates solid and outline regular polygons from 3 sides \ to 10 sides." endheading int param sides caption="# of sides" default = 5 min = 3 max = 10 endparam float param size caption = "Polygon size" default = 0.2 endparam float param thick caption = "Line thickness" default = 0.02 visible = !@inside endparam bool param morph caption="Morph the polygon" default=false endparam int param mseed caption = "Morph seed" default = 123456789 visible = @morph endparam bool param inside caption = "Solid Polygon" default = false endparam } class REB_RangeColoringWrapper(common.ulb:TrapShape) { ; Based upone JLB_Range Coloring. public: import "common.ulb" ; Constructor func REB_RangeColoringWrapper(Generic pparent) TrapShape.TrapShape(pparent) m_TrapShape = new @f_TrapShape(this) endfunc func Init(complex pz) m_TrapShape.Init(pz) m_RangeLow = @p_scale*(1.0-0.5*@p_width) m_RangeHigh = @p_scale*(1.0+0.5*@p_width) ang = -@p_rot*#pi/180 m_Rotate = cos(ang) + flip(sin(ang)) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) pz = pz * m_Rotate dist = m_TrapShape.Iterate(pz) m_LastZ = m_TrapShape.m_LastZ dmin = dist*m_RangeLow dmax = dist*m_RangeHigh dist = cabs(pz - @p_Center) if((dist >= dmin) && (dist <= dmax)) ; in the range dist = (dist-dmin)/(dmax-dmin) ; 0 <= dist <= 1 else dist = 1e100 endif return dist endfunc trapshape m_trapshape float m_RangeLow float m_RangeHigh complex m_Rotate float dist float dmin float dmax float ang default: title = "Range Coloring Wrapper" int param v_RangeColoringWrapper caption = "Version (Range Coloring Wrapper)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_RangeColoringWrapper < 100 endparam TrapShape param f_TrapShape caption = "TrapShape" default = REB_TrapShapeBifolium endparam param p_scale caption = "Range scale" default = 0.9 endparam param p_width caption = "Range width" default = 0.1 endparam complex param p_Center caption = "Curve center" default = (0.0,0.0) endparam float param p_rot caption = "Rotation angle" default = 0.0 hint = "degrees" endparam } class TrapShapeDoodads(common.ulb:TrapShape) { ; transcribed from the Doodads traps of Dennis Magar. ; I have been unable to contact Dennis. If he objects I will remove ; the trapshape. public: import "common.ulb" func TrapShapeDoodads(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; call before each iteration func Init(complex pz) TrapShape.Init(pz) x = 0 y = 0 zr = 0 zi = 0 zz = 0 z1 = 0 a2 = 0 s1 = 0 g1 = 0 ff = 0 gc = 0 zc = 0 fc = 0 zr1 = 0 zi1 = 0 fmr = real(@fm) fmi = imag(@fm) sn = 1 if @m % 2 == 1 sn = -1 endif vsa = sn*@sa/10 vsb = abs(@sb/10) endfunc ; call for each iterated point float func Iterate(complex pz) TrapShape.Iterate(pz) z1 = pz zc = @fn4(z1) zr = real(zc) zi = imag(zc) if (@m > 3 && @m < 26) || @mr == 5 || @mr == 8 \ || @mr == 9 || @mr == 12 gc = @fn3(@fn1(@fn2(z1))) g1 = cabs(gc) endif if @m == 7 || @mr == 5 a2 = atan2(gc) endif if @m == 8 || @m == 9 || @m == 12 || @m == 13 \ || @m > 19 || @mr == 9 || @mr == 11 s1 = cabs(zc) endif if @m == 12 || @m == 13 || @m == 22 || @m == 23 \ || @m == 26 || @m == 27 || @mr == 10 || @mr == 12 ff = cabs(@fn3(@fn1(real(z1))+@fn2(imag(z1)))) endif if @m >27 fc = @fn3(@fn1(real(z1))+flip(@fn2(imag(z1)))) endif if @mr < 5 || @mr >= 13 zr1 = real(@fn1(zr*fmr)) zi1 = real(@fn2(zi*fmi)) endif if @mrf zr1 = abs(zr1) zi1 = abs(zi1) endif if @mr == 0 zz = real(@fn3(zr1*zi1)) elseif @mr == 1 zz = real(@fn3(zr1+zi1)) elseif @mr == 2 zz = real(@fn3(zr1/zi1)) elseif @mr == 3 zz = real(@fn3(zi1^zr1)) elseif @mr == 4 zz = real(@fn3(zr1^zi1)) elseif @mr == 5 zz = real(@fn4(@fn3(abs(@fn1(g1*fmr)-@fn2(a2*fmi))))) elseif @mr == 6 if !@mrf zz = real(atan(@fn3(@fn1(zr*fmr)) \ /(@fn3(@fn2(zi^2*fmi))))) else zz = real(atan(@fn3(abs(@fn1(zr*fmr)) \ /(@fn3(abs(@fn2(zi^2*fmi))))))) endif elseif @mr == 7 zz = cabs(recip(@fn3(@fn2(@fn1(zc*fmr*2))))) elseif @mr == 8 zz = real(@fn3(@fn1(abs((g1-zr)*fmr/(g1-zi)*fmi))))^.1 elseif @mr == 9 float temp = abs((g1-zr)*fmr/(g1+1e-20)) zz = real(@fn3(abs(@fn1(temp)-@fn2(s1*fmi)))) elseif @mr == 10 zz = cabs(@fn4(ff*fmr-gc*fmi))^2 elseif @mr == 11 zz = cabs(@fn4(s1-1)*fmr/(s1+1)*fmi) elseif @mr == 12 zz = cabs(@fn4(g1)*fmr/(ff)*fmi) elseif @mr == 13 zz = real(@fn3(zi1/zr1)) elseif @mr == 14 zz = real(@fn3((zi1*zr1)/(zi1+zr1))) elseif @mr == 15 zz = real(@fn3((zi1-zr1)/(zi1+zr1))) endif if @m < 2 y = zr elseif @m == 2 || @m == 3 y = zr*3-zi elseif @m == 4 y = abs(g1^3/(zr-g1)) elseif @m == 5 y = zr/2+g1 elseif @m == 6 y = g1^3 elseif @m == 7 y = g1^2/a2 elseif @m == 8 || @m == 9 y = zr*s1/zi elseif @m == 10 || @m == 11 y = g1^2 elseif @m == 12 || @m == 13 y = g1-abs((ff-g1)/s1) elseif @m == 14 || @m == 15 y = g1-zr/g1 elseif @m == 16 || @m == 17 y = g1-abs(zr/g1) elseif @m == 18 || @m == 19 y = g1 elseif @m == 20 || @m == 21 y = s1*.1/g1^2 elseif @m == 22 || @m == 23 y = g1^2-abs((ff-g1)/s1) elseif @m == 24 || @m == 25 y = g1^2-s1 elseif @m == 26 || @m == 27 y = ff else y = imag(fc) endif y = real(@fn9(y - @tad/10)) if @sa < 0 && sn == -1 y = y * (-@sa+5)/5 vsa = sn*@sa/20 endif if @sb > 0 y = y % vsb endif if @m % 2 == 0 x = zz - @mul*(real(abs(@fn1(y - abs(@fn2(y)))))) else x = zz - @mul*y endif if @sb < 0 x = x % vsb endif x = x + vsa xb = (@fn8(x + flip(y)))^@pwr zz = cabs(z1 - xb) m_lastz = xb return zz endfunc protected: float x float y float zr float zi float zz float a2 float s1 float g1 float ff complex gc complex zc complex fc complex z1 float zr1 float zi1 float fmr float fmi int sn float vsa float vsb default: title = "Doodad Traps" int param v_doodad caption = "Version (Doodad Traps)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_doodad < 100 endparam param trp caption = "More Trap Parameters" hint = "Additional parameters less frequently used." default = true endparam param m caption = " Trap Mode" enum = "1" "2" "3" "4" "5" "6" "7" "8" \ "9" "A" "B" "C" "D" "E" "F" "G" \ "H" "I" "J" "K" "L" "M" "N" "O" \ "P" "Q" "R" "S" "T" "U" default = 0 endparam param mr caption = "Flavor" enum = "A" "B" "C" "D" "E" "F" "G" \ "H" "I" "J" "K" "L" "M" "N" \ "O" "P" default = 0 endparam param mrf caption = "Apply ABS to Flavor" default = false visible = @mr < 5 && @trp endparam param tad caption = "Trap Addend" default = 0.0 visible = @trp endparam param fm caption = "Flavor Multiplier" default = (1,1) visible = @trp endparam param pwr caption = "`Trap Power'" default = 3.0 visible = @trp endparam param mul caption = " Trap Multiplier" default = 3.0 visible = @trp endparam param sb caption = "'Ripple' Control" hint = "A few Trap Modes are unaffected by this \ parameter. Useful Range is -50 to 50" default = 0.0 visible = @trp endparam param sa caption = "Expand+|-Contract" hint = "Useful Range is around -10 to 10" default = 0.0 visible = @trp endparam heading caption = "Functions" endheading func fn4 caption = "Initial function" default = ident() endfunc func fn1 caption = "Real function" default = ident() endfunc func fn2 caption = "Imag function" default = ident() endfunc func fn3 caption = "Overall function" default = ident() endfunc func fn9 caption = "First Trap function" default = ident() visible = @trp endfunc func fn8 caption = "Final Trap function" default = ident() endfunc } class REB_ShapeTextureMerge(common.ulb:TrapShape) { ; This is a wrappoer transform which allows you to use 2-3 ; trap shapes an trap shape textures in a trap shape slot. ; If you need more than three trap shapes, put a TrapShapeTextureMerge ; object in one or more of the slots. $define debug public: import "common.ulb" import "dmj5.ulb" func REB_ShapeTextureMerge(Generic pparent) TrapShape.TrapShape(pparent) int a = 0 int b = 1 int c = 2 if @trapno == "2" if @merge_order2 == "2 1" a = 1 b = 0 endif endif if @trapno == "2" m_Enables[a] = true m_Enables[b] = true m_Enables[c] = false m_tmax = 2 else m_Enables[a] = true m_Enables[b] = true m_Enables[c] = true m_tmax = 3 endif m_Elements[a] = new @f_trapshape1(this) m_Elements[b] = new @f_trapshape2(this) m_Elements[c] = new @f_trapshape3(this) weightF[a] = @weightf1 weightF[b] = @weightf2 weightF[c] = @weightf3 endfunc func Init(complex pz) TrapShape.Init(pz) m_TextureValue = 0 int j = 0 while (j < m_tmax) if (m_Enables[j]) m_Elements[j].Init(pz) distance[j] = 0 distance3[j] = 0 endif j = j + 1 endwhile dist = 0 endfunc float func Iterate(complex pz) TrapShape.Iterate(pz) if m_Enables[0] distance[0] = m_Elements[0].Iterate(pz)*weightf[0] LastZ[0] = m_Elements[0].GetTransformedPoint() if @v_REB_ShapeTextureMerge < 101 if @tamode == "-A" distance[0] = - distance[0] elseif @tamode == "|A|" distance[0] = abs(distance[0]) elseif @tamode == "A*A" distance[0] = distance[0]*distance[0] elseif @tamode == "-A*A" distance[0] = -distance[0]*distance[0] elseif @tamode == "A*A*A" distance[0] = distance[0]*distance[0]*distance[0] elseif @tamode == "-A*A*A" distance[0] = -distance[0]*distance[0]*distance[0] elseif @tamode == "|A*A*A|" distance[0] = abs(distance[0]*distance[0]*distance[0]) elseif @tamode == "log(A)" distance[0] = log(distance[0]) elseif @tamode == "exp(A)" distance[0] = exp(distance[0]) endif else if @tamode2 == "-A" distance[0] = - distance[0] elseif @tamode2 == "|A|" distance[0] = abs(distance[0]) elseif @tamode2 == "A*A" distance[0] = distance[0]*distance[0] elseif @tamode2 == "-A*A" distance[0] = -distance[0]*distance[0] elseif @tamode2 == "A*A*A" distance[0] = distance[0]*distance[0]*distance[0] elseif @tamode2 == "-A*A*A" distance[0] = -distance[0]*distance[0]*distance[0] elseif @tamode2 == "|A*A*A|" distance[0] = abs(distance[0]*distance[0]*distance[0]) endif distance[0] = real(@mFuncA(distance[0])) endif endif if m_Enables[1] distance[1] = m_Elements[1].Iterate(pz)*weightf[1] LastZ[1] = m_Elements[1].GetTransformedPoint() if @v_REB_ShapeTextureMerge < 101 if @tbmode == "-B" distance[1] = - distance[1] elseif @tbmode == "|B|" distance[1] = abs(distance[1]) elseif @tbmode == "B*B" distance[1] = distance[1]*distance[1] elseif @tbmode == "-B*B" distance[1] = -distance[1]*distance[1] elseif @tbmode == "B*B*B" distance[1] = distance[1]*distance[1]*distance[1] elseif @tbmode == "-B*B*B" distance[1] = -distance[1]*distance[1]*distance[1] elseif @tbmode == "|B*B*B|" distance[1] = abs(distance[1]*distance[1]*distance[1]) elseif @tbmode == "log(B)" distance[1] = log(distance[1]) elseif @tbmode == "exp(B)" distance[1] = exp(distance[1]) endif else if @tbmode2 == "-B" distance[1] = - distance[1] elseif @tbmode2 == "|B|" distance[1] = abs(distance[1]) elseif @tbmode2 == "B*B" distance[1] = distance[1]*distance[1] elseif @tbmode2 == "-B*B" distance[1] = -distance[1]*distance[1] elseif @tbmode2 == "B*B*B" distance[1] = distance[1]*distance[1]*distance[1] elseif @tbmode2 == "-B*B*B" distance[1] = -distance[1]*distance[1]*distance[1] elseif @tbmode2 == "|B*B*B|" distance[1] = abs(distance[1]*distance[1]*distance[1]) endif distance[1] = real(@mFuncB(distance[1])) endif endif if m_Enables[2] distance[2] = m_Elements[2].Iterate(pz)*weightf[2] LastZ[2] = m_Elements[2].GetTransformedPoint() if @v_REB_ShapeTextureMerge < 101 if @tcmode == "-C" distance[2] = - distance[2] elseif @tcmode == "|C|" distance[2] = abs(distance[2]) elseif @tcmode == "C*C" distance[2] = distance[2]*distance[2] elseif @tcmode == "-C*C" distance[2] = -distance[2]*distance[2] elseif @tcmode == "C*C*C" distance[2] = distance[2]*distance[2]*distance[2] elseif @tcmode == "-C*C*C" distance[2] = -distance[2]*distance[2]*distance[2] elseif @tcmode == "|C*C*C|" distance[2] = abs(distance[2]*distance[2]*distance[2]) elseif @tcmode == "log(C)" distance[2] = log(distance[2]) elseif @tcmode == "exp(C)" distance[2] = exp(distance[2]) endif else if @tcmode2 == "-C" distance[2] = - distance[2] elseif @tcmode2 == "|C|" distance[2] = abs(distance[2]) elseif @tcmode2 == "C*C" distance[2] = distance[2]*distance[2] elseif @tcmode2 == "-C*C" distance[2] = -distance[2]*distance[2] elseif @tcmode2 == "C*C*C" distance[2] = distance[2]*distance[2]*distance[2] elseif @tcmode2 == "-C*C*C" distance[2] = -distance[2]*distance[2]*distance[2] elseif @tcmode2 == "|C*C*C|" distance[2] = abs(distance[2]*distance[2]*distance[2]) endif distance[2] = real(@mFuncC(distance[2])) endif endif if @trapno == "3" if @tterm31 == "A" distance3[0] = distance[0] elseif @tterm31 == "1/A" distance3[0] = 1/distance[0] elseif @tterm31 == "B" distance3[0] = distance[1] elseif @tterm31 == "1/B" distance3[0] = 1/distance[1] elseif @tterm31 == "C" distance3[0] = distance[2] elseif @tterm31 == "1/C" distance3[0] = 1/distance[2] endif if @tterm32 == "A" distance3[1] = distance[0] elseif @tterm32 == "1/A" distance3[1] = 1/distance[0] elseif @tterm32 == "B" distance3[1] = distance[1] elseif @tterm32 == "1/B" distance3[1] = 1/distance[1] elseif @tterm32 == "C" distance3[1] = distance[2] elseif @tterm32 == "1/C" distance3[1] = 1/distance[2] endif if @tterm33 == "A" distance3[2] = distance[0] elseif @tterm33 == "1/A" distance3[2] = 1/distance[0] elseif @tterm33 == "B" distance3[2] = distance[1] elseif @tterm33 == "1/B" distance3[2] = 1/distance[1] elseif @tterm33 == "C" distance3[2] = distance[2] elseif @tterm33 == "1/C" distance3[2] = 1/distance[2] endif endif if @trapno == "2" if @p_mergemode == "minimum" float dmin = 1e100 if distance[0] < distance[1] dmin = distance[0] m_lastz = lastz[0] else dmin = distance[1] m_lastz = lastz[1] endif return dmin elseif @p_mergemode == "maximum" float dmax = -1e100 if distance[0] > distance[1] dmax = distance[0] m_lastz = lastz[0] else dmax = distance[1] m_lastz = lastz[1] endif return dmax elseif @p_mergemode == "add" m_lastZ = lastz[0] + lastz[1] return distance[0]+distance[1] elseif @p_mergemode == "|A-B|" m_LastZ = abs(lastz[0] - lastz[1]) return abs(distance[0]-distance[1]) elseif @p_mergemode == "multiply" m_LastZ = lastz[0]*lastz[1] return distance[0]*distance[1] elseif @p_mergemode == "divide" m_LastZ = lastz[0]/lastz[1] if distance[1] == 0 distance[1] = 1e-10 endif return distance[0]/distance[1] elseif @p_mergemode == "1/(A*B)" m_lastZ = 1/(lastz[0]*lastz[1]) return 1/(distance[0]*distance[1]) elseif @p_mergemode == "exponentiate" m_lastZ = lastz[0]^lastz[1] return distance[0]^distance[1] elseif @p_mergemode == "A" m_lastZ = lastz[0] return distance[0] elseif @p_mergemode == "B" m_lastZ = lastz[1] return distance[1] elseif @p_mergemode == "and" if distance[0] < @width && distance[1] < @width dist = distance[0] m_lastZ = lastz[0] else dist = @width m_lastZ = @width endif return dist elseif @p_mergemode == "or" if distance[0] < @width dist = distance[0] m_lastZ = lastz[0] elseif distance[1] < @width dist = distance[1] m_lastZ = lastz[1] else dist = @width m_lastz = @width endif return dist elseif @p_mergemode == "xor" if distance[0] < @width && distance[1] >= @width dist = distance[0] m_lastZ = lastz[0] elseif distance[1] < @width && distance[0] >= @width dist = distance[1] m_lastZ = lastz[1] else dist = @width m_lastz = @width endif return dist endif elseif @trapno == "3" if @tmerge1 == "+" dist = distance3[0]+distance3[1] m_lastZ = lastz[0] + lastz[1] elseif @tmerge1 == "*" dist = distance3[0]*distance3[1] m_lastZ = lastz[0] * lastz[1] elseif @tmerge1 == "^" dist = distance3[0]^distance3[1] m_lastZ = lastz[0] ^ lastz[1] elseif @tmerge1 == "min" if distance3[0] < distance3[1] dist = distance3[0] m_lastZ = lastz[0] else dist = distance3[1] m_lastZ = lastz[1] endif elseif @tmerge1 == "max" if distance3[0] > distance3[1] dist = distance3[0] m_lastZ = lastz[0] else dist = distance3[1] m_lastZ = lastz[1] endif elseif @tmerge1 == "and" if distance3[0] < @width && distance3[1] < @width dist = distance3[0] m_lastZ = lastz[0] else dist = @width m_lastZ = @width endif elseif @tmerge1 == "or" if distance3[0] < @width dist = distance3[0] m_lastZ = lastz[0] elseif distance3[1] < @width dist = distance3[1] m_lastZ = lastz[1] else dist = @width m_lastZ = @width endif elseif @tmerge1 == "xor" if distance3[0] < @width && distance3[1] >= @width dist = distance3[0] m_lastZ = lastz[0] elseif distance3[1] < @width && distance3[0] >= @width dist = distance3[1] m_lastZ = lastz[1] else dist = @width m_lastZ = @width endif endif if @tmerge2 == "+" dist = dist+distance3[2] m_lastZ = m_lastz + lastz[2] elseif @tmerge2 == "*" dist = dist*distance3[2] m_lastZ = m_lastz * lastz[2] elseif @tmerge2 == "^" dist = dist^distance3[2] m_lastZ = m_lastz ^ lastz[2] elseif @tmerge2 == "min" if dist < distance3[2] ; else dist = distance3[2] m_lastZ = lastz[2] endif elseif @tmerge2 == "max" if dist > distance3[2] ; else dist = distance3[2] m_lastZ = lastz[2] endif elseif @tmerge2 == "and" if dist < @width && distance3[2] < @width ; else dist = @width m_lastZ = @width endif elseif @tmerge2 == "or" if dist < @width ; elseif distance3[2] < @width dist = distance3[2] m_lastZ = lastz[2] else dist = @width m_lastZ = @width endif elseif @tmerge2 == "xor" if dist < @width && distance3[2] >= @width ; elseif distance3[2] < @width && dist >= @width dist = distance3[2] m_lastZ = lastz[2] else dist = @width m_lastZ = @width endif endif return dist endif return 0 endfunc func SetThreshold(float pthreshold) int j = 0 while (j < 3) if (m_Enables[j]) m_Elements[j].SetThreshold(pthreshold) endif j = j + 1 endwhile endfunc complex func GetTransformedPoint() return m_LastZ endfunc protected: bool m_Enables[3] float distance[3] float distance3[3] TrapShape m_Elements[3] float weightF[3] float m_TextureValue int m_tmax complex lastz[3] float dist default: title = "Trap Shape/Texture Merge" int param v_REB_ShapeTextureMerge caption = "Version (Trap Shape/Texture Merge)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_REB_ShapeTextureMerge < 101 endparam param tamode caption = "Trap A Mode" default = 0 enum = "A" "-A" "|A|" "A*A" "-A*A" "A*A*A" "-A*A*A" "|A*A*A|" "log(A)" "exp(A)" visible = @v_REB_ShapeTextureMerge < 101 endparam param tamode2 caption = "Trap A Mode" default = 0 enum = "A" "-A" "|A|" "A*A" "-A*A" "A*A*A" "-A*A*A" "|A*A*A|" visible = @v_REB_ShapeTextureMerge >= 101 endparam param tbmode caption = "Trap B Mode" default = 0 enum = "B" "-B" "|B|" "B*B" "-B*B" "B*B*B" "-B*B*B" "|B*B*B|" "log(B)" "exp(B)" visible = @v_REB_ShapeTextureMerge < 101 endparam param tcmode caption = "Trap C Mode" default = 0 enum = "C" "-C" "|C|" "C*C" "-C*C" "C*C*C" "-C*C*C" "|C*C*C|" "log(C)" "exp(C)" visible = @trapno == 1 && @v_REB_ShapeTextureMerge < 101 endparam param tbmode2 caption = "Trap B Mode" default = 0 enum = "B" "-B" "|B|" "B*B" "-B*B" "B*B*B" "-B*B*B" "|B*B*B|" visible = @v_REB_ShapeTextureMerge >= 101 endparam param tcmode2 caption = "Trap C Mode" default = 0 enum = "C" "-C" "|C|" "C*C" "-C*C" "C*C*C" "-C*C*C" "|C*C*C|" visible = @trapno == 1 && @v_REB_ShapeTextureMerge >= 101 endparam param tterm31 caption = "Merge Term 1" default = 0 enum = "A" "1/A" "B" "1/B" "C" "1/C" visible = @trapno == 1 endparam param tmerge1 caption = " Merge Operator 1" default = 0 enum = "min" "max" "+" "*" "^" "and" "or" "xor" visible = @trapno == 1 endparam param tterm32 caption = "Merge Term 2" default = 2 enum = "A" "1/A" "B" "1/B" "C" "1/C" visible = @trapno == 1 endparam param tmerge2 caption = " Merge Operator 2" default = 0 enum = "min" "max" "+" "*" "^" "and" "or" "xor" visible = @trapno == 1 endparam param tterm33 caption = "Merge Term 3" default = 4 enum = "A" "1/A" "B" "1/B" "C" "1/C" visible = @trapno == 1 endparam int param p_mergemode caption = "Merge Mode" enum = "minimum" "maximum" "add" "|A-B|" "multiply" "divide" "1/(A*B)" \ "exponentiate" "A" "B" "and" "or" "xor" default = 0 visible = @trapno == 0 endparam heading text = "Set the 'Thrshold' equal to the value of the 'Trap Threshold' for the \ Trap Mode. Other values may give interesting effects but will not give \ a true 'and', 'or' or 'xor' merge." visible = @p_mergemode == "AND" ||@p_mergemode == "OR" ||@p_mergemode == "xor" \ || @tmerge1 == "and" || @tmerge1 == "or" || @tmerge1 == "xor" \ || @tmerge2 == "and" || @tmerge2 == "or" || @tmerge2 == "xor" endheading float param @width caption = "Threshold" default = 0.25 visible = @p_mergemode == "AND"||@p_mergemode == "OR" ||@p_mergemode == "xor" \ || @tmerge1 == "and" || @tmerge1 == "or" || @tmerge1 == "xor" \ || @tmerge2 == "and" || @tmerge2 == "or" || @tmerge2 == "xor" endparam param trapno caption = "# of shapes" enum = "2" "3" endparam param merge_order2 caption = "Merge Order" enum = "1 2" "2 1" visible = @trapno == "2" && (@p_mergemode == "exponentiate" || @p_mergemode == "divide" \ || @p_mergemode == "and" ||@p_mergemode == "or" ||@p_mergemode == "xor" ) endparam func mfuncA caption = "Merge func A" default = ident() visible = @v_REB_ShapeTextureMerge >= 101 endfunc func mfuncB caption = "Merge func B" default = ident() visible = @v_REB_ShapeTextureMerge >= 101 endfunc func mfuncC caption = "Merge func C" default = ident() visible = @trapno == "3" && @v_REB_ShapeTextureMerge >= 101 endfunc TrapShape param f_trapshape1 caption = "Trap Shape" default = REB_TrapShapeBifolium hint = "Sets the trap shape for this slot. Using a TrapShapeBlock in this slot is recommended so that each trap shape can have its own position and transfer settings. If you do xor need these, you may load a TrapShape directly into this slot to reduce clutter." endparam float param weightF1 caption = "Weight factor" default = 1 endparam TrapShape param f_trapshape2 caption = "Trap Shape" default = DMJ_TrapShapeAstroid hint = "Sets the trap shape for this slot. Using a TrapShapeBlock in this slot is recommended so that each trap shape can have its own position and transfer settings. If you do xor need these, you may load a TrapShape directly into this slot to reduce clutter." endparam float param weightF2 caption = "Weight factor" default = 1 endparam TrapShape param f_trapshape3 caption = "Trap Shape" default = REB_TrapShapeAmpersand hint = "Sets the trap shape for this slot. Using a TrapShapeBlock in this slot is recommended so that each trap shape can have its own position and transfer settings. If you do need these, you may load a TrapShape directly into this slot to reduce clutter." visible = @trapno == "3" endparam float param weightF3 caption = "Weight factor" default = 1 visible = @trapno == "3" endparam } class REB_TrapShapeGaussianInteger(common.ulb:TrapShape) { ; Modified from the Gaussian Integer code of Kerry Mitchell public: func Init(complex pz) trapshape.Init(pz) r=0.0 rmin=1.0e12 rmax=0.0 rave=0.0 total=0.0 t=0.0 iter=0 itermin=0 itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) if(@norm==1) ; pixel normalization normfac=#pixel elseif(@norm==2) ; factor normalization normfac=@fac elseif(@norm==3) ; f(z) normalization normfac=@normfunc(pz) else ; no normalization normfac=(1.0,0.0) endif logfac=@logseed endfunc float func Iterate(complex pz) TrapShape.Iterate(pz) iter = iter + 1 complex temp2=pz/@scale float return_val = 0 if @randomize logfac=4*logfac*(1-logfac) temp2=temp2*(1-@randomsize*logfac) endif if(@inttype==1) ; trunc temp=trunc(temp2/normfac) elseif(@inttype==2) ; floor temp=floor(temp2/normfac) elseif(@inttype==3) ; ceil temp=ceil(temp2/normfac) else ; round temp=round(temp2/normfac) endif remain=temp2-temp*normfac r=cabs(remain) total=total+r rave=total/iter if(rrmax) rmax=r zmax=temp2 itermax=iter endif if(@colorby==1) ; iteration @ min return_val=0.01*itermin elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif return_val=0.5*t elseif(@colorby==3) ; maximum distance return_val=rmax elseif(@colorby==4) ; iteration @ max return_val=0.01*itermax elseif(@colorby==5) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif return_val=0.5*t elseif(@colorby==6) ; average distance return_val=rave elseif(@colorby==7) ; min/mean/max angle zmax=(rave-rmin)+flip(rmax-rave) t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif return_val=0.5*t elseif(@colorby==8) ; max/min ratio return_val=rmax/(rmin+1.e-12) else ; minimum distance return_val=rmin endif m_LastZ = exp(flip(2 * #pi * sqrt(2) * return_val%1)) return return_val%1 endfunc private: float r float rmin float rmax float rave float total float t int iter int itermin int itermax complex zmin complex zmax float logfac complex normfac default: title = "Full Gaussian Integer" heading text = "When used in the Trap Shape slot, Full Gaussian Integer will give \ results identical to Kerry Mitchell.s GaussianInteger in lkm.ucl. \ To get identical results set texture scale = 1.0, select a Trap Mode \ of Last with the trap threshold = 1, and select the trap color mode \ of Distance." endheading param inttype caption="Integer Type" default=0 enum="round(z)" "trunc(z)" "floor(z)" "ceil(z)" hint="Selects between four ways of reducing the orbit value z to an \ integer. Each will produce different effects." endparam param colorby caption="Color By" default=0 enum="minimum distance" "iteration @ min" "angle @ min" \ "maximum distance" "iteration @ max" "angle @ max" "average distance"\ "min/mean/max angle" "max/min ratio" hint="Selects what information from the fractal calculation is used to \ calculate the color of each point." endparam param norm caption="Normalization" default=0 enum="none" "pixel" "factor" "f(z)" hint="Selects an optional normalization algorithm that is applied to the \ integer values." endparam param fac caption=" Factor" default=(2.0,1.0) visible = @norm == "factor" hint="Specifies the normalization factor that is used if Normalization is \ set to 'factor'." endparam func normfunc caption=" Function" default=ident() hint="Selects the normalization function that is used if Normalization is \ set to 'f(z)'." visible = @norm == "f(z)" endfunc param randomize caption="Randomize" default=false hint="If checked, a random factor is applied to z at every iteration \ before finding the Gaussian integer." endparam param randomsize caption="Random Size" default=(0.1,0) hint="Specifies the size of the random factor to use if Randomize is \ checked. Larger values give more randomization." visible = @randomize endparam param logseed caption="Random Seed" default=0.1 min=0.0 max=1.0 hint="Specifies the randomization seed, between 0 and 1, to use if \ Randomize is checked. Every seed gives a different image." visible = @randomize endparam param scale caption = "Texture scale" default = 0.1 endparam } class REB_TrapShapeRoseRangeLite(common.ulb:TrapShape) { ; Modified from the Rose Range Lite code of Kerry Mitchell public: func Init(complex pz) trapshape.Init(pz) rminfac=@scale*(1.0-0.5*@rangewidth) rmaxfac=@scale*(1.0+0.5*@rangewidth) rz=0.0 tz=0.0 rmin=0.0 rmax=0.0 rn=0.0 rw = 0 rotangle=-@rot/180.0*#pi rfaze=@rphase/180*#pi rho=0 cycle_length=@ndo+@nskip jter=0 start_last=@start_cycle+@ncycle*cycle_length-1 iter = 0 doit = false endfunc float func Iterate(complex pz) TrapShape.Iterate(pz) iter = iter + 1 ; ; selected iterations ; if(@select_type=="do all") doit=true elseif(@select_type=="cycle") ; ; first iterations before the cycle ; if(iter<@start_cycle) if(@first_type=="do first") doit=true elseif(@first_type=="skip first") doit=false endif ; ; last iterations after the cycle ; elseif(iter>start_last) if(@last_type=="do last") doit=true elseif(@last_type=="skip last") doit=false endif ; ; cycle ; else jter=((iter-@start_cycle)%cycle_length)+1 if(jter<=@ndo) doit=true else doit=false endif endif endif if doit tz=atan2(pz)+rotangle rz=@ac*cos(@bc*tz)+@as*sin(@bs*tz) if !@widthfix rmin=rz*rminfac rmax=rz*rmaxfac rz=cabs(pz-@curvecenter) endif if(@vary_width==true) rho=(1-cos(@rfreq*tz+rfaze))/2 rw=rho*(@maxwidth-@minwidth)+@minwidth rminfac=@scale*(1-0.5*rw) rmaxfac=@scale*(1+0.5*rw) endif if @widthfix rmin=rz*rminfac rmax=rz*rmaxfac rz=cabs(pz-@curvecenter) endif if((rz>=rmin)&&(rz<=rmax)) rn=(rz-rmin)/(rmax-rmin) endif if((rzrmax)) rn = 1e20 endif else rn = 1e20 endif m_LastZ = exp(flip(2 * #pi * sqrt(2) * rn)) return rn endfunc private: float rminfac float rmaxfac float rz float tz float rmin float rmax float rn float rotangle float rfaze float rho float rw bool doit int jter int start_last int cycle_length int iter default: title = "Rose Range Lite" int param v_roserangelite caption = "Version (Rose Range Lite)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_roserangelite < 100 endparam heading text = "This is the trap shape version of Kerry Mitchell's Rose Range Lite. \ To duplicate the original Rose Range Lite shapes use the Last or First \ trap modes. For first angle and last angle use the Angle to Origin trap \ color mode. For first and last magnitude use the Distance trap color mode. \ You may have to rotate the gradient to duplicate the colors." endheading heading caption="selected iterations" endheading param select_type caption="select type" default=0 enum="do all" "cycle" endparam param first_type caption="first type" default=0 enum="skip first" "do first" hint="for iterations before the cycle" visible=(@select_type=="cycle") endparam param last_type caption="last type" default=0 enum="skip last" "do last" hint="for iterations after the cycle" visible=(@select_type=="cycle") endparam int param start_cycle caption="cycle starting iteration" default=3 min=1 visible=(@select_type=="cycle") endparam int param ndo caption="# to do each cycle" default=2 min=0 visible=(@select_type=="cycle") endparam int param nskip caption="# to skip each cycle" default=3 min=0 visible=(@select_type=="cycle") endparam int param ncycle caption="# of cycles" default=2 min=0 visible=(@select_type=="cycle") endparam param scale caption="range scale" default=1.0 endparam bool param vary_width caption="vary width" default=false endparam heading text = "With single iteration layers the widths may not match up correctly with the \ expected widths for multiple iteration single layer when 'vary_with' is set. The default \ for 'fix width' is false so that old uprs will render as originally designed. \ If you use this option make sure that 'fix width' is checked for both single and \ multiple iteration layers." visible = @vary_width endheading bool param widthfix caption ="fix width" default = false visible = @vary_width endparam float param rangewidth caption="range width" default=0.1 visible=(@vary_width==false) endparam float param minwidth caption="min range width" default=0.1 visible=(@vary_width==true) endparam float param maxwidth caption="max range width" default=0.4 visible=(@vary_width==true) endparam float param rfreq caption="range frequency" default=1 visible=(@vary_width==true) endparam float param rphase caption="range phase, deg" default=0 visible=(@vary_width==true) endparam param ac caption="cos amplitude" default=1.0 endparam param bc caption="cos frequency" default=3.0 endparam param as caption="sin amplitude" default=0.0 endparam param bs caption="sin frequency" default=0.0 endparam param curvecenter caption="curve center" default=(0.0,0.0) endparam param rot caption="rotation angle" default=0.0 hint="degrees" endparam } class REB_TrapShapeWorleyLite(common.ulb:TrapShape) { ; Implementation of Worley cellular noise with Worley fractal modulation.
;

; The Euclidian flavor is closely equivalent to Voronoi texturing. ; Jim Blue's random number generator was essential to its development. ; Additional methods of fractal modulation have been added based upon the ; Worley model. public: import "common.ulb" import "jlb.ulb" ; Constructor func REB_TrapShapeWorleyLite(Generic pparent) TrapShape.TrapShape(pparent) rndi = new JLB_Random(0) rndi.Init(@seed) rndi.SetNMax(5000) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) complex fzc complex fzz float dst float dst2 complex fzc1 complex fzc2 complex fzc3 complex fzc4 complex cells[12] float distance = 0 float test = 0 complex diff = 0 int rnds[24] float rp[12] float ip[12] int i = 1 rnds[0] = rndi.RandomIntInRange(@seed) while i < 24 rnds[i] = rndi.RandomIntInRange(0) i = i + 1 endwhile dst = 1e10 dst2 = 1e10 complex near = 0 complex z = (pz+(10,10))/@psize fzc = round(z) fzz = z - fzc ; create the grid fzc1 = fzc + (1,1)/2 fzc2 = fzc + (1,-1)/2 fzc3 = fzc + (-1,1)/2 fzc4 = fzc + (-1,-1)/2 ; create the random points ; cell 1 rp[0] = ((real(fzc1)-rnds[0])^5%rnds[6] - (imag(fzc1)+rnds[12])^3%rnds[18])^2 %2 - 1 ip[0] = ((real(fzc1)-rnds[1])^5%rnds[7] - (imag(fzc1)+rnds[13])^3%rnds[19])^2 %2 - 1 rp[1] = ((real(fzc1)-rnds[2])^5%rnds[8] - (imag(fzc1)+rnds[14])^3%rnds[20])^2 %2 - 1 ip[1] = ((real(fzc1)-rnds[3])^5%rnds[8] - (imag(fzc1)+rnds[15])^3%rnds[21])^2 %2 - 1 rp[2] = ((real(fzc1)-rnds[4])^5%rnds[10] - (imag(fzc1)+rnds[16])^3%rnds[22])^2 %2 - 1 ip[2] = ((real(fzc1)-rnds[5])^5%rnds[11] - (imag(fzc1)+rnds[17])^3%rnds[23])^2 %2 - 1 ; cell 2 rp[3] = ((real(fzc2)-rnds[0])^5%rnds[6] - (imag(fzc2)+rnds[12])^3%rnds[18])^2 %2 - 1 ip[3] = ((real(fzc2)-rnds[1])^5%rnds[7] - (imag(fzc2)+rnds[13])^3%rnds[19])^2 %2 - 1 rp[4] = ((real(fzc2)-rnds[2])^5%rnds[8] - (imag(fzc2)+rnds[14])^3%rnds[20])^2 %2 - 1 ip[4] = ((real(fzc2)-rnds[3])^5%rnds[8] - (imag(fzc2)+rnds[15])^3%rnds[21])^2 %2 - 1 rp[5] = ((real(fzc2)-rnds[4])^5%rnds[10] - (imag(fzc2)+rnds[16])^3%rnds[22])^2 %2 - 1 ip[5] = ((real(fzc2)-rnds[5])^5%rnds[11] - (imag(fzc2)+rnds[17])^3%rnds[23])^2 %2 - 1 ; cell 3 rp[6] = ((real(fzc3)-rnds[0])^5%rnds[6] - (imag(fzc3)+rnds[12])^3%rnds[18])^2 %2 - 1 ip[6] = ((real(fzc3)-rnds[1])^5%rnds[7] - (imag(fzc3)+rnds[13])^3%rnds[19])^2 %2 - 1 rp[7] = ((real(fzc3)-rnds[2])^5%rnds[8] - (imag(fzc3)+rnds[14])^3%rnds[20])^2 %2 - 1 ip[7] = ((real(fzc3)-rnds[3])^5%rnds[8] - (imag(fzc3)+rnds[15])^3%rnds[21])^2 %2 - 1 rp[8] = ((real(fzc3)-rnds[4])^5%rnds[10] - (imag(fzc3)+rnds[16])^3%rnds[22])^2 %2 - 1 ip[8] = ((real(fzc3)-rnds[5])^5%rnds[11] - (imag(fzc3)+rnds[17])^3%rnds[23])^2 %2 - 1 ; cell 4 rp[9] = ((real(fzc4)-rnds[0])^5%rnds[6] - (imag(fzc4)+rnds[12])^3%rnds[18])^2 %2 - 1 ip[9] = ((real(fzc4)-rnds[1])^5%rnds[7] - (imag(fzc4)+rnds[13])^3%rnds[19])^2 %2 - 1 rp[10] = ((real(fzc4)-rnds[2])^5%rnds[8] - (imag(fzc4)+rnds[14])^3%rnds[20])^2 %2 - 1 ip[10] = ((real(fzc4)-rnds[3])^5%rnds[8] - (imag(fzc4)+rnds[15])^3%rnds[21])^2 %2 - 1 rp[11] = ((real(fzc4)-rnds[4])^5%rnds[10] - (imag(fzc4)+rnds[16])^3%rnds[22])^2 %2 - 1 ip[11] = ((real(fzc4)-rnds[5])^5%rnds[11] - (imag(fzc4)+rnds[17])^3%rnds[23])^2 %2 - 1 ; put into the grids cells[0] = (rp[0] + flip(ip[0]) + (1,1))/2 cells[1] = (rp[1] + flip(ip[1]) + (1,1))/2 cells[2] = (rp[2] + flip(ip[2]) + (1,1))/2 cells[3] = (rp[3] + flip(ip[3]) + (1,-1))/2 cells[4] = (rp[4] + flip(ip[4]) + (1,-1))/2 cells[5] = (rp[5] + flip(ip[5]) + (1,-1))/2 cells[6] = (rp[6] + flip(ip[6]) + (-1,1))/2 cells[7] = (rp[7] + flip(ip[7]) + (-1,1))/2 cells[8] = (rp[8] + flip(ip[8]) + (-1,1))/2 cells[9] = (rp[9] + flip(ip[9]) + (-1,-1))/2 cells[10] = (rp[10] + flip(ip[10]) + (-1,-1))/2 cells[11] = (rp[11] + flip(ip[11]) + (-1,-1))/2 i = 0 while i < 12 diff = fzz - cells[i] if @flavor == "Euclidian" test = cabs(diff) elseif @flavor == "Manhattan" test = (abs(real(diff))^real(@mp) + abs(imag(diff))^imag(@mp)) elseif @flavor == "Chebychev" if abs(real(diff)) > abs(imag(diff)) test = abs(real(diff)) else test = abs(imag(diff)) endif elseif @flavor == "Minkovsky" test = (abs(real(diff))^@ex + abs(imag(diff))^@ex)^(1/@ex) elseif @flavor == "Exp/Log Manhattan" test = log(exp(abs(real(diff))) + exp(abs(imag(diff)))) endif if test < dst dst2 = dst dst = test near = fzc + cells[i] elseif test < dst2 dst2 = test endif i = i + 1 endwhile if @type == "Distance" distance = dst^@thick elseif @type == "2nd Distance" distance = (@smod*dst2-dst)^@thick elseif @type == "2nd Distance variant" distance = dst2^@thick elseif @type == "Mosaic" distance = cabs(1000*near) + 1000*atan(cabs(near)+#pi)%1 endif if @dmod != 0 distance = distance*@dmod endif if @type != "Mosaic" if @invert distance = abs(1-distance) endif else distance = distance % 1 endif m_LastZ = exp(flip(2 * #pi * sqrt(2) * distance)) return distance endfunc protected: JLB_Random rndi default: title = "Worley Lite" int param v_worleylite caption = "Version (Worley Lite)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_worleylite < 100 endparam param flavor caption = "Flavor" default = 4 enum = "Chebychev" "Euclidian" "Manhattan" "Exp/Log Manhattan" "Minkovsky" endparam float param ex caption = "Minkovsky param" default = 4 visible = @flavor == "Minkovsky" endparam complex param mp caption = "Manhattan pwr" default = (1,1) visible = @flavor == "Manhattan" endparam param type caption = "Worley type" default = 2 enum = "Distance" "2nd Distance" "2nd Distance variant" "Mosaic" endparam float param smod caption = "2nd dist mod" default = 1.0 visible = @type == "2nd Distance" endparam param psize caption = "Pattern Size" default = .15 endparam float param thick caption = "Thickness" default = 0.1 endparam float param dmod caption = "Dist modulator" default = 0.0 min = 0.0 endparam bool param invert caption = "Invert" default = false visible = @type != "Mosaic" endparam int param seed caption = "Worley seed" default = 123 endparam } class REB_ConvolutionShapeWrapper(common.ulb:TrapShape) { ; This wrapper allows you to use any trap shape and any convolution ; filter to produce blurred or sharpened (or other) trap effects. ; This is largely based upon BlurTrapWrapper of Damien Jones public: import "common.ulb" import "dmj5.ulb" func REB_ConvolutionShapeWrapper(Generic pparent) TrapShape.TrapShape(pparent) m_Filter = new @f_filter(this) m_Samples = length(m_Filter.m_Offsets) if @f_filter != REB_MedianFilter && @f_filter != REB_ColorPencilFilter && \ @f_filter != REB_OilPaintFilter setLength(m_TrapShapes, m_Samples) int j = 0 while (j < m_Samples) m_TrapShapes[j] = new @f_trapshape(this) j = j + 1 endwhile else setLength(m_TrapShapes, 1) setlength(med,m_samples) m_TrapShapes[0] = new @f_trapshape(this) endif endfunc func Init(complex pz) TrapShape.Init(pz) if @f_filter != REB_MedianFilter && @f_filter != REB_ColorPencilFilter && \ @f_filter != REB_OilPaintFilter int j = 0 while (j < m_Samples) m_TrapShapes[j].Init(pz) j = j + 1 endwhile else m_TrapShapes[0].Init(pz) endif if (@p_filterreset == 0 && DMJ_VariableConvolutionFilter(m_Filter) != 0) m_Filter.Init(pz) endif endfunc float func Iterate(complex pz) trapshape.Iterate(pz) if (@p_filterreset == 1 && DMJ_VariableConvolutionFilter(m_Filter) != 0) m_Filter.Init(pz) endif float dist = 0 float d = 0 float w = 0 float o = 0 int j = 0 if @f_filter != REB_MedianFilter && @f_filter != REB_ColorPencilFilter && \ @f_filter != REB_OilPaintFilter while (j < m_Samples) dist = m_TrapShapes[j].Iterate(pz+m_Filter.m_Offsets[j]) w = m_Filter.m_Weights[j] d = d + dist * w j = j + 1 endwhile w = m_Filter.m_Multiplier o = m_Filter.m_Bias d = d * w + o else int k = 0 int l = 0 float tmp = 0 int si = 0 int sj = 0 bool continue = true float dmin = 1e10 float dmax = 0 int bin[100] while k < 100 bin[k] = 0 k = k + 1 endwhile int val = 0 float maxval = 0 int maxvalidx = 0 k = 0 j = 0 while (j < m_Samples) med[j] = m_TrapShapes[0].Iterate(pz+m_Filter.m_Offsets[j]) if @f_filter == REB_ColorPencilFilter if med[j] < dmin dmin = med[j] endif if med[j] > dmax dmax = med[j] endif endif if @f_filter == REB_OilPaintFilter ; create a 100 bin histogram to determine the most common value val = round(med[j]*100) % 100 bin[val] = bin[val] + 1 if maxval < bin[val] maxval = bin[val] maxvalidx = j endif endif j = j + 1 endwhile if @f_filter == REB_MedianFilter ;heapsort without recursion l = round(m_samples/2)+1 k = m_samples tmp = 0 repeat if l > 1 l = l-1 tmp = med[l-1] else tmp = med[k-1] med[k-1] = med[0] k = k-1 if k == 0 med[0] = tmp continue = false endif endif if continue == true si = l sj = 2*l endif while (sj <= k) && (continue == true) if sj < k if med[sj-1] < med[sj] sj = sj + 1 endif endif if tmp < med[sj-1] med[si-1] = med[sj-1] si = sj sj = sj + sj else sj = k + 1 endif endwhile if (continue == true) med[si-1] = tmp endif until continue == false ; end heapsort d = med[round(m_samples/2)] endif if @f_filter == REB_ColorPencilFilter float r = med[round(m_samples/2)] float md = 0 float maskr = 0 if r == dmax md = 0 else md = abs(r-dmin) if md < abs(r-dmax) md = abs(r-dmax) endif endif md = md*255 r = r*255 maskr = 1/(md/(sqrt(r+1)/3)+1) d = (r + @cpr*((255-r)*maskr-md*r/100))/255 endif if @f_filter == REB_OilPaintFilter d = med[maxvalidx] endif endif return d endfunc protected: DMJ_ConvolutionFilter m_Filter int m_Samples TrapShape m_TrapShapes[] float med[] default: title = "Convolution Shape Wrapper" int param v_REB_ConvolutionShapeWrapper caption = "Version (REB_ConvolutionShapeWrapper)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_REB_ConvolutionShapeWrapper < 100 endparam heading text = "To use with image import (images as textures) replace the \ trap shape under Trap Position with Image Tile Texture." endheading TrapShape param f_trapshape caption = "Trap Shape" default = TrapShapeBlock hint = "Sets the trap shape that the convolution filter will be applied to." endparam DMJ_ConvolutionFilter param f_filter caption = "Convolution Filter" default = REB_NullFilter hint = "Sets the filter that will be applied." endparam float param cpr caption = "Color Pencil Intensity" default = 0.5 visible = @f_filter == REB_ColorPencilFilter endparam int param p_filterreset caption = "Reset Filter" default = 1 enum = "first iteration" "every iteration" hint = "Some convolution filters are position-dependent: the filter's effect varies from one part of the complex plane to another. For this kind of filter, you may choose whether to recompute the filter's effect only at the first iteration or on every iteration." visible = (@f_filter == DMJ_VariableConvolutionFilter) endparam } class Monnier_SFBM_II_Texture(common.ulb:TrapShape) { ; Trap shape based upon Sam Monnier's S.F.B.M. II ucl
; Used with his permission.
public: import "common.ulb" func Monnier_SFBM_II_Texture(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; call before each iteration func Init(complex pz) TrapShape.Init(pz) if @v_monniersfbm < 102 || (!@init && @v_monniersfbm >= 102) z = 0 zc1 = 0 zc2 = 0 zc3 = 0 zc4 = 0 i = 0 j = 0 jmax = 0 niter = 0 a = 0 sum = 0 x = 0 y = 0 d1 = 0 d2 = 0 d3 = 0 d4 = 0 nindex = 0 sindex = 0 scale = 1 cr1r = 0 cr1i = 0 cr2r = 0 cr2i = 0 cr3r = 0 cr3i = 0 cr4r = 0 cr4i = 0 crp1 = 0 crp2 = 0 crp3 = 0 crp4 = 0 norm = 1 if @interp == 0 niter = ceil(real(log(real(@fmm)-imag(@fmm))/log(1+@mstep))) else niter = ceil((real(@fmm)-imag(@fmm))/@mstep) endif if @mode == 0 jmax = 1 else jmax = 5 endif endif endfunc ; call for each iterated point float func Iterate(complex pz) TrapShape.Iterate(pz) if @v_monniersfbm >= 102 && @init z = 0 zc1 = 0 zc2 = 0 zc3 = 0 zc4 = 0 i = 0 j = 0 jmax = 0 niter = 0 a = 0 sum = 0 x = 0 y = 0 d1 = 0 d2 = 0 d3 = 0 d4 = 0 nindex = 0 sindex = 0 scale = 1 cr1r = 0 cr1i = 0 cr2r = 0 cr2i = 0 cr3r = 0 cr3i = 0 cr4r = 0 cr4i = 0 crp1 = 0 crp2 = 0 crp3 = 0 crp4 = 0 norm = 1 if @interp == 0 niter = ceil(real(log(real(@fmm)-imag(@fmm))/log(1+@mstep))) else niter = ceil((real(@fmm)-imag(@fmm))/@mstep) endif if @mode == 0 jmax = 1 else jmax = 5 endif endif while j < jmax z = pz/@size if @mode == 1 || @mode == 2 if j == 0 a = @cbl + @ctl + @cbr + @ctr + @cc;/20 elseif j == 1 z = z + @eps*(-1,-1) a = -@cbl elseif j == 2 z = z + @eps*(-1,1) a = -@ctl elseif j == 3 z = z + @eps*(1,-1) a = -@cbr elseif j == 4 z = z + @eps*(1,1) a = -@ctr endif else a = 1 endif j = j + 1 i = 0 while i < niter + 2 if i == 2 if @pptype == 0 z = (real(@pp)*(1/sqrt(imag(@ppp))*x + 1i*sqrt(imag(@ppp))*y)^real(@ppp)+(1-real(@pp))*z)*imag(@pp) else z = (real(@pp)*x^real(@ppp)*exp(imag(@ppp)*1i*y)+(1-real(@pp))*z)*imag(@pp) endif elseif i == 0 z = z/imag(@pp) endif z = z*exp(1i*pi/180*@rot) + 1 - 2i if i > 1 if @interp == 0 scale = (1+@mstep)^(i-2)*imag(@fmm) else scale = real(@fmm)-(i-1)*(@mstep+.001) endif endif i = i + 1 zc = round(scale*z)/scale zc1 = zc + (.5,.5)/scale zc2 = zc + (-.5,.5)/scale zc3 = zc + (.5,-.5)/scale zc4 = zc + (-.5,-.5)/scale cr1r = ((real(zc1)-859-i)^5 % (132+i) - (imag(zc1)+328+i)^3 % (113+i))^2 %2 - 1 if @noise != 6 && @noise != 8 && @noise != 10 && @noise != 12 && @noise != 14 cr2r = ((real(zc2)-859-i)^5 % (132+i) - (imag(zc2)+328+i)^3 % (113+i))^2 %2 - 1 cr3r = ((real(zc3)-859-i)^5 % (132+i) - (imag(zc3)+328+i)^3 % (113+i))^2 %2 - 1 cr4r = ((real(zc4)-859-i)^5 % (132+i) - (imag(zc4)+328+i)^3 % (113+i))^2 %2 - 1 endif if @noise == 0 || @noise == 5 cr1i = ((real(zc1)-465+i)^3 % (120+i) - (imag(zc1)-756+i)^2 % (107+i))^2 %2 - 1 cr2i = ((real(zc2)-465+i)^3 % (120+i) - (imag(zc2)-756+i)^2 % (107+i))^2 %2 - 1 cr3i = ((real(zc3)-465+i)^3 % (120+i) - (imag(zc3)-756+i)^2 % (107+i))^2 %2 - 1 cr4i = ((real(zc4)-465+i)^3 % (120+i) - (imag(zc4)-756+i)^2 % (107+i))^2 %2 - 1 endif if @noise == 0 v1 = (z - zc1)*scale v2 = (z - zc2)*scale v3 = (z - zc3)*scale v4 = (z - zc4)*scale crp1 = cr1r*real(v1) + cr1i*imag(v1) crp2 = cr2r*real(v2) + cr2i*imag(v2) crp3 = cr3r*real(v3) + cr3i*imag(v3) crp4 = cr4r*real(v4) + cr4i*imag(v4) elseif @noise == 1 crp1 = cr1r crp2 = cr1r crp3 = cr1r crp4 = cr1r norm = .5 elseif @noise == 2 crp1 = cr1r crp2 = cr2r crp3 = cr1r crp4 = cr2r norm = .5 elseif @noise == 3 crp1 = cr1r crp2 = cr2r crp3 = cr3r crp4 = cr2r norm = .5 elseif @noise == 4 crp1 = -cr1r crp2 = cr2r crp3 = cr3r crp4 = -cr4r norm = .5 elseif @noise == 5 crp1 = cr1r*abs(real(z-zc)*scale)^real(@noisep) + cr1i*abs(imag(z-zc)*scale)^imag(@noisep) crp2 = cr2r*abs(real(z-zc)*scale)^real(@noisep) + cr2i*abs(imag(z-zc)*scale)^imag(@noisep) crp3 = cr3r*abs(real(z-zc)*scale)^real(@noisep) + cr3i*abs(imag(z-zc)*scale)^imag(@noisep) crp4 = cr4r*abs(real(z-zc)*scale)^real(@noisep) + cr4i*abs(imag(z-zc)*scale)^imag(@noisep) norm = .2 elseif @noise == 6 crp1 = (cabs(z-zc)*scale-imag(@noisep))^real(@noisep) norm = .4 elseif @noise == 7 crp1 = cr1r*(cabs(z-zc)*scale-imag(@noisep))^real(@noisep) crp2 = cr2r*(cabs(z-zc)*scale-imag(@noisep))^real(@noisep) crp3 = cr3r*(cabs(z-zc)*scale-imag(@noisep))^real(@noisep) crp4 = cr4r*(cabs(z-zc)*scale-imag(@noisep))^real(@noisep) norm = .4 elseif @noise == 8 arg = atan2(z-zc) arg = -round(arg/(2*pi)*4)/4*(2*pi) ztest = (z-zc)*exp(1i*arg) crp1 = (real(ztest)*scale-imag(@noisep))^real(@noisep) norm = .4 elseif @noise == 9 arg = atan2(z-zc) arg = -round(arg/(2*pi)*4)/4*(2*pi) ztest = (z-zc)*exp(1i*arg) crp1 = cr1r*(real(ztest)*scale-imag(@noisep))^real(@noisep) crp2 = cr2r*(real(ztest)*scale-imag(@noisep))^real(@noisep) crp3 = cr3r*(real(ztest)*scale-imag(@noisep))^real(@noisep) crp4 = cr4r*(real(ztest)*scale-imag(@noisep))^real(@noisep) norm = .4 elseif @noise == 10 arg = atan2(z-zc) arg = -round(arg/(2*pi)*8)/8*(2*pi) ztest = (z-zc)*exp(1i*arg) crp1 = (real(ztest)*scale-imag(@noisep))^real(@noisep) norm = .4 elseif @noise == 11 arg = atan2(z-zc) arg = -round(arg/(2*pi)*8)/8*(2*pi) ztest = (z-zc)*exp(1i*arg) crp1 = cr1r*(real(ztest)*scale-imag(@noisep))^real(@noisep) crp2 = cr2r*(real(ztest)*scale-imag(@noisep))^real(@noisep) crp3 = cr3r*(real(ztest)*scale-imag(@noisep))^real(@noisep) crp4 = cr4r*(real(ztest)*scale-imag(@noisep))^real(@noisep) norm = .4 elseif @noise == 12 ztest = z - zc if real(cr1r) > 0 d1 = abs(cabs(ztest*scale+(.5,.5))-.5) d2 = abs(cabs(ztest*scale-(.5,.5))-.5) if d2 < d1 d1 = d2 endif else d1 = abs(cabs(ztest*scale+(.5,-.5))-.5) d2 = abs(cabs(ztest*scale-(.5,-.5))-.5) if d2 < d1 d1 = d2 endif endif crp1 = d1^real(@noisep) norm = .4 elseif @noise == 13 ztest = z - zc if real(cr1r) > 0 d1 = abs(cabs(ztest*scale+(.5,.5))-.5) d2 = abs(cabs(ztest*scale-(.5,.5))-.5) if d2 < d1 d1 = d2 endif else d1 = abs(cabs(ztest*scale+(.5,-.5))-.5) d2 = abs(cabs(ztest*scale-(.5,-.5))-.5) if d2 < d1 d1 = d2 endif endif crp1 = cr1r*(d1^real(@noisep)-imag(@noisep)) crp2 = cr2r*(d1^real(@noisep)-imag(@noisep)) crp3 = cr3r*(d1^real(@noisep)-imag(@noisep)) crp4 = cr4r*(d1^real(@noisep)-imag(@noisep)) norm = .4 elseif @noise == 14 ztest = (z - zc)*scale if real(cr1r) > 0 d1 = abs(real(ztest) - imag(ztest) -.5) d2 = abs(real(ztest) - imag(ztest) +.5) if d2 < d1 d1 = d2 endif else d1 = abs(real(ztest) + imag(ztest) -.5) d2 = abs(real(ztest) + imag(ztest) +.5) if d2 < d1 d1 = d2 endif endif crp1 = d1^real(@noisep) norm = .4 elseif @noise == 15 ztest = (z - zc)*scale if real(cr1r) > 0 d1 = abs(real(ztest) - imag(ztest) -.5) d2 = abs(real(ztest) - imag(ztest) +.5) if d2 < d1 d1 = d2 endif else d1 = abs(real(ztest) + imag(ztest) -.5) d2 = abs(real(ztest) + imag(ztest) +.5) if d2 < d1 d1 = d2 endif endif crp1 = cr1r*(d1^real(@noisep)-imag(@noisep)) crp2 = cr2r*(d1^real(@noisep)-imag(@noisep)) crp3 = cr3r*(d1^real(@noisep)-imag(@noisep)) crp4 = cr4r*(d1^real(@noisep)-imag(@noisep)) norm = .4 elseif @noise == 16 endif if @noise == 6 || @noise == 8 || @noise == 10 || @noise == 12 || @noise == 14 nindex = crp1 else d1 = real(z - zc)*scale + 0.5 d2 = (1 - d1) d3 = imag(z - zc)*scale + 0.5 d4 = (1 - d3) d1 = (.5 + .5*sin(pi*d1-pi/2))^@power d2 = (.5 + .5*sin(pi*d2-pi/2))^@power d3 = (.5 + .5*sin(pi*d3-pi/2))^@power d4 = (.5 + .5*sin(pi*d4-pi/2))^@power nindex = crp1*d1*d3 + crp3*d1*d4 + crp2*d2*d3 + crp4*d2*d4 endif if @f1 == 1 nindex = real(sin(100*real(@fp1)*nindex+imag(@fp1)))/10 elseif @f1 == 2 nindex = real(@fp1)*10*nindex+2+imag(@fp1) if abs(nindex) > 1 nindex = 1 endif nindex = real(asin(nindex))/4 elseif @f1 == 3 nindex = 20*real(@fp1)*nindex+1+imag(@fp1) if abs(nindex) > 1 nindex = 1 endif nindex = real(acos(nindex))/4 elseif @f1 == 4 nindex = real(atanh(20*real(@fp1)*nindex+imag(@fp1)))/8 elseif @f1 == 5 nindex = (20*nindex+imag(@fp1))^(2+real(@fp1))/160 elseif @f1 == 6 nindex = real((15*nindex+imag(@fp1))^(.1*real(@fp1))) elseif @f1 == 7 nindex = real(exp(10*real(@fp1)*nindex+imag(@fp1)-.5))/8 elseif @f1 == 8 nindex = real(round(5*real(@fp1)*nindex+imag(@fp1)/5))/4 elseif @f1 == 9 nindex = real(round(15*real(@fp1)*nindex+imag(@fp1)/5)^.1)/3 elseif @f1 == 10 if real(@fp1)<0.0 nindex = (sin(-(real(z)+(4+imag(@fp1))*nindex))+cos(-(imag(z)+(4+imag(@fp1))*nindex)))/15 else nindex = (sin(5*sqrt(real(@fp1))*(real(z)+(4+imag(@fp1))*nindex))+cos(5*1/sqrt(real(@fp1))*(imag(z)+(4+imag(@fp1))*nindex)))/15 endif endif if @f2 == 1 nindex = real(sin(100*real(@fp2)*nindex+imag(@fp2)))/10 elseif @f2 == 2 nindex = real(@fp2)*10*nindex+2+imag(@fp2) if abs(nindex) > 1 nindex = 1 endif nindex = real(asin(nindex))/4 elseif @f2 == 3 nindex = 20*real(@fp2)*nindex+1+imag(@fp2) if abs(nindex) > 1 nindex = 1 endif nindex = real(acos(nindex))/4 elseif @f2 == 4 nindex = real(atanh(20*real(@fp2)*nindex+imag(@fp2)))/8 elseif @f2 == 5 nindex = (20*nindex+imag(@fp2))^(2+real(@fp2))/160 elseif @f2 == 6 nindex = real((15*nindex+imag(@fp2))^(.1*real(@fp2))) elseif @f2 == 7 nindex = real(exp(10*real(@fp2)*nindex+imag(@fp2)-.5))/8 elseif @f2 == 8 nindex = real(round(5*real(@fp2)*nindex+imag(@fp2)/5))/4 elseif @f2 == 9 nindex = real(round(15*real(@fp2)*nindex+imag(@fp2)/5)^.1)/3 elseif @f2 == 10 if real(@fp2)<0.0 nindex = (sin(-(real(z)+(4+imag(@fp2))*nindex))+cos(-(imag(z)+(4+imag(@fp2))*nindex)))/15 else nindex = (sin(5*sqrt(real(@fp2))*(real(z)+(4+imag(@fp2))*nindex))+cos(5*1/sqrt(real(@fp2))*(imag(z)+(4+imag(@fp2))*nindex)))/15 endif endif nindex = real(nindex^@power2) if i == 1 x = nindex elseif i == 2 y = nindex else sindex = sindex + nindex/scale^@beta endif endwhile if @mode != 2 sum = sum + a*sindex else sum = sum + a*abs(sindex) endif sindex = 0 scale = 1 endwhile if @mode == 2 sum = 3*abs(sum) endif if @mode == 1 sindex = sum/(10*@eps*(abs(@cbl + @ctl + @cbr + @ctr)+1)) else sindex = sum endif if @interp == 0 d = 2*norm*sindex/(niter)^.5 else d = .4*norm*sindex endif if @v_monniersfbm >= 104 z = exp(flip(2 * #pi * sqrt(2) * d)) endif m_lastz = z return d endfunc protected: complex z complex zc1 complex zc2 complex zc3 complex zc4 int i int j int jmax int niter float a float sum float x float y float d1 float d2 float d3 float d4 float nindex float sindex float scale float cr1r float cr1i float cr2r float cr2i float cr3r float cr3i float cr4r float cr4i float crp1 float crp2 float crp3 float crp4 float norm float d default: title = "Monnier's S.F.B.M. II Texture" int param v_monniersfbm caption = "Version (Monnier's S.F.B.M. II Texture)" default = 104 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_monniersfbm < 104 endparam param init caption = "Init with each iter" default = true visible = @v_monniersfbm >= 102 endparam param size caption = "Pattern Size" default = 0.1 endparam param noise caption = "Noise Function" default = 0 enum = "Perlin" "Raw Gird" "Strips" "Corners" "Checkerboard" \ "Soft Gird" "Circles" "Soft Circles" "Squares" "Soft Squares" \ "Octogons" "Soft Octogons" "Roundy Truchet" "Soft Roundy Truchet" \ "Squarry Truchet" "Soft Squarry Truchet" endparam param noisep caption = "Noise F. Parameters" default = (.2,.5) hint = "Noise Function Parameters" endparam param f1 caption = "flavor 1" default = 0 enum = "Original" "Wavy" "Blobs" "Cut" "Messy" "Soft I" "Strings" "Soft II" "Sharp" "String-Sharp" "Random Phase" endparam param fp1 caption = "flavor 1 Parameters" default = (1,0) hint = "flavor 1 Parameters" endparam param f2 caption = "flavor 2" default = 0 enum = "Original" "Wavy" "Blobs" "Cut" "Messy" "Soft I" "Strings" "Soft II" "Sharp" "String-Sharp" "Random Phase" endparam param fp2 caption = "flavor 2 Parameters" default = (1,0) hint = "flavor 2 Parameters" endparam param mode caption = "Mode" default = 0 enum = "Normal" "Convolution" "Absolute Convolution" endparam param beta caption = "Beta (Spectral Density Parameter)" default = 1.0 hint = "Spectral Density Exponent" endparam param power caption = "Power" default = 2.0 endparam param power2 caption = "Post-Power" default = 1.0 endparam param pp caption = "Pre-Processing" default = (0,1) endparam param pptype caption = "Pre-Processing Type" default = 0 enum = "Cartesian" "Polar" hint = "Pre-Processing Type" endparam param ppp caption = "Pre-P. Power and Aspect" default = (1,1) hint = "Pre-Processing Power and Aspect" endparam param rot caption = "Rotation Step" default = 28.0 endparam param mstep caption = "Frequency Separation" default = 1.0 hint = "Frequency Separation" endparam param fmm caption = "Inv. of max/min Frequency" default = (40,1) hint = "Inverse of max/min Frequency" endparam param interp caption = "Frequency Interpolation" default = 0 enum = "Logarithmic" "Linear" hint = "Frequency Interpolation" endparam param cc caption = "Center Extra Weight" default = 0.0 endparam param cbl caption = "Bottom Left Weight" default = 1.0 endparam param ctl caption = "Top Left Weight" default = 0.0 endparam param cbr caption = "Bottom Right Weight" default = 0.0 endparam param ctr caption = "Top Right Weight" default = 0.0 endparam param eps caption = "Epsilon" default = 0.006 endparam } class REB_TrapShapeSlopeBasic(common.ulb:TrapShape) { ; Provides the basic trap shapes for Slope with Shapes.
public: import "common.ulb" ; constructor func REB_TrapShapeSlopeBasic(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; call for each iterated point float func Iterate(complex pz) TrapShape.Iterate(pz) float m_d = 0 if @zmode == 0 m_d = -10000 elseif @zmode == 1 m_d = |pz|; get current distance from origin elseif @zmode == 2 m_d = abs(real(pz)); get current distances from i axis elseif @zmode == 3 m_d = abs(imag(pz)); get current distances from r axis elseif @zmode == 4 m_d = abs(real(pz))+abs(imag(pz)); get current distances from i axis elseif @zmode == 5 m_d = abs(atan2(pz)); get current angles elseif @zmode == 6 m_d = -20000 endif m_lastZ = pz return m_d endfunc default: title = "Slope Basics" int param v_slopebasics caption = "Version (Slope Basics)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_slopebasics < 101 endparam heading text = "This plugin provides the basic slope height values." endheading param zmode caption = "Basic heights" default = 0 enum = "smoothed iteration" "smallest |z|" "smallest |real(z)|" \ "smallest |imag(z)|" "smallest summ(z)" "smallest |atan(z)|" endparam } class REB_ImageTileTexture(common.ulb:TrapShape) { ; ; Uses an image to create a texture.
;

; Converts the colors of an imported image to greyscale and then converts ; the greyscale value to a complex number to use as a texture. ; public: import "common.ulb" ; Constructor func REB_ImageTileTexture(Generic pparent) TrapShape.TrapShape(pparent) m_img = new @f_image(0) m_empty = m_img.GetEmpty() endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) color pcolor = rgba(0,0,0,0) if !m_empty complex m_zi = (0,1)^(@iangle/90.0) complex m_zs = (0,1)^(@sangle/90.0) complex pzrs = pz ; offset if !@itile pzrs = pzrs+@ioffset endif ; aspect ratio pzrs = real(pzrs) + flip(imag(pzrs)*@iaspect) ; rotation pzrs = pzrs*m_zi ; skew pzrs = real(pzrs)*m_zs + flip(imag(pzrs)) float width = m_img.getWidth() float height = m_img.getHeight() if @itile if @v_trapshapeimagetiletexture >= 103 pzrs = (pzrs+500+flip(500))*@scale*500 else pzrs = (pzrs+#width/2+flip(#height/2))*@scale*#width endif complex c = @adjx-2*((real(pzrs) % (width-1))/width) + \ flip(@adjy-2*((imag(pzrs) % (height-1))/height)) pcolor = m_img.getColor(c) else pcolor = m_img.getColor(pzrs*@scale) endif endif m_LastZ = exp(flip(2 * #pi * sqrt(2) * (1 - (0.3 * red(pcolor)+ 0.59 * green(pcolor) + 0.11 * blue(pcolor))))) return 1 - (0.3 * red(pcolor)+ 0.59 * green(pcolor) + 0.11 * blue(pcolor)) endfunc protected: ImageImport m_img int m_image_width int m_image_height float m_ratio bool m_empty default: title = "Image Tile Texture" int param v_trapshapeimagetiletexture caption = "Version (Trap Shape Image Tile Texture)" default = 103 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeimagetiletexture < 103 endparam heading caption = "Image Parameters" endheading ImageImport param f_image caption = "Image" default = ImageImport endparam float param scale caption = "Image scale" default = 1 min = 0 hint = "Changes the scale of the image." endparam float param adjx caption = "Tile adj x" default = 0.99 min = 0.9 max = 1.1 endparam float param adjy caption = "Tile adj y" default = 0.999 min = 0.9 max = 1.1 endparam complex param ioffset caption = "Image offset" default = (0,0) visible = !@itile endparam float param iaspect caption = "Image aspect" default = 1.0 endparam float param iangle caption = "Image rotation" default = 0 hint = "Rotates the image" endparam float param sangle caption = "Image skew" default = 0 hint = "Skews the image" endparam bool param itile caption = "Tile the image" default = false endparam } class REB_TrapShapeChip(common.ulb:TrapShape) { ; Based upon the Chip strange attractor. Can also be used as a texture.
public: import "common.ulb" ; Constructor func REB_TrapShapeChip(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x if x != 0 x = y - x/abs(x)*cos(sqr(log(abs(@h2*x-@h3))))*atan(sqr(log(abs(@h3*x-@h2)))) else x = y - cos(sqr(log(abs(@h2*x-@h3))))*atan(sqr(log(abs(@h3*x-@h2)))) endif y = @h1 - pxx att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Chip" heading text="Chip Attractor" endheading heading text="x -> y - sign(x)*cos(sqr(log(abs(b*x - c)))) \ * atan(sqr(log(abs(c*x - b))))" endheading heading text="y -> a - x" endheading int param v_trapshapechip caption = "Version (Trap Shape Chip)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapechip < 101 endparam float param h1 caption = "Chip param 1" default = -15 endparam float param h2 caption = "Chip param 2" default = -3 endparam float param h3 caption = "Chip param 3" default = 1 endparam float param distscale caption = "Distance scale" default = 0.01 endparam float param s caption = "Attractor scale" default = 40 endparam int param max_att_iterations caption = "Attractor iterations" default = 5 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeChip2(common.ulb:TrapShape) { ; Based upon the Chip strange attractor. Can also be used as a texture.
public: import "common.ulb" ; Constructor func REB_TrapShapeChip2(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float scale = sqrt(@h1*@h1+@h2*@h2+@h3*@h3) scale = @scaleadj*scale int sgn = 1 if @sgn sgn = -1 endif complex p = pz p = @fn1(p) float x = real(p)*scale float y = imag(p)*scale float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x if x != 0 x = y - x/abs(x)*cos(sqr(log(abs(@h2*x-@h3))))*atan(sqr(log(abs(@h3*x-@h2)))) else x = y - cos(sqr(log(abs(@h2*x-@h3))))*atan(sqr(log(abs(@h3*x-@h2)))) endif y = @h1 - pxx att_iter = att_iter + 1 endwhile m_LastZ = @fn2(x + sgn*flip(y)) float d = abs(|pz| - |m_LastZ|) if @v_trapshapechip2 >= 102 d = d*@dscale endif return d endfunc default: title = "Chip 2" heading caption="Chip Attractor" endheading heading text="x -> y - sign(x)*cos(sqr(log(abs(b*x - c)))) \ * atan(sqr(log(abs(c*x - b))))" endheading heading text="y -> a - x" endheading int param v_trapshapechip2 caption = "Version (Trap Shape Chip 2)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapechip2 < 102 endparam float param h1 caption = "Chip param 1" default = -15 endparam float param h2 caption = "Chip param 2" default = -3 endparam float param h3 caption = "Chip param 3" default = 1 endparam float param dscale caption = "Distance scale" default = 1 visible = @v_trapshapechip2 >= 102 endparam float param scaleadj caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 1 endparam func fn1 caption = "Pre Function" default = atan() endfunc func fn2 caption = "Post Function" default = sinh() endfunc bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeHenon2(common.ulb:TrapShape) { ; Uses the Henon strange attractor as the trap shape. public: import "common.ulb" ; Constructor func REB_TrapShapeHenon2(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float scale = sqrt(@h1*@h1+@h2*@h2) scale = @scaleadj*scale int sgn = 1 if @sgn sgn = -1 endif complex p = pz p = @fn1(p) float x = real(p)*scale float y = imag(p)*scale float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = 1 + y - @h1*x*x y = @h2*pxx att_iter = att_iter + 1 endwhile m_LastZ = @fn2(x + sgn*flip(y)) float d = abs(|pz| - |m_LastZ|) if @v_trapshapehenon2 >= 102 d = d*@dscale endif return d endfunc default: title = "Henon 2" heading text = "Henon attractor" endheading heading text = "x -> 1 + y - h1*x^2" endheading heading text = "y -> h2*x" endheading int param v_trapshapehenon2 caption = "Version (Trap Shape Henon 2)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapehenon2 < 102 endparam float param h1 caption = "Henon param 1" default = 1.4 endparam float param h2 caption = "Henon param 2" default = 0.3 endparam float param dscale caption = "Distance scale" default = 1 visible = @v_trapshapehenon2 >= 102 endparam float param scaleadj caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 5 endparam func fn1 caption = "Pre Function" default = atan() endfunc func fn2 caption = "Post Function" default = sinh() endfunc bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeHopalong2(common.ulb:TrapShape) { ; Uses the Hopalong strange attractor as the trap shape. Can also be used as a texture. public: import "common.ulb" ; Constructor func REB_TrapShapeHopalong2(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float scale = sqrt(@h1*@h1+@h2*@h2+@h3*@h3) scale = @scaleadj*scale int sgn = 1 if @sgn sgn = -1 endif complex p = pz p = @fn1(p) float x = real(p)*scale float y = imag(p)*scale float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations pxx = x if x != 0 x = y - x/abs(x)*sqrt(abs(@h2*x-@h3)) else x = y - sqrt(abs(@h2*x-3)) endif y = @h1 - pxx att_iter = att_iter + 1 endwhile m_LastZ = @fn2(x + sgn*flip(y)) float d = abs(|pz| - |m_LastZ|) if @v_trapshapehopalong2 >= 102 d = d*@dscale endif return d endfunc default: title = "Hopalong 2" heading text="Hopalong Attractor" endheading heading text="x -> y - sign(x)*sqrt(abs(b*x-c))" endheading heading text="y -> a - x" endheading int param v_trapshapehopalong2 caption = "Version (Trap Shape Hopalong 2)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapehopalong2 < 102 endparam float param h1 caption = "Hopalong param 1" default = 0.4 endparam float param h2 caption = "Hopalong param 2" default = 1 endparam float param h3 caption = "Hopalong param 3" default = 0 endparam float param dscale caption = "Distance scale" default = 1 visible = @v_trapshapehopalong2 >= 102 endparam float param scaleadj caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 1 endparam func fn1 caption = "Pre Function" default = atan() endfunc func fn2 caption = "Post Function" default = sinh() endfunc bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShape4DOrbit(common.ulb:TrapShape) { ; Based upon the 4D fractal formula approach of Gordon Lamb.
;

; This class can be used to explore in the two "hybridised" planes. ; Type SJ iterates in the "zc" plane, and type 3RDIM in the "cz" plane. ; The trap can create multiple fractal images of the chosen function. public: import "common.ulb" ; Constructor func REB_TrapShape4DOrbit(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) p = (0,0) px = pz*@scale c = 0 if @function == "Julia Frame-Robert" || @function == "Julia Ikenaga" || \ @function == "Julia Lambda" || @function == "Julia" px = @seed p = pz*@scale endif if @variant == "SJ" p = real(p) + flip(imag(p)*@r) c = @t + @r*real(px) + flip(imag(px)) else p = @r*real(p) + flip(imag(p)) c = @t + real(px) + flip(imag(px)*@r) endif p = @fn1(p) rt_iter = 0 while rt_iter < @max_iterations && (|p| < @bailout) if @function == "Mandelbrot" || @function == "Julia" p = p*p + c elseif @function == "Julia Lambda" p = c*p*(1-p) elseif @function == "Ikenaga" || @function == "Julia Ikenaga" p = p*p*p + (c-1)*p-c elseif @function == "Frame-Robert" || @function == "Julia Frame-Robert" p = p*p*p/5 + p*p + c endif rt_iter = rt_iter + 1 endwhile m_LastZ = @fn2(p) float d = abs(cabs(pz)-cabs(m_LastZ)) return d endfunc protected: complex p complex px complex c int rt_iter default: title = "4D Orbit" int param v_trapshape4dorbit caption = "Version (Trap Shape 4D Orbit)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshape4dorbit < 101 endparam param t caption = "Translation" default = -0.75 endparam param r caption = "Tilt" default = 0.5 min = 0 max = 1 hint = "This parameter takes values between 0 and 1 inclusive." endparam param variant caption = "4D variant" default = 0 enum = "SJ" "3RDIM" hint = "These variants are based upon Gordon Lamb's 4D formulas." endparam param max_iterations caption = "4D iterations" hint = "This is the number of iterations for the 4D formula." default = 10 endparam float param bailout caption = "Bailout" default = 10000.0 endparam float param scale caption = "Scale" default = 1.0 endparam param function caption = "4D Fractal" default = 1 enum = "Frame-Robert" "Ikenaga" "Mandelbrot" "Julia Frame-Robert" \ "Julia Ikenaga" "Julia Lambda" "Julia" endparam complex param seed caption = "Julia seed" default = (0,0) visible = @function == "Julia Frame-Robert" || @function == "Julia Ikenaga" \ || @function == "Julia Lambda" || @function == "Julia" endparam func fn1 caption = "Pre Function" default = ident() endfunc func fn2 caption = "Post Function" default = ident() endfunc } class REB_TrapShapeCosMartin(common.ulb:TrapShape) { ; Uses the CosMartin strange attractor as the trap shape. Can also be used as a texture.
; CosMartin is the cosine variant of the Martin strange attractor.
public: import "common.ulb" ; Constructor func REB_TrapShapeCosMartin(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = y - cos(x) y = @h1 - pxx att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "CosMartin" heading text="CosMartin Attractor" endheading heading text="x -> y - cos(x)" endheading heading text="y -> a - x" endheading int param v_trapshapecosmartin caption = "Version (Trap Shape CosMartin)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecosmartin < 101 endparam float param h1 caption = "CosMartin param" default = 6.28 endparam float param distscale caption = "Distance scale" default = 0.01 endparam float param s caption = "Attractor scale" default = 15 endparam int param max_att_iterations caption = "Attractor iterations" default = 5 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeCosMartin2(common.ulb:TrapShape) { ; Uses the CosMartin strange attractor as the trap shape. Can also be used as a texture.
; CosMartin is the cosine variant of the Martin strange attractor.
public: import "common.ulb" ; Constructor func REB_TrapShapeCosMartin2(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float scale = @h1 scale = @scaleadj*scale int sgn = 1 if @sgn sgn = -1 endif complex p = pz p = @fn1(p) float x = real(p)*scale float y = imag(p)*scale float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = y - cos(x) y = @h1 - pxx att_iter = att_iter + 1 endwhile m_LastZ = @fn2(x + sgn*flip(y)) float d = abs(|pz| - |m_LastZ|) if @v_trapshapecosmartin2 >= 102 d = d*@dscale endif return d endfunc default: title = "CosMartin 2" heading text="CosMartin Attractor" endheading heading text="x -> y - cos(x)" endheading heading text="y -> a - x" endheading int param v_trapshapecosmartin2 caption = "Version (Trap Shape CosMartin 2)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecosmartin2 < 102 endparam float param h1 caption = "CosMartin param" default = 6.28 endparam float param dscale caption = "Distance scale" default = 1 visible = @v_trapshapecosmartin2 >= 102 endparam float param scaleadj caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 1 endparam func fn1 caption = "Pre Function" default = atan() endfunc func fn2 caption = "Post Function" default = sinh() endfunc bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeHenon(common.ulb:TrapShape) { ; This shape uses the Henon strange attractor public: import "common.ulb" ; Constructor func REB_TrapShapeHenon(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = 1 + y - @h1*x*x y = @h2*pxx att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Henon" heading text = "Henon attractor" endheading heading text = "x -> 1 + y - h1*x^2" endheading heading text = "y -> h2*x" endheading int param v_trapshapehenon caption = "Version (Trap Shape Henon)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapehenon < 101 endparam float param h1 caption = "Henon param 1" default = 1.4 endparam float param h2 caption = "Henon param 2" default = 0.3 endparam float param distscale caption = "Distance scale" default = 1.0 endparam float param s caption = "Attractor scale" default = 1.0 endparam int param max_att_iterations caption = "Attractor iterations" default = 5 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeGingerbread(common.ulb:TrapShape) { ; This shape uses the Gingerbread strange attractor. public: import "common.ulb" ; Constructor func REB_TrapShapeGingerbread(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = 1 - y + abs(x) y = pxx att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Gingerbread" heading text = "Gingerbread attractor" endheading heading text = "x -> y + abs(x)" endheading heading text = "y -> x" endheading int param v_trapshapegingerbread caption = "Version (Trap Shape Gingerbread)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapegingerbread < 101 endparam float param distscale caption = "Distance scale" default = 0.07 endparam float param s caption = "Attractor scale" default = 10 endparam int param max_att_iterations caption = "Attractor iterations" default = 10 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeDampedSine(common.ulb:TrapShape) { ; This shape uses the Damped sine equation. public: import "common.ulb" ; Constructor func REB_TrapShapeDampedSine(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@b float x = 5*@a*t float y = 5*@a*sin(t)/t m_lastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Damped Sine" int param v_DampedSine caption = "Version (Damped Sine)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_DampedSine < 100 endparam float param a caption = "Polar Parameter" default = 0.2 endparam float param b caption = "2nd polar Parameter" default = 1.0 endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam } class REB_TrapShapeHopalong(common.ulb:TrapShape) { ; This shape uses the Hopalong strange attractor. It can also be used as a texture.
public: import "common.ulb" ; Constructor func REB_TrapShapeHopalong(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x if x != 0 x = y - x/abs(x)*sqrt(abs(@h2*x-@h3)) else x = y - sqrt(abs(@h2*x-3)) endif y = @h1 - pxx att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Hopalong" heading text="Hopalong attractor" endheading heading text="x -> y - sign(x)*sqrt(abs(b*x-c))" endheading heading text="y -> a - x" endheading int param v_trapshapehopalong caption = "Version (Trap Shape Hopalong)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapehopalong < 101 endparam float param h1 caption = "Hopalong param 1" default = 0.4 endparam float param h2 caption = "Hopalong param 2" default = 1 endparam float param h3 caption = "Hopalong param 3" default = 0 endparam float param distscale caption = "Distance scale" default = 0.06 endparam float param s caption = "Attractor scale" default = 3 endparam int param max_att_iterations caption = "Attractor iterations" default = 5 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeKam_Torus(common.ulb:TrapShape) { ; This shape uses the Hopalong strange attractor. It can also be used as a texture.
public: import "common.ulb" ; Constructor func REB_TrapShapeKam_Torus(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s+@sorbit float y = imag(pz)*@s+@sorbit float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = x*cos(@a) - (y - x^2)*sin(@a) y = pxx*sin(@a) + (y - pxx^2)*cos(@a) att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Kam Torus" heading text = "Kam Torus attractor" endheading heading text = "Kam Torus is the phase map for the Henon attractor" endheading heading text = "x -> x*cos(a) - (y-x^2)*sin(a)" endheading heading text = "y -> x*sin(a) + (y-x^2)*cos(a)" endheading heading text = "The full phase map is determined by progressing through a continuum of \ starting points for x and y." endheading int param v_trapshapeKamTorus caption = "Version (Trap Shape Kam Torus)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeKamTorus < 101 endparam float param a caption = "Kam Torus param" default = 1.57 endparam float param sorbit caption = "Start orbit" default = 0.0 endparam float param distscale caption = "Distance scale" default = 1 endparam float param s caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 100 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeLatoocarfian(common.ulb:TrapShape) { ; This shape uses the Latoocarfian strange attractor public: import "common.ulb" ; Constructor func REB_TrapShapeLatoocarfian(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = sin(y*@h2) + @h3*sin(x*@h2) y = sin(pxx*@h1) + @h4*sin(y*@h1) att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Latoocarfian" heading text = "Latoocarfian attractor" endheading heading text = "x -> sin(h2*y) + h3*sin(h2*x)" endheading heading text = "y -> sin(h1*x) + h4*sin(h1*y)" endheading int param v_trapshapelatoocarfian caption = "Version (Trap Shape Latoocarfian)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapelatoocarfian < 101 endparam float param h1 caption = "Latoocarfian 1" default = --0.960918 endparam float param h2 caption = "Latoocarfian 2" default = 2.879879 endparam float param h3 caption = "Latoocarfian 3" default = 0.765145 endparam float param h4 caption = "Latoocarfian 4" default = 0.744728 endparam float param distscale caption = "Distance scale" default = 1 endparam float param s caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 5 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeKaneko(common.ulb:TrapShape) { ; This shape uses the Kaneko strange attractor ; Suggested values to try: ; a b ;----------------- ; 0.1 1.67 ; 0.5 4.0 ; 0.17 1.3 ; 0.562 2.76 public: import "common.ulb" ; Constructor func REB_TrapShapeKaneko(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x if @kantype == "I" x = @a*x + (1-@a)*(1-@b*y^2) else x = @a*x + (1-@a)*(1-@b*abs(y)) endif y = pxx att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Kaneko" heading text = "Kaneko attractor" endheading heading text = "There are two forms of the Kaneko attractor" endheading heading text = " Form I" endheading heading text = "x -> a*x + (1-a)*(1-b*y^2)" endheading heading text = "y -> x" endheading heading text = " Form II" endheading heading text = "x -> a*x + (1-a)*(1-b*abs(y))" endheading heading text = "y -> x" endheading int param v_trapshapeKaneko caption = "Version (Trap Shape Kaneko)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeKaneko < 100 endparam param kantype caption = "Kaneko type" default = 0 enum = "I" "II" endparam param a caption = "parameter a" default = 0.4 endparam param b caption = "parameter b" default = 2.76 endparam float param distscale caption = "Distance scale" default = 0.5 endparam float param s caption = "Attractor scale" default = 2.5 endparam int param max_att_iterations caption = "Attractor iterations" default = 10 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeMira(common.ulb:TrapShape) { ; This shape uses the Mira strange attractor ; Suggested values to try: ; a b ;----------------- ; 0.29 1.0005 ; -0.48 0.93 ; -0.4 0.9999 ; -0.2 1.000 public: import "common.ulb" ; Constructor func REB_TrapShapeMira(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = @b*y + @a*x - (1-@a)*2*x^2/(1+x^2)^2 y = -pxx + @a*pxx - (1-@a)*2*pxx^2/(1+pxx^2)^2 att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Mira" heading text = "Mira attractor" endheading heading text = "x -> b*y + a*x - (1-a)*2*x^2/(1+x^2)^2" endheading heading text = "y -> -x + a*x - (1-a)*2*x^2/(1+x^2)^2" endheading int param v_trapshapeMira caption = "Version (Trap Shape Mira)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeMira < 100 endparam param a caption = "parameter a" default = -.399000001 endparam param b caption = "parameter b" default = 1.000001 endparam float param distscale caption = "Distance scale" default = 0.5 endparam float param s caption = "Attractor scale" default = 2.5 endparam int param max_att_iterations caption = "Attractor iterations" default = 10 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeTinkerbell(common.ulb:TrapShape) { ; This shape uses the Tinkerbell strange attractor public: import "common.ulb" ; Constructor func REB_TrapShapeTinkerbell(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s + @xoff float y = imag(pz)*@s + @yoff float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = x^2 - y^2 + @a*x + @b*y y = 2*pxx*y + @c*pxx + @d*y att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Tinkerbell" heading text = "Tinkerbell attractor" endheading heading text = "x -> x^2 - y^2 + a*x + b*y" endheading heading text = "y -> 2*x*y + c*x + d*y" endheading int param v_trapshapeTinkerbell caption = "Version (Trap Shape Tinkerbell)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeTinkerbell < 100 endparam float param a caption = "parameter a" default = 0.9 endparam float param b caption = "parameter b" default = -0.6103 endparam float param c caption = "parameter c" default = 2.0 endparam float param d caption = "parameter d" default = 0.5 endparam float param xoff caption = "x offset" default = -0.72 endparam float param yoff caption = "y offset" default = -0.64 endparam float param distscale caption = "Distance scale" default = 0.5 endparam float param s caption = "Attractor scale" default = -0.5 endparam int param max_att_iterations caption = "Attractor iterations" default = 15 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeLiar(common.ulb:TrapShape) { ; This shape uses the Liar formula of Chuck Ebbert. It is a texture shape.
public: import "common.ulb" ; Constructor func REB_TrapShapeLiar(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations pxx = x if @liartype == 0 if real(x + flip(pz)) < (@h1) x = @h2 - abs(y-x) y = abs(@h3 - pxx - y) endif elseif @liartype == 1 if imag(x + flip(pz)) < (@h1) x = @h2 - abs(y-x) y = abs(@h3 - pxx - y) endif else if cabs(x + flip(pz)) < (@h1) x = @h2 - abs(y-x) y = abs(@h3 - pxx - y) endif endif att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Liar" heading text = "Liar attractor" endheading heading text = "There are three Liar types which depend upon the value of x + flip(z) \ where the real, the imaginary or the cabs value is compared to the \ parameter h1. If the quantity is less than h1 then new values of x \ and y are calculated, otherwise they are left the same. z is the complex \ value passed from the fractal function." endheading heading text = "x -> h2 - abs(y-x)" endheading heading text = "y -> abs(h3-x-y)" endheading int param v_trapshapeliar caption = "Version (Trap Shape Liar)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeliar < 101 endparam param liartype caption = "Liar type" default = 0 enum = "real" "imag" "abs" endparam float param h1 caption = "Liar 1" default = 2.0 endparam float param h2 caption = "Liar 2" default = 0.5 endparam float param h3 caption = "Liar 3" default = 0.5 endparam float param distscale caption = "Distance scale" default = 0.5 endparam float param s caption = "Attractor scale" default = 0.1 endparam int param max_att_iterations caption = "Attractor iterations" default = 20 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapePickover(common.ulb:TrapShape) { ; This shape uses the Pickover strange attractor public: import "common.ulb" ; Constructor func REB_TrapShapePickover(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float ppz = @ppz float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations pxx = x x = real(@pfun1(y*@h1) - ppz*@pfun2(x*@h2)) y = real(ppz*@pfun3(pxx*@h3) - @pfun4(y*@h4)) ppz = real(@h5*@pfun5(pxx)) att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)+ppz*@pw) float d = @distscale*|pz-(x + sgn*flip(y) + ppz*@pw)| return d endfunc default: title = "Pickover" heading text = "Pickover attractor" endheading heading text = "This attractor has been generalized to allow the use of multiple function \ settings." endheading heading text = "x -> fun1(y*h1) - z*fun2(x*h2)" endheading heading text = "y -> z*fun3(x*h3) - fun4(y*h4)" endheading heading text = "z -> h5*fun5(x)" endheading int param v_trapshapepickover caption = "Version (Trap Shape Pickover)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapepickover < 101 endparam heading text = "'Initialize Height' sets the starting z value for the attractor." endheading float param ppz caption = "Initialize Height" default = 0.5 endparam heading text = "'Height weight' determines the weight of the final z value which is added \ to the trap distance." endheading complex param pw caption = "Height weight" default = (0.5,0) endparam float param h1 caption = "Pickover 1" default = 2.24 endparam float param h2 caption = "Pickover 2" default = 0.43 endparam float param h3 caption = "Pickover 3" default = -0.65 endparam float param h4 caption = "Pickover 4" default = -2.43 endparam float param h5 caption = "Pickover 5" default = 1 endparam func pfun1 caption = "Pickover Fn 1" default = sin() endfunc func pfun2 caption = "Pickover Fn 2" default = cos() endfunc func pfun3 caption = "Pickover Fn 3" endfunc func pfun4 caption = "Pickover Fn 4" default = cos() endfunc func pfun5 caption = "Pickover Fn 5" default = sin() endfunc float param distscale caption = "Distance scale" default = 0.5 endparam float param s caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 5 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeQuadruptwo(common.ulb:TrapShape) { ; This shape uses the Quadruptwo strange attractor. public: import "common.ulb" ; Constructor func REB_TrapShapeQuadruptwo(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x if x != 0 x = y - x/abs(x)*sin(log(abs(@h2*x-@h3))) \ *atan(sqr(log(abs(@h3*x-@h2)))) else x = y - sin(log(abs(@h2*x-@h3))) \ *atan(sqr(log(abs(@h3*x-@h2)))) endif y = @h1 - pxx att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Quadruptwo" int param v_trapshapequadruptwo caption = "Version (Trap Shape Quadruptwo)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapequadruptwo < 101 endparam float param h1 caption = "Quadruptwo param 1" default = 34 endparam float param h2 caption = "Quadruptwo param 2" default = 1 endparam float param h3 caption = "Quadruptwo param 3" default = 5 endparam float param distscale caption = "Distance scale" default = 0.0001 endparam float param s caption = "Attractor scale" default = 30 endparam int param max_att_iterations caption = "Attractor iterations" default = 50 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeSierpinski(common.ulb:TrapShape) { ; This shape uses the Sierpinski strange attractor. public: import "common.ulb" ; Constructor func REB_TrapShapeSierpinski(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) complex pp = pz*@s int att_iter = 0 while att_iter < @max_att_iterations if (imag(pp) > @h3) pp = @h1*real(pp) + flip(@h1*imag(pp) -@h2) elseif (real(pp) > @h4) pp = @h1*real(pp) -@h2 + flip(@h1*imag(pp)) else pp = @h1*real(pp) + flip(@h1*imag(pp)) endif att_iter = att_iter + 1 endwhile if !@sgn m_LastZ = pp else m_LastZ = conj(pp) endif float d = @distscale*|pz-pp| return d endfunc default: title = "Sierpinski" heading text = "Sierpinski atractor" endheading int param v_trapshapesierpinski caption = "Version (Trap Shape Sierpinski)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesierpinski < 101 endparam float param h1 caption = "Sierpinski 1" default = 2 endparam float param h2 caption = "Sierpinski 2" default = 1 endparam float param h3 caption = "Sierpinski 3" default = 0.5 endparam float param h4 caption = "Sierpinski 4" default = 0.5 endparam float param distscale caption = "Distance scale" default = 1 endparam float param s caption = "Attractor scale" default = 0.1 endparam int param max_att_iterations caption = "Attractor iterations" default = 10 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeSprott3D(common.ulb:TrapShape) { ; This shape uses a Sprott strange attractor.
;

; The Sprott attractors were developed by Julien C. Sprott, and are ; based upon polynomials and linear differential equations of polynomials. public: import "common.ulb" ; Constructor func REB_TrapShapeSprott3D(Generic pparent) TrapShape.TrapShape(pparent) s3[0,1]=0.3,s3[0,2]=-0.8,s3[0,3]=-0.8,s3[0,4]=1.2,s3[0,5]=0.6,s3[0,6]=0.3,s3[0,7]=-0.7,s3[0,8]=0.5,s3[0,9]=-0.7,s3[0,10]=0.1,s3[0,11]=0.1,s3[0,12]=-0.4,s3[0,13]=0.7,s3[0,14]=0.7 s3[0,15]=-0.3,s3[0,16]=-0.5,s3[0,17]=1.0,s3[0,18]=-0.7,s3[0,19]=0.9,s3[0,20]=-0.3,s3[0,21]=0.1,s3[0,22]=0.8,s3[0,23]=0.4,s3[0,24]=-1.0,s3[0,25]=0.3,s3[0,26]=-1.0,s3[0,27]=0.6,s3[0,28]=0.2,s3[0,29]=-0.5,s3[0,30]=0.7 s3[1,1]=0.2,s3[1,2]=-0.6,s3[1,3]=1.1,s3[1,4]=-0.9,s3[1,5]=1.0,s3[1,6]=-0.4,s3[1,7]=1.2,s3[1,8]=-0.2,s3[1,9]=-0.3,s3[1,10]=-0.3,s3[1,11]=0.2,s3[1,12]=-0.5,s3[1,13]=0.7,s3[1,14]=0.3 s3[1,15]=-0.5,s3[1,16]=-0.1,s3[1,17]=0.2,s3[1,18]=-1.1,s3[1,19]=-0.2,s3[1,20]=-0.9,s3[1,21]=-0.6,s3[1,22]=0.5,s3[1,23]=1.1,s3[1,24]=-0.7,s3[1,25]=-0.9,s3[1,26]=-0.5,s3[1,27]=0.8,s3[1,28]=0.6,s3[1,29]=0.9,s3[1,30]=0.9 s3[2,1]=-1.0,s3[2,2]=0.2,s3[2,3]=-0.2,s3[2,4]=-0.1,s3[2,5]=-0.5,s3[2,6]=1.0,s3[2,7]=-0.5,s3[2,8]=-0.6,s3[2,9]=0.8,s3[2,10]=0.6,s3[2,11]=0.2,s3[2,12]=-0.9,s3[2,13]=-1.0,s3[2,14]=0.8 s3[2,15]=0.4,s3[2,16]=-0.4,s3[2,17]=0.3,s3[2,18]=-0.5,s3[2,19]=1.2,s3[2,20]=-0.5,s3[2,21]=0.8,s3[2,22]=-0.7,s3[2,23]=-0.6,s3[2,24]=-1.1,s3[2,25]=0.1,s3[2,26]=-1.2,s3[2,27]=-0.1,s3[2,28]=1.1,s3[2,29]=0.3,s3[2,30]=-1.0 s3[3,1]=-0.2,s3[3,2]=0.5,s3[3,3]=-0.6,s3[3,4]=0.3,s3[3,5]=0.6,s3[3,6]=-1.1,s3[3,7]=0.7,s3[3,8]=-0.3,s3[3,9]=0.6,s3[3,10]=-0.7,s3[3,11]=-0.3,s3[3,12]=0.6,s3[3,13]=-0.6,s3[3,14]=0.4 s3[3,15]=-1.1,s3[3,16]=-0.6,s3[3,17]=0.7,s3[3,18]=-1.2,s3[3,19]=0.5,s3[3,20]=-1.1,s3[3,21]=0.7,s3[3,22]=0.0,s3[3,23]=-0.4,s3[3,24]=0.1,s3[3,25]=0.5,s3[3,26]=0.4,s3[3,27]=-0.5,s3[3,28]=0.4,s3[3,29]=0.5,s3[3,30]=-0.9 s3[4,1]=-0.4,s3[4,2]=0.6,s3[4,3]=1.2,s3[4,4]=-0.5,s3[4,5]=1.0,s3[4,6]=-0.6,s3[4,7]=-1.0,s3[4,8]=1.2,s3[4,9]=0.4,s3[4,10]=0.8,s3[4,11]=-0.6,s3[4,12]=0.9,s3[4,13]=0.6,s3[4,14]=0.0 s3[4,15]=0.1,s3[4,16]=-0.8,s3[4,17]=0.2,s3[4,18]=-0.1,s3[4,19]=-0.5,s3[4,20]=-0.3,s3[4,21]=-0.4,s3[4,22]=0.6,s3[4,23]=0.0,s3[4,24]=-0.8,s3[4,25]=-1.0,s3[4,26]=-0.6,s3[4,27]=-1.2,s3[4,28]=0.8,s3[4,29]=-0.6,s3[4,30]=0.9 s3[5,1]=-1.1,s3[5,2]=-0.9,s3[5,3]=-0.4,s3[5,4]=-0.9,s3[5,5]=0.3,s3[5,6]=-0.7,s3[5,7]=0.5,s3[5,8]=0.7,s3[5,9]=0.4,s3[5,10]=0.2,s3[5,11]=-0.1,s3[5,12]=-1.0,s3[5,13]=-0.6,s3[5,14]=-0.5 s3[5,15]=0.6,s3[5,16]=-1.0,s3[5,17]=1.2,s3[5,18]=-0.5,s3[5,19]=-1.0,s3[5,20]=1.2,s3[5,21]=0.5,s3[5,22]=-1.0,s3[5,23]=-0.2,s3[5,24]=-0.9,s3[5,25]=0.6,s3[5,26]=0.4,s3[5,27]=-1.0,s3[5,28]=0.5,s3[5,29]=-0.1,s3[5,30]=-0.1 s3[6,1]=-0.2,s3[6,2]=0.8,s3[6,3]=0.9,s3[6,4]=1.0,s3[6,5]=0.7,s3[6,6]=-0.7,s3[6,7]=0.4,s3[6,8]=1.1,s3[6,9]=-0.8,s3[6,10]=1.0,s3[6,11]=0.8,s3[6,12]=0.5,s3[6,13]=-0.1,s3[6,14]=-0.5 s3[6,15]=-0.2,s3[6,16]=-0.9,s3[6,17]=-0.5,s3[6,18]=-0.8,s3[6,19]=0.6,s3[6,20]=0.7,s3[6,21]=-0.1,s3[6,22]=-0.3,s3[6,23]=-0.8,s3[6,24]=0.5,s3[6,25]=-0.6,s3[6,26]=0.3,s3[6,27]=-0.1,s3[6,28]=-0.1,s3[6,29]=0.6,s3[6,30]=0.8 s3[7,1]=-0.2,s3[7,2]=0.3,s3[7,3]=-1.2,s3[7,4]=-0.8,s3[7,5]=-1.0,s3[7,6]=0.4,s3[7,7]=-0.3,s3[7,8]=1.0,s3[7,9]=1.0,s3[7,10]=-0.8,s3[7,11]=0.1,s3[7,12]=0.8,s3[7,13]=1.2,s3[7,14]=-0.6 s3[7,15]=0.3,s3[7,16]=-1.2,s3[7,17]=1.2,s3[7,18]=0.8,s3[7,19]=0.5,s3[7,20]=-0.6,s3[7,21]=0.4,s3[7,22]=0.1,s3[7,23]=-0.4,s3[7,24]=-0.8,s3[7,25]=-0.6,s3[7,26]=-0.6,s3[7,27]=-0.7,s3[7,28]=-0.3,s3[7,29]=-0.4,s3[7,30]=-0.1 s3[8,1]=1.0,s3[8,2]=-0.4,s3[8,3]=-1.1,s3[8,4]=0.6,s3[8,5]=-0.2,s3[8,6]=-0.7,s3[8,7]=-0.7,s3[8,8]=-0.1,s3[8,9]=1.0,s3[8,10]=1.2,s3[8,11]=-0.2,s3[8,12]=1.2,s3[8,13]=-0.9,s3[8,14]=-0.6 s3[8,15]=0.6,s3[8,16]=-0.1,s3[8,17]=-0.4,s3[8,18]=0.8,s3[8,19]=0.1,s3[8,20]=-0.3,s3[8,21]=-0.1,s3[8,22]=0.5,s3[8,23]=-0.7,s3[8,24]=0.2,s3[8,25]=-0.8,s3[8,26]=-0.6,s3[8,27]=-0.6,s3[8,28]=-1.0,s3[8,29]=0.4,s3[8,30]=1.0 s3[9,1]=0.6,s3[9,2]=-0.3,s3[9,3]=-0.8,s3[9,4]=-0.2,s3[9,5]=0.7,s3[9,6]=0.4,s3[9,7]=1.2,s3[9,8]=0.7,s3[9,9]=0.2,s3[9,10]=0.5,s3[9,11]=0.1,s3[9,12]=-0.8,s3[9,13]=0.2,s3[9,14]=-0.6 s3[9,15]=0.8,s3[9,16]=0.3,s3[9,17]=0.0,s3[9,18]=0.7,s3[9,19]=-1.1,s3[9,20]=0.2,s3[9,21]=-0.7,s3[9,22]=1.0,s3[9,23]=1.2,s3[9,24]=0.8,s3[9,25]=0.5,s3[9,26]=0.0,s3[9,27]=-0.7,s3[9,28]=-0.9,s3[9,29]=0.5,s3[9,30]=1.1 s3[10,1]=-0.2,s3[10,2]=0.4,s3[10,3]=0.7,s3[10,4]=1.2,s3[10,5]=0.5,s3[10,6]=1.0,s3[10,7]=-1.1,s3[10,8]=0.0,s3[10,9]=1.2,s3[10,10]=-0.6,s3[10,11]=0.1,s3[10,12]=-1.1,s3[10,13]=-0.5,s3[10,14]=0.1 s3[10,15]=-0.7,s3[10,16]=-0.6,s3[10,17]=0.0,s3[10,18]=0.2,s3[10,19]=0.6,s3[10,20]=0.6,s3[10,21]=0.3,s3[10,22]=-0.5,s3[10,23]=-0.2,s3[10,24]=0.6,s3[10,25]=1.1,s3[10,26]=-0.4,s3[10,27]=0.7,s3[10,28]=-0.1,s3[10,29]=-0.2,s3[10,30]=-0.8 s3[11,1]=0.1,s3[11,2]=0.6,s3[11,3]=-0.5,s3[11,4]=0.9,s3[11,5]=0.0,s3[11,6]=-0.4,s3[11,7]=1.0,s3[11,8]=-0.8,s3[11,9]=1.2,s3[11,10]=0.9,s3[11,11]=0.1,s3[11,12]=0.1,s3[11,13]=-0.3,s3[11,14]=0.6 s3[11,15]=0.8,s3[11,16]=0.1,s3[11,17]=0.2,s3[11,18]=-1.0,s3[11,19]=0.3,s3[11,20]=-0.9,s3[11,21]=0.7,s3[11,22]=0.3,s3[11,23]=-0.7,s3[11,24]=-1.0,s3[11,25]=1.0,s3[11,26]=0.9,s3[11,27]=-0.5,s3[11,28]=0.1,s3[11,29]=0.2,s3[11,30]=-1.1 s3[12,1]=1.0,s3[12,2]=-0.4,s3[12,3]=-0.3,s3[12,4]=-0.4,s3[12,5]=-0.2,s3[12,6]=0.6,s3[12,7]=-0.8,s3[12,8]=1.2,s3[12,9]=0.9,s3[12,10]=0.6,s3[12,11]=-0.1,s3[12,12]=0.3,s3[12,13]=-0.6,s3[12,14]=0.0 s3[12,15]=-0.3,s3[12,16]=-0.8,s3[12,17]=-0.1,s3[12,18]=0.0,s3[12,19]=0.7,s3[12,20]=1.0,s3[12,21]=-0.9,s3[12,22]=0.6,s3[12,23]=0.6,s3[12,24]=0.4,s3[12,25]=0.8,s3[12,26]=-0.6,s3[12,27]=0.7,s3[12,28]=-0.4,s3[12,29]=1.1,s3[12,30]=1.0 s3[13,1]=1.2,s3[13,2]=0.7,s3[13,3]=-0.9,s3[13,4]=-1.1,s3[13,5]=1.2,s3[13,6]=-0.4,s3[13,7]=-0.7,s3[13,8]=0.8,s3[13,9]=-0.9,s3[13,10]=0.4,s3[13,11]=0.0,s3[13,12]=0.3,s3[13,13]=-0.5,s3[13,14]=-0.6 s3[13,15]=-0.9,s3[13,16]=0.7,s3[13,17]=0.5,s3[13,18]=0.2,s3[13,19]=-0.2,s3[13,20]=-1.0,s3[13,21]=-0.1,s3[13,22]=-0.1,s3[13,23]=0.1,s3[13,24]=-0.5,s3[13,25]=-0.2,s3[13,26]=1.1,s3[13,27]=-0.4,s3[13,28]=0.8,s3[13,29]=-0.1,s3[13,30]=-1.0 s3[14,1]=-0.5,s3[14,2]=0.1,s3[14,3]=0.7,s3[14,4]=-0.6,s3[14,5]=0.9,s3[14,6]=-0.9,s3[14,7]=-0.5,s3[14,8]=-0.9,s3[14,9]=0.3,s3[14,10]=-0.3,s3[14,11]=-0.3,s3[14,12]=-0.3,s3[14,13]=-0.2,s3[14,14]=0.8 s3[14,15]=0.4,s3[14,16]=0.3,s3[14,17]=1.1,s3[14,18]=-0.6,s3[14,19]=-0.2,s3[14,20]=0.1,s3[14,21]=1.2,s3[14,22]=0.2,s3[14,23]=0.2,s3[14,24]=-1.1,s3[14,25]=0.9,s3[14,26]=0.3,s3[14,27]=0.9,s3[14,28]=-1.1,s3[14,29]=1.2,s3[14,30]=-0.7 s3[15,1]=-0.5,s3[15,2]=-0.5,s3[15,3]=0.9,s3[15,4]=0.3,s3[15,5]=-0.3,s3[15,6]=-0.7,s3[15,7]=0.9,s3[15,8]=-0.9,s3[15,9]=-0.2,s3[15,10]=0.1,s3[15,11]=0.0,s3[15,12]=0.7,s3[15,13]=0.5,s3[15,14]=0.9 s3[15,15]=0.4,s3[15,16]=0.2,s3[15,17]=0.9,s3[15,18]=0.1,s3[15,19]=-0.3,s3[15,20]=1.2,s3[15,21]=0.7,s3[15,22]=-0.3,s3[15,23]=-1.2,s3[15,24]=-0.2,s3[15,25]=0.7,s3[15,26]=-1.1,s3[15,27]=-0.5,s3[15,28]=1.2,s3[15,29]=0.4,s3[15,30]=-1.0 s3[16,1]=-1.0,s3[16,2]=-0.2,s3[16,3]=-0.2,s3[16,4]=-0.3,s3[16,5]=-0.5,s3[16,6]=-1.1,s3[16,7]=0.0,s3[16,8]=1.0,s3[16,9]=0.6,s3[16,10]=0.9,s3[16,11]=-0.3,s3[16,12]=0.9,s3[16,13]=1.1,s3[16,14]=-1.1 s3[16,15]=0.2,s3[16,16]=0.3,s3[16,17]=0.5,s3[16,18]=0.2,s3[16,19]=-0.2,s3[16,20]=0.3,s3[16,21]=0.5,s3[16,22]=-0.6,s3[16,23]=-1.2,s3[16,24]=1.1,s3[16,25]=0.4,s3[16,26]=0.3,s3[16,27]=-0.5,s3[16,28]=0.2,s3[16,29]=-0.3,s3[16,30]=-0.7 s3[17,1]=0.1,s3[17,2]=0.4,s3[17,3]=0.0,s3[17,4]=-0.6,s3[17,5]=1.0,s3[17,6]=0.8,s3[17,7]=1.0,s3[17,8]=-0.2,s3[17,9]=-0.9,s3[17,10]=-0.2,s3[17,11]=-0.6,s3[17,12]=-1.1,s3[17,13]=0.7,s3[17,14]=-0.7 s3[17,15]=0.0,s3[17,16]=-0.8,s3[17,17]=0.3,s3[17,18]=0.6,s3[17,19]=-0.1,s3[17,20]=1.2,s3[17,21]=0.2,s3[17,22]=-0.8,s3[17,23]=-1.2,s3[17,24]=0.4,s3[17,25]=0.9,s3[17,26]=0.0,s3[17,27]=-0.4,s3[17,28]=-0.7,s3[17,29]=-0.3,s3[17,30]=-0.2 s3[18,1]=-0.6,s3[18,2]=1.2,s3[18,3]=1.2,s3[18,4]=1.0,s3[18,5]=0.2,s3[18,6]=0.5,s3[18,7]=0.5,s3[18,8]=0.6,s3[18,9]=0.5,s3[18,10]=0.9,s3[18,11]=-0.7,s3[18,12]=1.1,s3[18,13]=1.2,s3[18,14]=0.3 s3[18,15]=0.2,s3[18,16]=-0.2,s3[18,17]=0.6,s3[18,18]=1.1,s3[18,19]=0.0,s3[18,20]=-0.4,s3[18,21]=0.5,s3[18,22]=0.7,s3[18,23]=-0.5,s3[18,24]=0.9,s3[18,25]=1.0,s3[18,26]=0.2,s3[18,27]=-0.6,s3[18,28]=0.2,s3[18,29]=0.0,s3[18,30]=0.2 s3[19,1]=0.6,s3[19,2]=0.7,s3[19,3]=-1.0,s3[19,4]=-1.1,s3[19,5]=1.0,s3[19,6]=0.7,s3[19,7]=0.1,s3[19,8]=-0.2,s3[19,9]=-0.8,s3[19,10]=-0.4,s3[19,11]=-0.1,s3[19,12]=-0.4,s3[19,13]=0.9,s3[19,14]=-0.8 s3[19,15]=-0.1,s3[19,16]=-0.6,s3[19,17]=-0.7,s3[19,18]=-0.1,s3[19,19]=-0.1,s3[19,20]=-0.1,s3[19,21]=-0.1,s3[19,22]=0.9,s3[19,23]=-0.3,s3[19,24]=0.3,s3[19,25]=-0.1,s3[19,26]=-0.9,s3[19,27]=0.3,s3[19,28]=0.3,s3[19,29]=-0.8,s3[19,30]=-0.5 s3[20,1]=0.4,s3[20,2]=0.7,s3[20,3]=-1.2,s3[20,4]=0.6,s3[20,5]=1.0,s3[20,6]=0.2,s3[20,7]=-0.3,s3[20,8]=0.1,s3[20,9]=0.7,s3[20,10]=-1.0,s3[20,11]=0.4,s3[20,12]=0.7,s3[20,13]=1.2,s3[20,14]=-1.1 s3[20,15]=0.8,s3[20,16]=0.8,s3[20,17]=-1.0,s3[20,18]=-1.2,s3[20,19]=1.0,s3[20,20]=-1.1,s3[20,21]=0.0,s3[20,22]=-0.9,s3[20,23]=-1.2,s3[20,24]=1.0,s3[20,25]=-0.1,s3[20,26]=0.0,s3[20,27]=-0.2,s3[20,28]=-1.1,s3[20,29]=-0.7,s3[20,30]=-0.3 s3[21,1]=0.3,s3[21,2]=1.1,s3[21,3]=-0.9,s3[21,4]=-1.2,s3[21,5]=0.2,s3[21,6]=-0.1,s3[21,7]=-1.2,s3[21,8]=1.1,s3[21,9]=0.3,s3[21,10]=0.2,s3[21,11]=-0.8,s3[21,12]=0.3,s3[21,13]=1.2,s3[21,14]=-1.2 s3[21,15]=1.1,s3[21,16]=-0.1,s3[21,17]=0.9,s3[21,18]=-0.7,s3[21,19]=0.2,s3[21,20]=0.8,s3[21,21]=-0.7,s3[21,22]=-0.3,s3[21,23]=0.5,s3[21,24]=-0.1,s3[21,25]=-0.1,s3[21,26]=0.3,s3[21,27]=0.0,s3[21,28]=-1.1,s3[21,29]=-0.4,s3[21,30]=0.4 s3[22,1]=0.5,s3[22,2]=-0.7,s3[22,3]=-1.1,s3[22,4]=0.1,s3[22,5]=-0.5,s3[22,6]=0.3,s3[22,7]=-0.2,s3[22,8]=-0.9,s3[22,9]=-0.7,s3[22,10]=-0.1,s3[22,11]=-0.6,s3[22,12]=-1.0,s3[22,13]=-0.9,s3[22,14]=0.1 s3[22,15]=-0.7,s3[22,16]=-0.7,s3[22,17]=-0.6,s3[22,18]=-1.1,s3[22,19]=-1.1,s3[22,20]=0.2,s3[22,21]=-0.6,s3[22,22]=-0.2,s3[22,23]=-0.9,s3[22,24]=-0.2,s3[22,25]=-0.6,s3[22,26]=-0.6,s3[22,27]=0.0,s3[22,28]=0.6,s3[22,29]=-0.9,s3[22,30]=-1.1 s3[23,1]=0.8,s3[23,2]=-0.7,s3[23,3]=-0.9,s3[23,4]=-1.0,s3[23,5]=-0.3,s3[23,6]=0.9,s3[23,7]=0.5,s3[23,8]=-0.1,s3[23,9]=0.7,s3[23,10]=-1.0,s3[23,11]=0.5,s3[23,12]=-1.0,s3[23,13]=0.3,s3[23,14]=1.1 s3[23,15]=-0.2,s3[23,16]=-0.4,s3[23,17]=-0.2,s3[23,18]=1.0,s3[23,19]=0.4,s3[23,20]=-0.7,s3[23,21]=0.5,s3[23,22]=-1.2,s3[23,23]=-0.5,s3[23,24]=0.8,s3[23,25]=0.2,s3[23,26]=-0.8,s3[23,27]=0.0,s3[23,28]=1.1,s3[23,29]=-0.2,s3[23,30]=0.5 s3[24,1]=-1.0,s3[24,2]=-0.2,s3[24,3]=1.1,s3[24,4]=0.3,s3[24,5]=-0.4,s3[24,6]=-0.2,s3[24,7]=0.6,s3[24,8]=-0.1,s3[24,9]=0.5,s3[24,10]=-0.7,s3[24,11]=0.7,s3[24,12]=-0.4,s3[24,13]=0.7,s3[24,14]=0.2 s3[24,15]=-0.2,s3[24,16]=0.2,s3[24,17]=-1.2,s3[24,18]=0.0,s3[24,19]=0.0,s3[24,20]=-1.2,s3[24,21]=-0.5,s3[24,22]=-0.4,s3[24,23]=0.5,s3[24,24]=0.2,s3[24,25]=-0.5,s3[24,26]=-0.1,s3[24,27]=0.6,s3[24,28]=-0.4,s3[24,29]=0.1,s3[24,30]=1.0 s3[25,1]=-0.1,s3[25,2]=1.2,s3[25,3]=0.8,s3[25,4]=0.9,s3[25,5]=0.4,s3[25,6]=0.0,s3[25,7]=0.2,s3[25,8]=0.1,s3[25,9]=0.9,s3[25,10]=-1.1,s3[25,11]=-0.4,s3[25,12]=-0.4,s3[25,13]=0.5,s3[25,14]=-0.2 s3[25,15]=-0.8,s3[25,16]=-0.1,s3[25,17]=0.0,s3[25,18]=-0.6,s3[25,19]=0.9,s3[25,20]=0.9,s3[25,21]=-0.3,s3[25,22]=0.2,s3[25,23]=-0.3,s3[25,24]=1.1,s3[25,25]=1.0,s3[25,26]=0.0,s3[25,27]=0.8,s3[25,28]=-0.4,s3[25,29]=-0.4,s3[25,30]=-0.5 s3[26,1]=0.6,s3[26,2]=-1.0,s3[26,3]=-0.7,s3[26,4]=-1.0,s3[26,5]=-0.1,s3[26,6]=0.2,s3[26,7]=0.7,s3[26,8]=-1.2,s3[26,9]=0.5,s3[26,10]=0.2,s3[26,11]=0.3,s3[26,12]=-0.7,s3[26,13]=0.1,s3[26,14]=0.0 s3[26,15]=-0.9,s3[26,16]=-0.1,s3[26,17]=0.4,s3[26,18]=0.2,s3[26,19]=1.2,s3[26,20]=0.9,s3[26,21]=-0.7,s3[26,22]=-0.9,s3[26,23]=1.1,s3[26,24]=-0.7,s3[26,25]=-0.5,s3[26,26]=0.9,s3[26,27]=0.9,s3[26,28]=0.8,s3[26,29]=1.0,s3[26,30]=0.7 s3[27,1]=-0.3,s3[27,2]=-0.4,s3[27,3]=0.9,s3[27,4]=-1.2,s3[27,5]=-1.1,s3[27,6]=0.2,s3[27,7]=0.9,s3[27,8]=0.7,s3[27,9]=-0.8,s3[27,10]=0.6,s3[27,11]=-0.3,s3[27,12]=-0.7,s3[27,13]=0.9,s3[27,14]=-0.3 s3[27,15]=0.1,s3[27,16]=-0.6,s3[27,17]=-1.1,s3[27,18]=0.0,s3[27,19]=-0.2,s3[27,20]=-0.1,s3[27,21]=1.0,s3[27,22]=-0.4,s3[27,23]=-0.7,s3[27,24]=-0.3,s3[27,25]=-0.2,s3[27,26]=1.2,s3[27,27]=1.1,s3[27,28]=0.5,s3[27,29]=-0.8,s3[27,30]=1.0 s3[28,1]=-0.5,s3[28,2]=0.4,s3[28,3]=-0.5,s3[28,4]=-1.0,s3[28,5]=-0.1,s3[28,6]=0.2,s3[28,7]=1.2,s3[28,8]=-1.1,s3[28,9]=0.4,s3[28,10]=1.0,s3[28,11]=-0.3,s3[28,12]=-0.6,s3[28,13]=0.2,s3[28,14]=0.7 s3[28,15]=-0.8,s3[28,16]=1.2,s3[28,17]=-0.6,s3[28,18]=-0.7,s3[28,19]=0.1,s3[28,20]=1.1,s3[28,21]=0.3,s3[28,22]=0.6,s3[28,23]=0.7,s3[28,24]=1.2,s3[28,25]=-0.4,s3[28,26]=0.3,s3[28,27]=-0.6,s3[28,28]=-0.1,s3[28,29]=-0.7,s3[28,30]=0.7 s3[29,1]=0.4,s3[29,2]=0.1,s3[29,3]=-0.4,s3[29,4]=0.4,s3[29,5]=1.1,s3[29,6]=-0.1,s3[29,7]=0.3,s3[29,8]=-1.1,s3[29,9]=0.1,s3[29,10]=-0.8,s3[29,11]=-0.5,s3[29,12]=-0.4,s3[29,13]=0.4,s3[29,14]=-0.6 s3[29,15]=-0.1,s3[29,16]=0.3,s3[29,17]=0.3,s3[29,18]=1.2,s3[29,19]=-0.4,s3[29,20]=-1.0,s3[29,21]=-0.8,s3[29,22]=-1.2,s3[29,23]=0.7,s3[29,24]=0.7,s3[29,25]=-1.1,s3[29,26]=-1.0,s3[29,27]=0.4,s3[29,28]=-1.0,s3[29,29]=0.8,s3[29,30]=0.0 s3[30,1]=-0.6,s3[30,2]=-0.5,s3[30,3]=-1.0,s3[30,4]=0.7,s3[30,5]=-0.9,s3[30,6]=-1.0,s3[30,7]=1.1,s3[30,8]=1.0,s3[30,9]=-0.9,s3[30,10]=0.8,s3[30,11]=0.4,s3[30,12]=0.0,s3[30,13]=-0.4,s3[30,14]=-0.7 s3[30,15]=-0.6,s3[30,16]=-1.2,s3[30,17]=0.8,s3[30,18]=-1.2,s3[30,19]=-0.3,s3[30,20]=-0.7,s3[30,21]=0.0,s3[30,22]=-0.9,s3[30,23]=-0.2,s3[30,24]=-0.2,s3[30,25]=-0.8,s3[30,26]=0.7,s3[30,27]=0.2,s3[30,28]=1.1,s3[30,29]=-0.2,s3[30,30]=-0.4 s3[31,1]=-0.1,s3[31,2]=-0.3,s3[31,3]=-0.2,s3[31,4]=-1.2,s3[31,5]=-0.2,s3[31,6]=-0.4,s3[31,7]=0.7,s3[31,8]=0.1,s3[31,9]=0.2,s3[31,10]=0.0,s3[31,11]=0.5,s3[31,12]=0.6,s3[31,13]=-0.1,s3[31,14]=1.0 s3[31,15]=1.1,s3[31,16]=-0.5,s3[31,17]=0.1,s3[31,18]=0.0,s3[31,19]=-0.1,s3[31,20]=0.1,s3[31,21]=1.0,s3[31,22]=0.4,s3[31,23]=-0.8,s3[31,24]=0.5,s3[31,25]=-0.1,s3[31,26]=0.0,s3[31,27]=-0.6,s3[31,28]=-0.6,s3[31,29]=-1.1,s3[31,30]=0.9 s3[32,1]=0.0,s3[32,2]=0.3,s3[32,3]=-0.2,s3[32,4]=-1.0,s3[32,5]=0.0,s3[32,6]=-0.7,s3[32,7]=1.1,s3[32,8]=0.4,s3[32,9]=0.2,s3[32,10]=0.1,s3[32,11]=0.1,s3[32,12]=0.7,s3[32,13]=-0.3,s3[32,14]=1.0 s3[32,15]=-1.0,s3[32,16]=-0.7,s3[32,17]=-0.6,s3[32,18]=-0.5,s3[32,19]=0.4,s3[32,20]=-0.4,s3[32,21]=0.2,s3[32,22]=-0.8,s3[32,23]=-0.3,s3[32,24]=-0.1,s3[32,25]=0.8,s3[32,26]=0.4,s3[32,27]=0.3,s3[32,28]=0.0,s3[32,29]=-1.2,s3[32,30]=0.4 s3[33,1]=0.9,s3[33,2]=-1.2,s3[33,3]=-0.2,s3[33,4]=-0.6,s3[33,5]=-0.7,s3[33,6]=0.5,s3[33,7]=0.9,s3[33,8]=-0.4,s3[33,9]=-0.4,s3[33,10]=-0.2,s3[33,11]=0.2,s3[33,12]=0.3,s3[33,13]=-0.5,s3[33,14]=0.7 s3[33,15]=0.3,s3[33,16]=-1.0,s3[33,17]=0.5,s3[33,18]=0.3,s3[33,19]=-0.3,s3[33,20]=0.2,s3[33,21]=-1.2,s3[33,22]=0.1,s3[33,23]=-1.0,s3[33,24]=1.0,s3[33,25]=-0.7,s3[33,26]=-1.2,s3[33,27]=1.1,s3[33,28]=-0.1,s3[33,29]=1.0,s3[33,30]=0.8 s3[34,1]=0.2,s3[34,2]=-0.8,s3[34,3]=-0.9,s3[34,4]=-0.5,s3[34,5]=-0.9,s3[34,6]=-0.7,s3[34,7]=-0.8,s3[34,8]=-0.6,s3[34,9]=0.9,s3[34,10]=-0.5,s3[34,11]=0.0,s3[34,12]=0.2,s3[34,13]=0.2,s3[34,14]=0.1 s3[34,15]=0.2,s3[34,16]=-0.6,s3[34,17]=0.9,s3[34,18]=-1.2,s3[34,19]=0.1,s3[34,20]=0.9,s3[34,21]=-0.2,s3[34,22]=0.4,s3[34,23]=0.1,s3[34,24]=-0.8,s3[34,25]=0.9,s3[34,26]=0.7,s3[34,27]=0.7,s3[34,28]=0.7,s3[34,29]=0.8,s3[34,30]=-0.3 s3[35,1]=-0.4,s3[35,2]=0.1,s3[35,3]=0.5,s3[35,4]=0.5,s3[35,5]=-0.3,s3[35,6]=1.1,s3[35,7]=1.1,s3[35,8]=1.0,s3[35,9]=-1.0,s3[35,10]=0.3,s3[35,11]=-0.2,s3[35,12]=0.3,s3[35,13]=-0.8,s3[35,14]=0.9 s3[35,15]=-0.6,s3[35,16]=-1.2,s3[35,17]=0.6,s3[35,18]=-0.6,s3[35,19]=0.1,s3[35,20]=0.3,s3[35,21]=-0.3,s3[35,22]=-0.1,s3[35,23]=0.1,s3[35,24]=0.3,s3[35,25]=-0.1,s3[35,26]=0.6,s3[35,27]=-0.5,s3[35,28]=1.0,s3[35,29]=-0.2,s3[35,30]=-0.6 s3[36,1]=0.3,s3[36,2]=-0.6,s3[36,3]=0.3,s3[36,4]=-1.0,s3[36,5]=0.4,s3[36,6]=-0.2,s3[36,7]=0.8,s3[36,8]=0.8,s3[36,9]=-0.9,s3[36,10]=0.1,s3[36,11]=0.8,s3[36,12]=-0.4,s3[36,13]=-1.0,s3[36,14]=0.6 s3[36,15]=0.8,s3[36,16]=0.6,s3[36,17]=-0.1,s3[36,18]=-0.3,s3[36,19]=0.3,s3[36,20]=-1.0,s3[36,21]=0.6,s3[36,22]=-1.2,s3[36,23]=0.8,s3[36,24]=0.6,s3[36,25]=0.3,s3[36,26]=-0.4,s3[36,27]=0.3,s3[36,28]=-0.3,s3[36,29]=-0.4,s3[36,30]=-0.5 s3[37,1]=0.5,s3[37,2]=-1.2,s3[37,3]=1.0,s3[37,4]=0.8,s3[37,5]=-0.5,s3[37,6]=0.1,s3[37,7]=-0.5,s3[37,8]=0.2,s3[37,9]=-1.1,s3[37,10]=-0.1,s3[37,11]=0.0,s3[37,12]=-0.5,s3[37,13]=-0.6,s3[37,14]=-0.2 s3[37,15]=-0.3,s3[37,16]=0.8,s3[37,17]=0.2,s3[37,18]=-0.4,s3[37,19]=-0.5,s3[37,20]=-0.1,s3[37,21]=0.5,s3[37,22]=0.2,s3[37,23]=-0.3,s3[37,24]=-0.8,s3[37,25]=0.3,s3[37,26]=-0.1,s3[37,27]=-0.4,s3[37,28]=0.2,s3[37,29]=0.7,s3[37,30]=-0.2 s3[38,1]=0.7,s3[38,2]=-1.0,s3[38,3]=0.1,s3[38,4]=-0.3,s3[38,5]=0.9,s3[38,6]=0.3,s3[38,7]=-1.1,s3[38,8]=0.7,s3[38,9]=-0.7,s3[38,10]=0.5,s3[38,11]=0.4,s3[38,12]=-0.7,s3[38,13]=-1.0,s3[38,14]=0.3 s3[38,15]=1.2,s3[38,16]=-0.4,s3[38,17]=1.2,s3[38,18]=0.4,s3[38,19]=-0.3,s3[38,20]=0.4,s3[38,21]=0.2,s3[38,22]=-0.8,s3[38,23]=1.1,s3[38,24]=0.7,s3[38,25]=-0.5,s3[38,26]=-0.2,s3[38,27]=0.6,s3[38,28]=0.6,s3[38,29]=-1.1,s3[38,30]=0.5 s3[39,1]=-0.2,s3[39,2]=-1.0,s3[39,3]=0.1,s3[39,4]=0.4,s3[39,5]=-0.5,s3[39,6]=-1.2,s3[39,7]=-0.9,s3[39,8]=-0.1,s3[39,9]=-1.1,s3[39,10]=-0.4,s3[39,11]=0.0,s3[39,12]=0.4,s3[39,13]=0.9,s3[39,14]=-0.1 s3[39,15]=0.7,s3[39,16]=-0.2,s3[39,17]=0.7,s3[39,18]=0.4,s3[39,19]=-0.3,s3[39,20]=-1.0,s3[39,21]=0.1,s3[39,22]=-0.2,s3[39,23]=-0.7,s3[39,24]=-0.3,s3[39,25]=-0.3,s3[39,26]=-0.7,s3[39,27]=0.4,s3[39,28]=0.5,s3[39,29]=-0.8,s3[39,30]=0.7 s3[40,1]=0.4,s3[40,2]=0.9,s3[40,3]=-0.3,s3[40,4]=-0.3,s3[40,5]=0.3,s3[40,6]=0.9,s3[40,7]=-0.6,s3[40,8]=0.6,s3[40,9]=0.3,s3[40,10]=-0.9,s3[40,11]=0.3,s3[40,12]=0.0,s3[40,13]=-0.5,s3[40,14]=0.9 s3[40,15]=0.0,s3[40,16]=1.2,s3[40,17]=-1.1,s3[40,18]=0.9,s3[40,19]=-0.4,s3[40,20]=-0.1,s3[40,21]=1.2,s3[40,22]=-0.8,s3[40,23]=-0.4,s3[40,24]=0.6,s3[40,25]=0.7,s3[40,26]=0.0,s3[40,27]=-1.0,s3[40,28]=0.3,s3[40,29]=-0.9,s3[40,30]=0.0 s3[41,1]=-0.7,s3[41,2]=0.3,s3[41,3]=0.4,s3[41,4]=-1.2,s3[41,5]=0.5,s3[41,6]=0.3,s3[41,7]=-0.6,s3[41,8]=0.4,s3[41,9]=0.3,s3[41,10]=0.6,s3[41,11]=1.2,s3[41,12]=0.5,s3[41,13]=-0.5,s3[41,14]=0.6 s3[41,15]=-0.1,s3[41,16]=0.6,s3[41,17]=-0.9,s3[41,18]=-0.6,s3[41,19]=0.3,s3[41,20]=-0.1,s3[41,21]=-0.9,s3[41,22]=-0.3,s3[41,23]=0.0,s3[41,24]=0.1,s3[41,25]=-0.1,s3[41,26]=0.6,s3[41,27]=-0.4,s3[41,28]=-0.5,s3[41,29]=-0.7,s3[41,30]=-0.7 s3[42,1]=-0.3,s3[42,2]=-0.6,s3[42,3]=-0.5,s3[42,4]=-0.1,s3[42,5]=1.0,s3[42,6]=-0.6,s3[42,7]=-0.5,s3[42,8]=0.3,s3[42,9]=0.6,s3[42,10]=-0.2,s3[42,11]=0.3,s3[42,12]=1.0,s3[42,13]=-0.7,s3[42,14]=0.6 s3[42,15]=1.0,s3[42,16]=0.4,s3[42,17]=-0.7,s3[42,18]=1.1,s3[42,19]=0.4,s3[42,20]=0.2,s3[42,21]=0.1,s3[42,22]=-0.1,s3[42,23]=0.5,s3[42,24]=-0.5,s3[42,25]=0.1,s3[42,26]=-0.7,s3[42,27]=0.4,s3[42,28]=-0.4,s3[42,29]=-0.9,s3[42,30]=0.3 s3[43,1]=0.1,s3[43,2]=-0.6,s3[43,3]=0.5,s3[43,4]=-0.4,s3[43,5]=0.6,s3[43,6]=0.3,s3[43,7]=-0.3,s3[43,8]=0.8,s3[43,9]=-1.2,s3[43,10]=-1.1,s3[43,11]=0.3,s3[43,12]=0.6,s3[43,13]=-0.6,s3[43,14]=0.0 s3[43,15]=0.1,s3[43,16]=-0.8,s3[43,17]=-0.9,s3[43,18]=-0.6,s3[43,19]=0.3,s3[43,20]=-0.6,s3[43,21]=-0.6,s3[43,22]=0.9,s3[43,23]=-0.5,s3[43,24]=1.1,s3[43,25]=-0.2,s3[43,26]=0.0,s3[43,27]=0.7,s3[43,28]=-1.2,s3[43,29]=-1.1,s3[43,30]=-0.4 s3[44,1]=1.1,s3[44,2]=0.1,s3[44,3]=-0.3,s3[44,4]=0.2,s3[44,5]=-0.6,s3[44,6]=0.1,s3[44,7]=0.0,s3[44,8]=0.0,s3[44,9]=-1.1,s3[44,10]=-1.0,s3[44,11]=0.9,s3[44,12]=0.0,s3[44,13]=-0.3,s3[44,14]=0.9 s3[44,15]=-0.2,s3[44,16]=0.1,s3[44,17]=-0.7,s3[44,18]=0.7,s3[44,19]=-0.5,s3[44,20]=0.2,s3[44,21]=0.2,s3[44,22]=-0.6,s3[44,23]=-0.5,s3[44,24]=0.9,s3[44,25]=-0.2,s3[44,26]=0.9,s3[44,27]=-0.7,s3[44,28]=-0.8,s3[44,29]=0.5,s3[44,30]=-0.8 s3[45,1]=-0.2,s3[45,2]=-0.5,s3[45,3]=0.9,s3[45,4]=-0.2,s3[45,5]=-0.7,s3[45,6]=-0.6,s3[45,7]=-0.9,s3[45,8]=0.0,s3[45,9]=-0.5,s3[45,10]=-0.2,s3[45,11]=-0.1,s3[45,12]=-0.8,s3[45,13]=-0.2,s3[45,14]=0.4 s3[45,15]=0.3,s3[45,16]=-0.3,s3[45,17]=1.1,s3[45,18]=0.3,s3[45,19]=-0.1,s3[45,20]=-0.2,s3[45,21]=-0.3,s3[45,22]=0.6,s3[45,23]=0.2,s3[45,24]=0.6,s3[45,25]=0.0,s3[45,26]=-0.6,s3[45,27]=-1.0,s3[45,28]=0.6,s3[45,29]=0.9,s3[45,30]=0.0 s3[46,1]=0.1,s3[46,2]=-0.6,s3[46,3]=0.3,s3[46,4]=-0.1,s3[46,5]=0.0,s3[46,6]=0.3,s3[46,7]=1.2,s3[46,8]=0.0,s3[46,9]=-0.1,s3[46,10]=1.2,s3[46,11]=-1.2,s3[46,12]=1.0,s3[46,13]=-0.4,s3[46,14]=-0.1 s3[46,15]=1.1,s3[46,16]=-0.1,s3[46,17]=0.6,s3[46,18]=-1.1,s3[46,19]=-0.6,s3[46,20]=1.1,s3[46,21]=0.3,s3[46,22]=0.7,s3[46,23]=-0.7,s3[46,24]=1.2,s3[46,25]=1.1,s3[46,26]=-0.5,s3[46,27]=-0.1,s3[46,28]=0.1,s3[46,29]=-1.0,s3[46,30]=-0.4 s3[47,1]=-0.6,s3[47,2]=-1.2,s3[47,3]=-1.0,s3[47,4]=-0.4,s3[47,5]=0.9,s3[47,6]=-0.2,s3[47,7]=-0.7,s3[47,8]=-0.2,s3[47,9]=0.6,s3[47,10]=0.0,s3[47,11]=0.3,s3[47,12]=0.4,s3[47,13]=0.0,s3[47,14]=-0.9 s3[47,15]=-0.1,s3[47,16]=0.3,s3[47,17]=0.0,s3[47,18]=-0.4,s3[47,19]=-0.1,s3[47,20]=-0.3,s3[47,21]=-0.4,s3[47,22]=-0.6,s3[47,23]=-1.1,s3[47,24]=-0.5,s3[47,25]=-1.1,s3[47,26]=1.2,s3[47,27]=0.0,s3[47,28]=0.1,s3[47,29]=0.7,s3[47,30]=0.4 s3[48,1]=-0.4,s3[48,2]=-0.9,s3[48,3]=-1.0,s3[48,4]=-0.4,s3[48,5]=0.0,s3[48,6]=-0.1,s3[48,7]=-0.8,s3[48,8]=-0.9,s3[48,9]=0.3,s3[48,10]=0.0,s3[48,11]=0.8,s3[48,12]=-0.3,s3[48,13]=-0.7,s3[48,14]=0.4 s3[48,15]=-0.9,s3[48,16]=-0.9,s3[48,17]=0.2,s3[48,18]=-0.6,s3[48,19]=1.2,s3[48,20]=0.7,s3[48,21]=0.1,s3[48,22]=0.6,s3[48,23]=0.0,s3[48,24]=-0.1,s3[48,25]=0.3,s3[48,26]=-0.5,s3[48,27]=-0.7,s3[48,28]=0.7,s3[48,29]=-0.7,s3[48,30]=-1.1 s3[49,1]=-0.9,s3[49,2]=-1.1,s3[49,3]=0.0,s3[49,4]=0.2,s3[49,5]=-0.9,s3[49,6]=-1.0,s3[49,7]=0.8,s3[49,8]=-0.3,s3[49,9]=-1.0,s3[49,10]=-1.0,s3[49,11]=-0.9,s3[49,12]=0.3,s3[49,13]=0.0,s3[49,14]=-0.4 s3[49,15]=-0.1,s3[49,16]=0.0,s3[49,17]=0.2,s3[49,18]=-0.4,s3[49,19]=0.1,s3[49,20]=0.5,s3[49,21]=1.1,s3[49,22]=1.0,s3[49,23]=-0.4,s3[49,24]=0.4,s3[49,25]=-0.5,s3[49,26]=0.9,s3[49,27]=0.0,s3[49,28]=0.4,s3[49,29]=0.9,s3[49,30]=-0.4 s3[50,1]=0.2,s3[50,2]=0.7,s3[50,3]=-0.2,s3[50,4]=-1.0,s3[50,5]=0.3,s3[50,6]=0.7,s3[50,7]=-0.3,s3[50,8]=0.5,s3[50,9]=0.7,s3[50,10]=-0.7,s3[50,11]=-0.1,s3[50,12]=0.1,s3[50,13]=0.5,s3[50,14]=0.6 s3[50,15]=-0.2,s3[50,16]=-0.4,s3[50,17]=-1.2,s3[50,18]=1.1,s3[50,19]=-0.3,s3[50,20]=0.9,s3[50,21]=-0.1,s3[50,22]=0.2,s3[50,23]=-0.7,s3[50,24]=0.3,s3[50,25]=-0.8,s3[50,26]=-0.5,s3[50,27]=0.5,s3[50,28]=1.2,s3[50,29]=-1.0,s3[50,30]=0.9 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float ppz = @ppz float pxx = 0 float pyy = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x pyy = y x = s3[@sd,1] + s3[@sd,2]*x + s3[@sd,3]*x*x + s3[@sd,4]*x*y \ + s3[@sd,5]*x*ppz + s3[@sd,6]*y + s3[@sd,7]*y*y + \ s3[@sd,8]*y*ppz + s3[@sd,9]*ppz + s3[@sd,10]*ppz*ppz y = s3[@sd,11] + s3[@sd,12]*pxx + s3[@sd,13]*pxx*pxx + s3[@sd,14]*pxx*y \ + s3[@sd,15]*pxx*ppz + s3[@sd,16]*y + s3[@sd,17]*y*y + \ s3[@sd,18]*y*ppz + s3[@sd,19]*ppz + s3[@sd,20]*ppz*ppz ppz = s3[@sd,21] + s3[@sd,22]*pxx + s3[@sd,23]*pxx*pxx + s3[@sd,24]*pxx*pyy + \ s3[@sd,25]*pxx*ppz + s3[@sd,26]*pyy + s3[@sd,27]*pyy*pyy + \ s3[@sd,28]*pyy*ppz + s3[@sd,29]*ppz + s3[@sd,30]*ppz*ppz att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y) + ppz*@pw) float d = @distscale*|pz-m_LastZ| return d endfunc private: float s3[51,31] default: title = "Sprott3D" heading text="Sprott 3D quadratic attractors" endheading heading text=" x -> Quadratic in x, y and z" endheading heading text=" y -> Quadratic in x, y and z" endheading heading text=" z -> Quadratic in x, y and z" endheading int param v_trapshapesprott3d caption = "Version (Trap Shape Sprott3D)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesprott3d < 101 endparam param sd caption = "Sprott selector" default = 0 enum = "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" \ "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" \ "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" \ "45" "46" "47" "48" "49" "50" hint = "Each Sprott selector uses a different strange attractor." endparam heading text = "'Initialize Height' sets the starting z value for the attractor." endheading float param ppz caption = "Initialize Height" default = 0.5 endparam heading text = "'Height weight' determines the weight of the final z value which is added \ to the trap distance." endheading complex param pw caption = "Height weight" default = (0.5,0) endparam float param distscale caption = "Distance scale" default = 2 endparam float param s caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 15 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeSprott3D_Cubic(common.ulb:TrapShape) { ; This shape uses a Sprott strange attractor.
;

; The Sprott attractors were developed by Julien C. Sprott, and are ; based upon polynomials and linear differential equations of polynomials. public: import "common.ulb" ; Constructor func REB_TrapShapeSprott3D_Cubic(Generic pparent) TrapShape.TrapShape(pparent) s[0,1]=0.3,s[0,2]=-0.4,s[0,3]=1.0,s[0,4]=0.3,s[0,5]=0.5,s[0,6]=0.4,s[0,7]=0.7,s[0,8]=0.5,s[0,9]=0.9,s[0,10]=1.0,s[0,11]=1.2,s[0,12]=-0.4,s[0,13]=0.4,s[0,14]=-0.3,s[0,15]=-0.1,s[0,16]=-0.6,s[0,17]=-0.1,s[0,18]=1.1,s[0,19]=1.0,s[0,20]=0.6,s[0,21]=0.2,s[0,22]=0.6,s[0,23]=-1.1,s[0,24]=-1.0,s[0,25]=0.2,s[0,26]=0.4,s[0,27]=0.4,s[0,28]=0.2,s[0,29]=0.6,s[0,30]=-1.1 s[0,31]=0.6,s[0,32]=-0.4,s[0,33]=-1.1,s[0,34]=-0.1,s[0,35]=0.6,s[0,36]=-0.2,s[0,37]=-0.8,s[0,38]=-0.6,s[0,39]=0.6,s[0,40]=1.2,s[0,41]=-0.5,s[0,42]=0.3,s[0,43]=1.1,s[0,44]=-0.1,s[0,45]=0.9,s[0,46]=-1.0,s[0,47]=-0.6,s[0,48]=-0.3,s[0,49]=0.5,s[0,50]=0.4,s[0,51]=-0.8,s[0,52]=0.5,s[0,53]=-0.8,s[0,54]=-1.0,s[0,55]=0.1,s[0,56]=-0.9,s[0,57]=-1.1,s[0,58]=-0.7,s[0,59]=-0.1,s[0,60]=-0.6 s[1,1]=-0.1,s[1,2]=-0.6,s[1,3]=0.4,s[1,4]=-0.6,s[1,5]=-0.7,s[1,6]=0.3,s[1,7]=-0.7,s[1,8]=0.6,s[1,9]=-0.6,s[1,10]=-0.6,s[1,11]=0.8,s[1,12]=-0.6,s[1,13]=-0.8,s[1,14]=1.2,s[1,15]=0.4,s[1,16]=0.7,s[1,17]=0.1,s[1,18]=-0.7,s[1,19]=-0.5,s[1,20]=0.4,s[1,21]=-0.2,s[1,22]=1.0,s[1,23]=0.9,s[1,24]=0.8,s[1,25]=-1.1,s[1,26]=-0.3,s[1,27]=0.4,s[1,28]=-0.1,s[1,29]=1.1,s[1,30]=-0.2 s[1,31]=0.8,s[1,32]=0.6,s[1,33]=-0.3,s[1,34]=-0.3,s[1,35]=-1.0,s[1,36]=-0.2,s[1,37]=0.0,s[1,38]=0.3,s[1,39]=0.3,s[1,40]=0.1,s[1,41]=0.3,s[1,42]=0.9,s[1,43]=0.2,s[1,44]=0.0,s[1,45]=1.1,s[1,46]=1.0,s[1,47]=0.6,s[1,48]=-0.5,s[1,49]=-0.2,s[1,50]=0.8,s[1,51]=0.9,s[1,52]=-1.0,s[1,53]=-0.7,s[1,54]=1.1,s[1,55]=0.9,s[1,56]=-0.2,s[1,57]=-0.3,s[1,58]=0.5,s[1,59]=-0.9,s[1,60]=0.4 s[2,1]=0.7,s[2,2]=-0.3,s[2,3]=-0.3,s[2,4]=0.4,s[2,5]=0.1,s[2,6]=-0.8,s[2,7]=0.9,s[2,8]=-1.0,s[2,9]=1.1,s[2,10]=-0.1,s[2,11]=-0.4,s[2,12]=0.3,s[2,13]=-1.0,s[2,14]=-0.2,s[2,15]=0.9,s[2,16]=-1.0,s[2,17]=0.4,s[2,18]=0.4,s[2,19]=1.0,s[2,20]=0.3,s[2,21]=0.8,s[2,22]=0.2,s[2,23]=0.9,s[2,24]=-0.2,s[2,25]=0.6,s[2,26]=-0.2,s[2,27]=0.2,s[2,28]=-0.9,s[2,29]=-0.4,s[2,30]=-0.3 s[2,31]=-0.1,s[2,32]=-0.4,s[2,33]=0.3,s[2,34]=-0.2,s[2,35]=0.7,s[2,36]=0.1,s[2,37]=1.0,s[2,38]=-0.9,s[2,39]=-0.1,s[2,40]=-0.5,s[2,41]=0.0,s[2,42]=-0.8,s[2,43]=0.9,s[2,44]=1.1,s[2,45]=-1.2,s[2,46]=-0.6,s[2,47]=0.0,s[2,48]=0.5,s[2,49]=0.3,s[2,50]=-0.4,s[2,51]=-0.5,s[2,52]=0.0,s[2,53]=-0.3,s[2,54]=0.5,s[2,55]=0.5,s[2,56]=-1.2,s[2,57]=-0.2,s[2,58]=0.3,s[2,59]=-0.8,s[2,60]=1.2 s[3,1]=0.0,s[3,2]=0.6,s[3,3]=0.4,s[3,4]=-0.1,s[3,5]=-1.0,s[3,6]=0.3,s[3,7]=-0.7,s[3,8]=-0.5,s[3,9]=0.7,s[3,10]=0.7,s[3,11]=0.1,s[3,12]=-0.2,s[3,13]=-1.2,s[3,14]=-0.6,s[3,15]=0.4,s[3,16]=-0.1,s[3,17]=1.1,s[3,18]=-0.3,s[3,19]=-0.1,s[3,20]=-0.4,s[3,21]=0.4,s[3,22]=0.7,s[3,23]=-1.0,s[3,24]=0.8,s[3,25]=0.1,s[3,26]=-0.3,s[3,27]=0.9,s[3,28]=-1.2,s[3,29]=-0.4,s[3,30]=-0.7 s[3,31]=0.4,s[3,32]=0.8,s[3,33]=-0.9,s[3,34]=-0.4,s[3,35]=0.9,s[3,36]=0.4,s[3,37]=-0.5,s[3,38]=0.7,s[3,39]=0.7,s[3,40]=0.3,s[3,41]=-0.7,s[3,42]=0.5,s[3,43]=0.4,s[3,44]=0.3,s[3,45]=0.9,s[3,46]=0.8,s[3,47]=0.2,s[3,48]=-0.3,s[3,49]=0.1,s[3,50]=0.8,s[3,51]=0.5,s[3,52]=-0.6,s[3,53]=0.2,s[3,54]=1.0,s[3,55]=-0.3,s[3,56]=0.4,s[3,57]=0.7,s[3,58]=-0.4,s[3,59]=0.4,s[3,60]=0.9 s[4,1]=-0.6,s[4,2]=-0.8,s[4,3]=0.6,s[4,4]=-0.1,s[4,5]=-0.1,s[4,6]=0.2,s[4,7]=0.1,s[4,8]=0.1,s[4,9]=0.1,s[4,10]=-0.3,s[4,11]=0.2,s[4,12]=-0.7,s[4,13]=-0.1,s[4,14]=0.1,s[4,15]=-0.3,s[4,16]=-0.1,s[4,17]=-0.1,s[4,18]=-0.4,s[4,19]=-1.0,s[4,20]=-1.0,s[4,21]=0.2,s[4,22]=0.5,s[4,23]=0.8,s[4,24]=0.9,s[4,25]=-0.4,s[4,26]=0.2,s[4,27]=1.1,s[4,28]=0.5,s[4,29]=0.4,s[4,30]=0.8 s[4,31]=1.0,s[4,32]=0.1,s[4,33]=-0.6,s[4,34]=-0.3,s[4,35]=-1.2,s[4,36]=-1.0,s[4,37]=-0.3,s[4,38]=0.3,s[4,39]=1.2,s[4,40]=0.3,s[4,41]=-0.1,s[4,42]=-0.3,s[4,43]=0.0,s[4,44]=1.1,s[4,45]=-0.9,s[4,46]=-0.6,s[4,47]=-1.2,s[4,48]=0.8,s[4,49]=0.1,s[4,50]=0.1,s[4,51]=-0.6,s[4,52]=1.2,s[4,53]=-0.1,s[4,54]=-0.1,s[4,55]=1.2,s[4,56]=-0.8,s[4,57]=0.9,s[4,58]=1.0,s[4,59]=0.1,s[4,60]=-0.8 s[5,1]=-0.4,s[5,2]=0.7,s[5,3]=0.6,s[5,4]=1.2,s[5,5]=-0.6,s[5,6]=-0.5,s[5,7]=-0.1,s[5,8]=-0.8,s[5,9]=1.2,s[5,10]=-1.0,s[5,11]=1.0,s[5,12]=0.4,s[5,13]=0.2,s[5,14]=0.5,s[5,15]=0.8,s[5,16]=-0.7,s[5,17]=0.9,s[5,18]=0.7,s[5,19]=-0.3,s[5,20]=-0.7,s[5,21]=0.5,s[5,22]=-0.6,s[5,23]=-1.0,s[5,24]=-1.0,s[5,25]=-0.6,s[5,26]=1.1,s[5,27]=-0.6,s[5,28]=-0.3,s[5,29]=0.8,s[5,30]=0.6 s[5,31]=-0.2,s[5,32]=0.6,s[5,33]=-0.4,s[5,34]=0.2,s[5,35]=-1.1,s[5,36]=0.8,s[5,37]=-0.5,s[5,38]=-0.7,s[5,39]=-0.7,s[5,40]=0.8,s[5,41]=0.6,s[5,42]=-1.1,s[5,43]=0.8,s[5,44]=0.5,s[5,45]=0.1,s[5,46]=0.8,s[5,47]=-0.3,s[5,48]=1.1,s[5,49]=-1.1,s[5,50]=-0.9,s[5,51]=-0.8,s[5,52]=-1.0,s[5,53]=0.1,s[5,54]=0.9,s[5,55]=-0.2,s[5,56]=-0.1,s[5,57]=-0.3,s[5,58]=-0.7,s[5,59]=0.8,s[5,60]=-0.6 s[6,1]=-0.3,s[6,2]=-0.4,s[6,3]=0.0,s[6,4]=-0.8,s[6,5]=0.5,s[6,6]=1.1,s[6,7]=0.1,s[6,8]=0.3,s[6,9]=-0.5,s[6,10]=0.9,s[6,11]=0.7,s[6,12]=0.5,s[6,13]=-0.8,s[6,14]=0.6,s[6,15]=0.3,s[6,16]=0.5,s[6,17]=1.1,s[6,18]=-0.3,s[6,19]=1.1,s[6,20]=-0.4,s[6,21]=0.5,s[6,22]=-0.4,s[6,23]=-0.5,s[6,24]=1.0,s[6,25]=-0.4,s[6,26]=0.0,s[6,27]=-1.2,s[6,28]=-0.6,s[6,29]=0.9,s[6,30]=-0.2 s[6,31]=0.5,s[6,32]=-1.0,s[6,33]=0.2,s[6,34]=0.0,s[6,35]=1.0,s[6,36]=0.1,s[6,37]=0.6,s[6,38]=-0.2,s[6,39]=-1.2,s[6,40]=-0.3,s[6,41]=0.2,s[6,42]=0.2,s[6,43]=-1.0,s[6,44]=-0.4,s[6,45]=-0.1,s[6,46]=-0.1,s[6,47]=-0.2,s[6,48]=-0.1,s[6,49]=0.9,s[6,50]=-0.5,s[6,51]=0.1,s[6,52]=0.9,s[6,53]=0.9,s[6,54]=0.3,s[6,55]=1.1,s[6,56]=-0.6,s[6,57]=0.4,s[6,58]=-0.5,s[6,59]=0.9,s[6,60]=0.9 s[7,1]=0.6,s[7,2]=-0.5,s[7,3]=-0.6,s[7,4]=-0.5,s[7,5]=-0.9,s[7,6]=1.1,s[7,7]=0.1,s[7,8]=0.4,s[7,9]=0.0,s[7,10]=-1.1,s[7,11]=0.3,s[7,12]=1.1,s[7,13]=0.5,s[7,14]=0.0,s[7,15]=-0.9,s[7,16]=0.8,s[7,17]=0.0,s[7,18]=0.3,s[7,19]=-0.8,s[7,20]=-0.9,s[7,21]=-0.1,s[7,22]=0.3,s[7,23]=0.9,s[7,24]=-0.9,s[7,25]=0.5,s[7,26]=0.1,s[7,27]=-0.4,s[7,28]=-0.8,s[7,29]=-0.1,s[7,30]=-0.4 s[7,31]=0.0,s[7,32]=-0.4,s[7,33]=1.0,s[7,34]=-0.6,s[7,35]=0.5,s[7,36]=1.0,s[7,37]=0.0,s[7,38]=1.1,s[7,39]=0.1,s[7,40]=-0.4,s[7,41]=-0.5,s[7,42]=1.0,s[7,43]=1.0,s[7,44]=-0.9,s[7,45]=-0.5,s[7,46]=1.2,s[7,47]=0.1,s[7,48]=0.3,s[7,49]=-0.2,s[7,50]=-0.8,s[7,51]=-0.8,s[7,52]=-1.1,s[7,53]=0.0,s[7,54]=0.9,s[7,55]=-0.9,s[7,56]=0.3,s[7,57]=-0.7,s[7,58]=-0.3,s[7,59]=-0.7,s[7,60]=0.9 s[8,1]=-0.1,s[8,2]=-1.0,s[8,3]=-0.6,s[8,4]=0.8,s[8,5]=-0.3,s[8,6]=0.0,s[8,7]=0.5,s[8,8]=0.3,s[8,9]=1.1,s[8,10]=-0.7,s[8,11]=-0.3,s[8,12]=-1.0,s[8,13]=1.1,s[8,14]=0.6,s[8,15]=-1.1,s[8,16]=0.9,s[8,17]=0.3,s[8,18]=-1.1,s[8,19]=0.0,s[8,20]=-0.8,s[8,21]=0.0,s[8,22]=-0.4,s[8,23]=-0.9,s[8,24]=0.2,s[8,25]=-1.1,s[8,26]=-1.0,s[8,27]=-1.2,s[8,28]=0.9,s[8,29]=1.0,s[8,30]=0.8 s[8,31]=-0.2,s[8,32]=0.5,s[8,33]=0.6,s[8,34]=0.3,s[8,35]=1.1,s[8,36]=0.4,s[8,37]=0.5,s[8,38]=-1.0,s[8,39]=1.2,s[8,40]=-1.1,s[8,41]=0.0,s[8,42]=-0.1,s[8,43]=0.8,s[8,44]=1.2,s[8,45]=-0.6,s[8,46]=-0.8,s[8,47]=-0.6,s[8,48]=-0.6,s[8,49]=0.8,s[8,50]=1.2,s[8,51]=0.2,s[8,52]=0.5,s[8,53]=0.3,s[8,54]=0.8,s[8,55]=-0.6,s[8,56]=1.0,s[8,57]=0.5,s[8,58]=-0.5,s[8,59]=0.0,s[8,60]=0.1 s[9,1]=-0.1,s[9,2]=0.1,s[9,3]=-0.5,s[9,4]=-0.1,s[9,5]=0.6,s[9,6]=0.6,s[9,7]=0.6,s[9,8]=-0.7,s[9,9]=1.1,s[9,10]=-1.1,s[9,11]=0.0,s[9,12]=0.7,s[9,13]=-0.4,s[9,14]=-0.3,s[9,15]=-0.4,s[9,16]=-0.8,s[9,17]=0.1,s[9,18]=0.5,s[9,19]=-0.1,s[9,20]=-0.6,s[9,21]=0.0,s[9,22]=-0.1,s[9,23]=-0.4,s[9,24]=0.9,s[9,25]=0.7,s[9,26]=-1.0,s[9,27]=1.2,s[9,28]=-0.9,s[9,29]=0.1,s[9,30]=0.0 s[9,31]=0.5,s[9,32]=1.0,s[9,33]=-1.1,s[9,34]=0.4,s[9,35]=1.0,s[9,36]=0.3,s[9,37]=-1.1,s[9,38]=0.5,s[9,39]=-0.7,s[9,40]=-0.8,s[9,41]=-0.1,s[9,42]=-1.2,s[9,43]=0.5,s[9,44]=0.8,s[9,45]=-0.5,s[9,46]=0.2,s[9,47]=0.6,s[9,48]=-0.4,s[9,49]=1.2,s[9,50]=0.6,s[9,51]=0.0,s[9,52]=-1.2,s[9,53]=0.3,s[9,54]=-0.1,s[9,55]=-0.3,s[9,56]=-0.3,s[9,57]=-0.4,s[9,58]=0.3,s[9,59]=1.0,s[9,60]=-1.2 s[10,1]=-0.4,s[10,2]=-1.1,s[10,3]=-1.0,s[10,4]=-0.1,s[10,5]=0.8,s[10,6]=0.3,s[10,7]=0.7,s[10,8]=-0.6,s[10,9]=1.1,s[10,10]=0.6,s[10,11]=-0.4,s[10,12]=0.3,s[10,13]=-1.2,s[10,14]=0.7,s[10,15]=-1.1,s[10,16]=0.0,s[10,17]=-0.6,s[10,18]=0.3,s[10,19]=0.0,s[10,20]=-0.6,s[10,21]=-0.3,s[10,22]=-0.5,s[10,23]=0.5,s[10,24]=-0.7,s[10,25]=-1.2,s[10,26]=0.6,s[10,27]=-0.8,s[10,28]=0.2,s[10,29]=0.4,s[10,30]=0.9 s[10,31]=-0.6,s[10,32]=1.1,s[10,33]=0.8,s[10,34]=0.7,s[10,35]=-0.6,s[10,36]=1.2,s[10,37]=0.7,s[10,38]=0.9,s[10,39]=-0.5,s[10,40]=-1.1,s[10,41]=-0.2,s[10,42]=0.1,s[10,43]=0.7,s[10,44]=1.1,s[10,45]=-0.8,s[10,46]=-0.3,s[10,47]=0.4,s[10,48]=0.9,s[10,49]=-0.6,s[10,50]=1.2,s[10,51]=-0.8,s[10,52]=0.3,s[10,53]=0.3,s[10,54]=-0.3,s[10,55]=-0.9,s[10,56]=0.1,s[10,57]=-1.0,s[10,58]=0.6,s[10,59]=-0.4,s[10,60]=1.2 s[11,1]=1.0,s[11,2]=-0.3,s[11,3]=-0.5,s[11,4]=1.0,s[11,5]=1.1,s[11,6]=1.0,s[11,7]=-0.5,s[11,8]=-1.0,s[11,9]=-1.2,s[11,10]=-1.2,s[11,11]=-0.6,s[11,12]=-0.2,s[11,13]=-1.1,s[11,14]=-0.3,s[11,15]=0.0,s[11,16]=0.1,s[11,17]=0.3,s[11,18]=-0.5,s[11,19]=0.4,s[11,20]=-0.3,s[11,21]=-0.2,s[11,22]=-0.6,s[11,23]=0.8,s[11,24]=0.1,s[11,25]=1.2,s[11,26]=-0.7,s[11,27]=0.7,s[11,28]=-0.5,s[11,29]=-0.7,s[11,30]=-0.2 s[11,31]=1.2,s[11,32]=-0.1,s[11,33]=0.0,s[11,34]=-0.1,s[11,35]=-0.9,s[11,36]=0.8,s[11,37]=-0.5,s[11,38]=0.5,s[11,39]=0.4,s[11,40]=-0.5,s[11,41]=0.6,s[11,42]=0.3,s[11,43]=-0.3,s[11,44]=0.7,s[11,45]=0.3,s[11,46]=0.2,s[11,47]=0.7,s[11,48]=0.4,s[11,49]=0.0,s[11,50]=-0.5,s[11,51]=1.1,s[11,52]=-0.4,s[11,53]=0.5,s[11,54]=-1.0,s[11,55]=-0.7,s[11,56]=0.6,s[11,57]=1.1,s[11,58]=-1.2,s[11,59]=0.1,s[11,60]=0.3 s[12,1]=-0.2,s[12,2]=-0.9,s[12,3]=-0.8,s[12,4]=-0.2,s[12,5]=0.6,s[12,6]=-0.9,s[12,7]=0.0,s[12,8]=0.6,s[12,9]=1.1,s[12,10]=1.2,s[12,11]=-0.5,s[12,12]=0.0,s[12,13]=0.6,s[12,14]=1.0,s[12,15]=1.1,s[12,16]=-0.1,s[12,17]=-0.7,s[12,18]=-1.1,s[12,19]=-0.5,s[12,20]=0.8,s[12,21]=-0.2,s[12,22]=0.9,s[12,23]=1.1,s[12,24]=-0.1,s[12,25]=-0.4,s[12,26]=-0.3,s[12,27]=0.3,s[12,28]=1.1,s[12,29]=-0.9,s[12,30]=-0.5 s[12,31]=0.5,s[12,32]=0.3,s[12,33]=0.6,s[12,34]=0.9,s[12,35]=-0.4,s[12,36]=0.7,s[12,37]=1.1,s[12,38]=0.6,s[12,39]=-1.2,s[12,40]=0.2,s[12,41]=-0.1,s[12,42]=0.2,s[12,43]=-0.7,s[12,44]=0.8,s[12,45]=0.9,s[12,46]=0.4,s[12,47]=-0.6,s[12,48]=-0.2,s[12,49]=-1.1,s[12,50]=0.4,s[12,51]=-0.7,s[12,52]=-0.7,s[12,53]=0.5,s[12,54]=0.5,s[12,55]=0.7,s[12,56]=0.1,s[12,57]=0.4,s[12,58]=0.5,s[12,59]=-1.2,s[12,60]=0.8 s[13,1]=0.6,s[13,2]=-1.1,s[13,3]=-0.1,s[13,4]=-0.9,s[13,5]=0.0,s[13,6]=0.6,s[13,7]=-0.9,s[13,8]=0.4,s[13,9]=0.4,s[13,10]=-1.1,s[13,11]=-0.1,s[13,12]=-0.8,s[13,13]=0.5,s[13,14]=0.7,s[13,15]=-0.3,s[13,16]=-0.3,s[13,17]=-0.2,s[13,18]=1.1,s[13,19]=0.3,s[13,20]=-0.1,s[13,21]=0.0,s[13,22]=0.9,s[13,23]=-0.1,s[13,24]=-0.7,s[13,25]=-0.1,s[13,26]=0.3,s[13,27]=0.1,s[13,28]=-0.4,s[13,29]=1.0,s[13,30]=0.4 s[13,31]=-0.6,s[13,32]=-0.8,s[13,33]=0.4,s[13,34]=0.6,s[13,35]=0.5,s[13,36]=1.2,s[13,37]=0.3,s[13,38]=-0.7,s[13,39]=0.8,s[13,40]=0.9,s[13,41]=0.1,s[13,42]=0.3,s[13,43]=0.0,s[13,44]=-1.2,s[13,45]=0.0,s[13,46]=1.0,s[13,47]=1.1,s[13,48]=-1.2,s[13,49]=0.4,s[13,50]=0.0,s[13,51]=-0.8,s[13,52]=-0.9,s[13,53]=0.5,s[13,54]=1.1,s[13,55]=1.2,s[13,56]=-1.0,s[13,57]=0.2,s[13,58]=0.3,s[13,59]=0.0,s[13,60]=0.2 s[14,1]=-0.2,s[14,2]=-0.5,s[14,3]=-0.9,s[14,4]=-1.1,s[14,5]=-1.2,s[14,6]=-0.2,s[14,7]=0.5,s[14,8]=-1.1,s[14,9]=-0.7,s[14,10]=-0.4,s[14,11]=0.5,s[14,12]=0.1,s[14,13]=0.4,s[14,14]=0.1,s[14,15]=0.3,s[14,16]=0.1,s[14,17]=-1.2,s[14,18]=0.2,s[14,19]=0.2,s[14,20]=-0.3,s[14,21]=-0.2,s[14,22]=-0.2,s[14,23]=0.0,s[14,24]=-1.0,s[14,25]=0.4,s[14,26]=0.5,s[14,27]=0.7,s[14,28]=0.2,s[14,29]=-0.3,s[14,30]=0.5 s[14,31]=-0.2,s[14,32]=0.9,s[14,33]=0.8,s[14,34]=1.1,s[14,35]=-0.6,s[14,36]=-0.7,s[14,37]=-0.9,s[14,38]=-0.9,s[14,39]=1.2,s[14,40]=0.9,s[14,41]=0.1,s[14,42]=-0.9,s[14,43]=-0.6,s[14,44]=-1.0,s[14,45]=0.5,s[14,46]=1.0,s[14,47]=-0.2,s[14,48]=0.0,s[14,49]=-1.2,s[14,50]=0.1,s[14,51]=0.1,s[14,52]=-0.2,s[14,53]=0.7,s[14,54]=-0.7,s[14,55]=0.8,s[14,56]=-0.8,s[14,57]=0.8,s[14,58]=0.4,s[14,59]=-0.4,s[14,60]=-1.1 s[15,1]=-0.2,s[15,2]=0.2,s[15,3]=1.1,s[15,4]=-0.2,s[15,5]=-0.9,s[15,6]=-0.7,s[15,7]=-1.1,s[15,8]=0.7,s[15,9]=0.4,s[15,10]=-0.4,s[15,11]=-0.3,s[15,12]=-0.1,s[15,13]=-0.6,s[15,14]=0.9,s[15,15]=-0.8,s[15,16]=0.1,s[15,17]=-0.5,s[15,18]=0.9,s[15,19]=-1.0,s[15,20]=0.4,s[15,21]=0.1,s[15,22]=-0.1,s[15,23]=1.0,s[15,24]=0.9,s[15,25]=-1.1,s[15,26]=-0.1,s[15,27]=-0.3,s[15,28]=0.6,s[15,29]=-0.5,s[15,30]=1.0 s[15,31]=0.8,s[15,32]=-0.3,s[15,33]=0.3,s[15,34]=0.2,s[15,35]=-0.8,s[15,36]=0.5,s[15,37]=0.3,s[15,38]=-0.4,s[15,39]=1.1,s[15,40]=0.9,s[15,41]=0.6,s[15,42]=1.2,s[15,43]=0.8,s[15,44]=1.1,s[15,45]=1.1,s[15,46]=-0.7,s[15,47]=-0.2,s[15,48]=1.2,s[15,49]=1.0,s[15,50]=1.2,s[15,51]=-0.4,s[15,52]=-0.4,s[15,53]=-1.2,s[15,54]=-0.7,s[15,55]=-0.3,s[15,56]=-0.4,s[15,57]=0.9,s[15,58]=0.0,s[15,59]=0.7,s[15,60]=-1.0 s[16,1]=0.3,s[16,2]=-0.7,s[16,3]=-1.0,s[16,4]=0.1,s[16,5]=0.4,s[16,6]=-0.3,s[16,7]=-0.5,s[16,8]=1.0,s[16,9]=1.2,s[16,10]=-0.9,s[16,11]=-1.0,s[16,12]=-0.9,s[16,13]=-0.8,s[16,14]=0.7,s[16,15]=0.3,s[16,16]=-0.3,s[16,17]=1.2,s[16,18]=-0.2,s[16,19]=-1.0,s[16,20]=0.1,s[16,21]=0.3,s[16,22]=-0.3,s[16,23]=-0.9,s[16,24]=0.2,s[16,25]=0.7,s[16,26]=0.5,s[16,27]=-0.6,s[16,28]=-0.1,s[16,29]=-0.5,s[16,30]=-1.2 s[16,31]=0.5,s[16,32]=0.8,s[16,33]=-0.5,s[16,34]=-0.8,s[16,35]=0.5,s[16,36]=0.5,s[16,37]=-0.5,s[16,38]=-0.9,s[16,39]=0.2,s[16,40]=0.7,s[16,41]=-0.5,s[16,42]=-0.7,s[16,43]=0.3,s[16,44]=0.8,s[16,45]=-0.3,s[16,46]=-1.0,s[16,47]=-0.6,s[16,48]=-0.5,s[16,49]=-0.8,s[16,50]=0.7,s[16,51]=0.4,s[16,52]=-0.1,s[16,53]=-0.1,s[16,54]=0.2,s[16,55]=-0.1,s[16,56]=0.2,s[16,57]=0.6,s[16,58]=0.4,s[16,59]=-0.2,s[16,60]=-1.2 s[17,1]=0.9,s[17,2]=-0.9,s[17,3]=0.4,s[17,4]=-0.1,s[17,5]=0.9,s[17,6]=-0.6,s[17,7]=-0.7,s[17,8]=1.2,s[17,9]=-0.2,s[17,10]=1.2,s[17,11]=-1.2,s[17,12]=0.3,s[17,13]=-0.4,s[17,14]=0.8,s[17,15]=0.9,s[17,16]=-0.3,s[17,17]=-0.3,s[17,18]=-0.8,s[17,19]=-0.5,s[17,20]=0.1,s[17,21]=-0.2,s[17,22]=0.5,s[17,23]=0.0,s[17,24]=0.6,s[17,25]=1.1,s[17,26]=-0.1,s[17,27]=0.6,s[17,28]=-1.0,s[17,29]=0.1,s[17,30]=-0.8 s[17,31]=0.8,s[17,32]=-1.2,s[17,33]=-1.2,s[17,34]=-0.2,s[17,35]=0.5,s[17,36]=-0.6,s[17,37]=0.9,s[17,38]=-0.6,s[17,39]=1.2,s[17,40]=-0.9,s[17,41]=0.4,s[17,42]=0.6,s[17,43]=-0.3,s[17,44]=-1.2,s[17,45]=-1.0,s[17,46]=-0.5,s[17,47]=-0.7,s[17,48]=0.9,s[17,49]=0.5,s[17,50]=0.5,s[17,51]=-0.7,s[17,52]=-0.5,s[17,53]=-1.2,s[17,54]=-1.2,s[17,55]=-0.7,s[17,56]=0.0,s[17,57]=1.2,s[17,58]=0.4,s[17,59]=1.2,s[17,60]=-0.9 s[18,1]=0.1,s[18,2]=-0.5,s[18,3]=0.9,s[18,4]=1.0,s[18,5]=1.0,s[18,6]=0.8,s[18,7]=-0.9,s[18,8]=0.9,s[18,9]=-0.6,s[18,10]=1.0,s[18,11]=-0.1,s[18,12]=-0.2,s[18,13]=0.9,s[18,14]=0.9,s[18,15]=-0.3,s[18,16]=0.0,s[18,17]=0.4,s[18,18]=-0.2,s[18,19]=-0.4,s[18,20]=-0.7,s[18,21]=-0.3,s[18,22]=1.1,s[18,23]=0.9,s[18,24]=-0.7,s[18,25]=-0.1,s[18,26]=-1.2,s[18,27]=-0.1,s[18,28]=-0.1,s[18,29]=1.0,s[18,30]=-1.1 s[18,31]=1.0,s[18,32]=1.1,s[18,33]=0.2,s[18,34]=-1.1,s[18,35]=0.5,s[18,36]=-0.5,s[18,37]=0.5,s[18,38]=0.3,s[18,39]=-0.8,s[18,40]=0.8,s[18,41]=0.4,s[18,42]=0.4,s[18,43]=-0.1,s[18,44]=0.3,s[18,45]=-0.6,s[18,46]=-0.7,s[18,47]=0.6,s[18,48]=-0.6,s[18,49]=-1.2,s[18,50]=0.0,s[18,51]=0.4,s[18,52]=1.1,s[18,53]=0.2,s[18,54]=0.4,s[18,55]=1.0,s[18,56]=-0.6,s[18,57]=-0.8,s[18,58]=0.3,s[18,59]=-0.8,s[18,60]=0.8 s[19,1]=0.4,s[19,2]=-1.1,s[19,3]=-1.2,s[19,4]=0.8,s[19,5]=0.2,s[19,6]=0.6,s[19,7]=0.0,s[19,8]=-0.1,s[19,9]=-0.5,s[19,10]=0.9,s[19,11]=0.7,s[19,12]=1.1,s[19,13]=-0.8,s[19,14]=0.3,s[19,15]=0.3,s[19,16]=0.7,s[19,17]=0.1,s[19,18]=0.4,s[19,19]=-0.2,s[19,20]=-1.1,s[19,21]=0.0,s[19,22]=-0.6,s[19,23]=-0.8,s[19,24]=1.1,s[19,25]=0.3,s[19,26]=0.2,s[19,27]=0.6,s[19,28]=0.3,s[19,29]=-1.0,s[19,30]=0.7 s[19,31]=0.8,s[19,32]=-0.8,s[19,33]=-1.2,s[19,34]=-0.1,s[19,35]=-0.5,s[19,36]=0.3,s[19,37]=-1.1,s[19,38]=0.6,s[19,39]=-0.1,s[19,40]=-1.1,s[19,41]=0.1,s[19,42]=-0.5,s[19,43]=0.5,s[19,44]=1.2,s[19,45]=0.0,s[19,46]=-0.6,s[19,47]=-0.7,s[19,48]=-0.8,s[19,49]=0.5,s[19,50]=-0.2,s[19,51]=0.8,s[19,52]=0.1,s[19,53]=1.0,s[19,54]=-0.6,s[19,55]=0.5,s[19,56]=-0.9,s[19,57]=-0.1,s[19,58]=1.0,s[19,59]=-1.2,s[19,60]=-0.5 s[20,1]=0.2,s[20,2]=-1.0,s[20,3]=0.1,s[20,4]=0.7,s[20,5]=0.0,s[20,6]=0.7,s[20,7]=-0.3,s[20,8]=0.5,s[20,9]=-0.6,s[20,10]=-0.6,s[20,11]=-0.7,s[20,12]=0.7,s[20,13]=-0.7,s[20,14]=0.9,s[20,15]=1.1,s[20,16]=-0.9,s[20,17]=-0.1,s[20,18]=-0.4,s[20,19]=-0.6,s[20,20]=-0.6,s[20,21]=-0.1,s[20,22]=0.0,s[20,23]=1.0,s[20,24]=-0.7,s[20,25]=-0.6,s[20,26]=0.5,s[20,27]=0.3,s[20,28]=0.9,s[20,29]=0.9,s[20,30]=0.9 s[20,31]=-1.0,s[20,32]=0.0,s[20,33]=0.9,s[20,34]=-0.1,s[20,35]=-0.2,s[20,36]=0.9,s[20,37]=1.1,s[20,38]=-0.8,s[20,39]=0.1,s[20,40]=1.0,s[20,41]=0.0,s[20,42]=0.1,s[20,43]=0.6,s[20,44]=0.9,s[20,45]=-1.1,s[20,46]=0.4,s[20,47]=-0.9,s[20,48]=0.2,s[20,49]=-1.1,s[20,50]=1.0,s[20,51]=1.0,s[20,52]=0.9,s[20,53]=-1.0,s[20,54]=0.6,s[20,55]=-1.0,s[20,56]=-0.6,s[20,57]=-1.1,s[20,58]=0.2,s[20,59]=-0.7,s[20,60]=0.5 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float ppz = @ppz float pxx = 0 float pyy = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x pyy = y x = s[@sd,1] + s[@sd,2]*x + s[@sd,3]*x*x + s[@sd,4]*x*x*x + s[@sd,5]*x*x*y + s[@sd,6]*x*x*ppz + s[@sd,7]*x*y + \ s[@sd,8]*x*y*y + s[@sd,9]*x*y*ppz + s[@sd,10]*x*ppz + s[@sd,11]*x*ppz*ppz + s[@sd,12]*y + s[@sd,13]*y*y + s[@sd,14]*y*y*y + \ s[@sd,15]*y*y*ppz + s[@sd,16]*y*ppz + s[@sd,17]*y*ppz*ppz + s[@sd,18]*ppz +s[@sd,19]*ppz*ppz +s[@sd,20]*ppz*ppz*ppz y = s[@sd,21] +s[@sd,22]*pxx +s[@sd,23]*pxx*pxx +s[@sd,24]*pxx*pxx*pxx +s[@sd,25]*pxx*pxx*y +s[@sd,26]*pxx*pxx*ppz +s[@sd,27]*pxx*y +\ s[@sd,28]*pxx*y*y +s[@sd,29]*pxx*y*ppz +s[@sd,30]*pxx*ppz +s[@sd,31]*pxx*ppz*ppz +s[@sd,32]*y +s[@sd,33]*y*y +s[@sd,34]*y*y*y + \ s[@sd,35]*y*y*ppz +s[@sd,36]*y*ppz +s[@sd,37]*y*ppz*ppz +s[@sd,38]*ppz +s[@sd,39]*ppz*ppz +s[@sd,40]*ppz*ppz*ppz ppz = s[@sd,41] +s[@sd,42]*pxx +s[@sd,43]*pxx*pxx +s[@sd,44]*pxx*pxx*pxx +s[@sd,45]*pxx*pxx*pyy +s[@sd,46]*pxx*pxx*ppz +s[@sd,47]*pxx*pyy + \ s[@sd,48]*pxx*pyy*pyy +s[@sd,49]*pxx*pyy*ppz +s[@sd,50]*pxx*ppz +s[@sd,51]*pxx*ppz*ppz +s[@sd,52]*pyy +s[@sd,53]*pyy*pyy +s[@sd,54]*pyy*pyy*pyy + \ s[@sd,55]*pyy*pyy*ppz +s[@sd,56]*pyy*ppz +s[@sd,57]*pyy*ppz*ppz +s[@sd,58]*ppz +s[@sd,59]*ppz*ppz +s[@sd,60]*ppz*ppz*ppz att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y) + ppz*@pw) float d = @distscale*|pz-(x + sgn*flip(y) + ppz*@pw)| return d endfunc private: float s[21,61] default: title = "Sprott3D_Cubic" heading text="Sprott 3D cubic attractors" endheading heading text=" x -> Cubic in x, y and z" endheading heading text=" y -> Cubic in x, y and z" endheading heading text=" z -> Cubic in x, y and z" endheading int param v_trapshapesprott3d_Cubic caption = "Version (Trap Shape Sprott3D_Cubic)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesprott3d_Cubic < 100 endparam param sd caption = "Sprott selector" default = 0 enum = "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" \ "15" "16" "17" "18" "19" "20" hint = "Each Sprott selector uses a different strange attractor." endparam heading text = "'Initialize Height' sets the starting z value for the attractor." endheading float param ppz caption = "Initialize Height" default = 0.0 endparam heading text = "'Height weight' determines the weight of the final z value which is added \ to the trap distance." endheading complex param pw caption = "Height weight" default = (0.5,0) endparam float param distscale caption = "Distance scale" default = 2 endparam float param s caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 15 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeSprott3D_Cubic_ODE(common.ulb:TrapShape) { ; This shape uses a Sprott strange attractor.
;

; The Sprott attractors were developed by Julien C. Sprott, and are ; based upon polynomials and linear differential equations of polynomials. public: import "common.ulb" ; Constructor func REB_TrapShapeSprott3D_Cubic_ODE(Generic pparent) TrapShape.TrapShape(pparent) s[0,1]=0.4,s[0,2]=0.7,s[0,3]=-0.5,s[0,4]=-0.3,s[0,5]=1.1,s[0,6]=-0.9,s[0,7]=0.6,s[0,8]=-0.5,s[0,9]=0.7,s[0,10]=0.1,s[0,11]=0.9,s[0,12]=1.1,s[0,13]=-0.8,s[0,14]=0.9,s[0,15]=-1.1,s[0,16]=-0.6,s[0,17]=1.0,s[0,18]=-1.2,s[0,19]=1.0,s[0,20]=0.8,s[0,21]=1.2,s[0,22]=-1.1,s[0,23]=-0.4,s[0,24]=-0.9,s[0,25]=-0.9,s[0,26]=0.8,s[0,27]=-0.5,s[0,28]=-1.1,s[0,29]=-0.2,s[0,30]=-0.6 s[0,31]=1.1,s[0,32]=0.1,s[0,33]=0.4,s[0,34]=-1.0,s[0,35]=0.3,s[0,36]=-0.7,s[0,37]=-1.2,s[0,38]=-0.5,s[0,39]=1.1,s[0,40]=1.1,s[0,41]=0.6,s[0,42]=0.9,s[0,43]=-0.3,s[0,44]=0.0,s[0,45]=1.2,s[0,46]=-1.2,s[0,47]=-0.9,s[0,48]=-0.3,s[0,49]=1.2,s[0,50]=-0.8,s[0,51]=1.2,s[0,52]=-0.1,s[0,53]=0.8,s[0,54]=-0.5,s[0,55]=-1.2,s[0,56]=0.6,s[0,57]=-0.1,s[0,58]=1.1,s[0,59]=-1.0,s[0,60]=0.3 s[1,1]=0.7,s[1,2]=0.0,s[1,3]=0.0,s[1,4]=-1.0,s[1,5]=0.6,s[1,6]=0.3,s[1,7]=0.0,s[1,8]=0.7,s[1,9]=-0.4,s[1,10]=0.5,s[1,11]=1.0,s[1,12]=-0.2,s[1,13]=0.8,s[1,14]=0.5,s[1,15]=0.3 s[1,16]=-0.8,s[1,17]=0.4,s[1,18]=0.8,s[1,19]=0.8,s[1,20]=-1.2,s[1,21]=-0.2,s[1,22]=0.6,s[1,23]=-1.1,s[1,24]=-0.9,s[1,25]=0.7,s[1,26]=0.2,s[1,27]=0.9,s[1,28]=1.1,s[1,29]=-0.2,s[1,30]=0.8 s[1,31]=0.8,s[1,32]=-0.1,s[1,33]=-0.1,s[1,34]=-0.7,s[1,35]=-0.8,s[1,36]=1.0,s[1,37]=0.8,s[1,38]=-0.7,s[1,39]=-1.1,s[1,40]=0.1,s[1,41]=-0.2,s[1,42]=0.8,s[1,43]=0.8,s[1,44]=-0.2,s[1,45]=-0.5 s[1,46]=-0.4,s[1,47]=-0.8,s[1,48]=0.1,s[1,49]=0.3,s[1,50]=0.6,s[1,51]=0.1,s[1,52]=-0.7,s[1,53]=-0.5,s[1,54]=0.5,s[1,55]=-0.3,s[1,56]=-0.1,s[1,57]=-0.3,s[1,58]=-0.6,s[1,59]=0.2,s[1,60]=-0.2 s[2,1]=-0.2,s[2,2]=0.5,s[2,3]=-1.1,s[2,4]=-1.1,s[2,5]=0.6,s[2,6]=-1.0,s[2,7]=0.0,s[2,8]=-0.2,s[2,9]=1.0,s[2,10]=-0.8,s[2,11]=0.7,s[2,12]=0.3,s[2,13]=0.8,s[2,14]=0.0,s[2,15]=-0.1 s[2,16]=0.7,s[2,17]=-0.1,s[2,18]=-0.2,s[2,19]=1.1,s[2,20]=-0.7,s[2,21]=0.1,s[2,22]=-0.8,s[2,23]=-0.1,s[2,24]=-0.7,s[2,25]=0.3,s[2,26]=-0.9,s[2,27]=1.1,s[2,28]=-0.5,s[2,29]=0.6,s[2,30]=-0.4 s[2,31]=-0.4,s[2,32]=-0.9,s[2,33]=0.3,s[2,34]=-1.2,s[2,35]=0.2,s[2,36]=-0.6,s[2,37]=0.1,s[2,38]=0.2,s[2,39]=1.2,s[2,40]=0.1,s[2,41]=1.0,s[2,42]=-0.6,s[2,43]=0.5,s[2,44]=0.6,s[2,45]=-0.1 s[2,46]=1.0,s[2,47]=-1.1,s[2,48]=-0.6,s[2,49]=-1.2,s[2,50]=0.9,s[2,51]=0.6,s[2,52]=0.5,s[2,53]=-0.6,s[2,54]=0.8,s[2,55]=0.2,s[2,56]=0.9,s[2,57]=-0.7,s[2,58]=0.6,s[2,59]=-0.1,s[2,60]=-0.2 s[3,1]=1.0,s[3,2]=-0.7,s[3,3]=0.6,s[3,4]=-0.3,s[3,5]=-0.5,s[3,6]=-0.2,s[3,7]=-0.4,s[3,8]=-0.1,s[3,9]=-0.9,s[3,10]=-0.6,s[3,11]=1.0,s[3,12]=-0.1,s[3,13]=-0.6,s[3,14]=1.2,s[3,15]=-0.4 s[3,16]=-0.5,s[3,17]=-0.2,s[3,18]=0.5,s[3,19]=0.0,s[3,20]=0.7,s[3,21]=0.5,s[3,22]=0.4,s[3,23]=-0.4,s[3,24]=-0.2,s[3,25]=0.9,s[3,26]=-0.7,s[3,27]=0.6,s[3,28]=0.1,s[3,29]=1.0,s[3,30]=-0.6 s[3,31]=-1.1,s[3,32]=-1.0,s[3,33]=0.2,s[3,34]=-1.0,s[3,35]=0.4,s[3,36]=0.0,s[3,37]=-0.3,s[3,38]=-0.5,s[3,39]=-1.1,s[3,40]=1.2,s[3,41]=0.6,s[3,42]=-0.3,s[3,43]=-1.1,s[3,44]=-0.6,s[3,45]=-0.1 s[3,46]=-0.9,s[3,47]=-0.8,s[3,48]=-0.1,s[3,49]=0.5,s[3,50]=0.5,s[3,51]=-0.4,s[3,52]=-0.2,s[3,53]=0.8,s[3,54]=0.4,s[3,55]=-0.5,s[3,56]=0.4,s[3,57]=0.6,s[3,58]=0.7,s[3,59]=-0.6,s[3,60]=-0.6 s[4,1]=0.9,s[4,2]=-0.2,s[4,3]=-1.1,s[4,4]=-1.1,s[4,5]=0.9,s[4,6]=-0.4,s[4,7]=-0.1,s[4,8]=-0.4,s[4,9]=-1.0,s[4,10]=0.0,s[4,11]=0.1,s[4,12]=-0.7,s[4,13]=-0.8,s[4,14]=-0.6,s[4,15]=-1.2 s[4,16]=0.0,s[4,17]=0.1,s[4,18]=-0.1,s[4,19]=0.9,s[4,20]=1.2,s[4,21]=-0.2,s[4,22]=-0.8,s[4,23]=-0.6,s[4,24]=0.2,s[4,25]=-0.6,s[4,26]=0.7,s[4,27]=0.1,s[4,28]=1.2,s[4,29]=-0.1,s[4,30]=-0.3 s[4,31]=-0.8,s[4,32]=-0.1,s[4,33]=-1.2,s[4,34]=-1.2,s[4,35]=1.1,s[4,36]=-0.8,s[4,37]=0.1,s[4,38]=-0.9,s[4,39]=-0.3,s[4,40]=0.5,s[4,41]=0.6,s[4,42]=0.6,s[4,43]=0.6,s[4,44]=-1.1,s[4,45]=-0.4 s[4,46]=-0.4,s[4,47]=-0.4,s[4,48]=-0.7,s[4,49]=0.1,s[4,50]=0.8,s[4,51]=0.3,s[4,52]=-0.6,s[4,53]=-0.4,s[4,54]=-1.2,s[4,55]=0.6,s[4,56]=-0.7,s[4,57]=-0.7,s[4,58]=0.8,s[4,59]=0.3,s[4,60]=-0.3 s[5,1]=1.0,s[5,2]=0.4,s[5,3]=0.7,s[5,4]=-1.1,s[5,5]=-0.3,s[5,6]=-0.9,s[5,7]=0.9,s[5,8]=-0.3,s[5,9]=-0.3,s[5,10]=-0.6,s[5,11]=-0.1,s[5,12]=0.6,s[5,13]=0.7,s[5,14]=0.6,s[5,15]=-0.3 s[5,16]=-0.8,s[5,17]=-1.1,s[5,18]=0.2,s[5,19]=0.0,s[5,20]=-0.3,s[5,21]=-0.5,s[5,22]=-0.9,s[5,23]=1.0,s[5,24]=-0.4,s[5,25]=-1.0,s[5,26]=0.4,s[5,27]=0.5,s[5,28]=1.1,s[5,29]=0.6,s[5,30]=-1.2 s[5,31]=-0.2,s[5,32]=1.1,s[5,33]=1.0,s[5,34]=-0.9,s[5,35]=-0.2,s[5,36]=-0.5,s[5,37]=-0.8,s[5,38]=0.2,s[5,39]=-1.0,s[5,40]=-1.1,s[5,41]=0.6,s[5,42]=0.9,s[5,43]=0.3,s[5,44]=-0.2,s[5,45]=-0.9 s[5,46]=0.2,s[5,47]=-0.8,s[5,48]=0.2,s[5,49]=-1.2,s[5,50]=0.3,s[5,51]=0.4,s[5,52]=0.6,s[5,53]=-0.1,s[5,54]=1.1,s[5,55]=0.0,s[5,56]=0.5,s[5,57]=0.7,s[5,58]=0.7,s[5,59]=0.3,s[5,60]=0.1 s[6,1]=0.3,s[6,2]=-0.8,s[6,3]=1.1,s[6,4]=-0.7,s[6,5]=-0.7,s[6,6]=-1.2,s[6,7]=0.3,s[6,8]=-0.9,s[6,9]=0.2,s[6,10]=1.2,s[6,11]=-1.1,s[6,12]=-0.7,s[6,13]=-1.2,s[6,14]=-0.4,s[6,15]=-0.5 s[6,16]=-0.7,s[6,17]=-0.6,s[6,18]=-1.1,s[6,19]=-0.8,s[6,20]=0.8,s[6,21]=0.2,s[6,22]=0.7,s[6,23]=-0.7,s[6,24]=-0.4,s[6,25]=-1.0,s[6,26]=0.5,s[6,27]=0.2,s[6,28]=-1.1,s[6,29]=0.7,s[6,30]=1.1 s[6,31]=1.1,s[6,32]=-0.1,s[6,33]=-0.9,s[6,34]=0.1,s[6,35]=-0.9,s[6,36]=0.0,s[6,37]=0.3,s[6,38]=-1.0,s[6,39]=-0.5,s[6,40]=0.2,s[6,41]=-0.3,s[6,42]=-0.1,s[6,43]=0.4,s[6,44]=0.1,s[6,45]=-0.9 s[6,46]=0.2,s[6,47]=-1.0,s[6,48]=-0.4,s[6,49]=0.9,s[6,50]=-0.1,s[6,51]=-1.2,s[6,52]=-0.5,s[6,53]=-0.9,s[6,54]=0.4,s[6,55]=0.5,s[6,56]=0.3,s[6,57]=0.3,s[6,58]=-0.8,s[6,59]=-0.8,s[6,60]=-1.1 s[7,1]=-0.3,s[7,2]=0.6,s[7,3]=-1.0,s[7,4]=0.7,s[7,5]=-0.3,s[7,6]=-0.9,s[7,7]=1.2,s[7,8]=1.0,s[7,9]=-0.2,s[7,10]=0.1,s[7,11]=-0.8,s[7,12]=-0.9,s[7,13]=0.1,s[7,14]=-1.0,s[7,15]=0.9 s[7,16]=-1.0,s[7,17]=-0.3,s[7,18]=-0.1,s[7,19]=-0.5,s[7,20]=-0.2,s[7,21]=-0.4,s[7,22]=0.4,s[7,23]=-1.1,s[7,24]=0.7,s[7,25]=0.4,s[7,26]=0.7,s[7,27]=0.2,s[7,28]=0.7,s[7,29]=-0.2,s[7,30]=0.3 s[7,31]=0.6,s[7,32]=-0.3,s[7,33]=1.2,s[7,34]=0.9,s[7,35]=0.2,s[7,36]=-0.2,s[7,37]=-0.2,s[7,38]=1.1,s[7,39]=-0.6,s[7,40]=-0.5,s[7,41]=-0.8,s[7,42]=-0.5,s[7,43]=-1.0,s[7,44]=-0.4,s[7,45]=-0.8 s[7,46]=-0.7,s[7,47]=-0.8,s[7,48]=0.8,s[7,49]=-1.1,s[7,50]=0.5,s[7,51]=-0.9,s[7,52]=0.7,s[7,53]=0.2,s[7,54]=0.6,s[7,55]=1.1,s[7,56]=0.6,s[7,57]=0.7,s[7,58]=0.4,s[7,59]=0.8,s[7,60]=-0.9 s[8,1]=-0.1,s[8,2]=1.0,s[8,3]=0.4,s[8,4]=-0.6,s[8,5]=0.2,s[8,6]=1.2,s[8,7]=0.2,s[8,8]=-0.5,s[8,9]=1.0,s[8,10]=0.6,s[8,11]=0.3,s[8,12]=0.9,s[8,13]=0.2,s[8,14]=-0.2,s[8,15]=0.1 s[8,16]=-0.6,s[8,17]=-1.0,s[8,18]=0.6,s[8,19]=0.8,s[8,20]=-1.0,s[8,21]=-0.2,s[8,22]=1.1,s[8,23]=0.6,s[8,24]=-0.7,s[8,25]=-0.7,s[8,26]=-0.7,s[8,27]=0.7,s[8,28]=-0.1,s[8,29]=-0.2,s[8,30]=-1.1 s[8,31]=0.1,s[8,32]=1.1,s[8,33]=0.5,s[8,34]=0.1,s[8,35]=0.8,s[8,36]=-0.4,s[8,37]=-0.4,s[8,38]=-1.0,s[8,39]=1.2,s[8,40]=0.5,s[8,41]=-1.0,s[8,42]=-1.1,s[8,43]=-0.8,s[8,44]=0.8,s[8,45]=0.0 s[8,46]=-1.2,s[8,47]=-1.0,s[8,48]=-0.9,s[8,49]=0.8,s[8,50]=-0.4,s[8,51]=-0.9,s[8,52]=1.0,s[8,53]=0.8,s[8,54]=-0.9,s[8,55]=-0.9,s[8,56]=1.1,s[8,57]=-0.8,s[8,58]=0.9,s[8,59]=0.7,s[8,60]=-1.1 s[9,1]=-0.3,s[9,2]=0.8,s[9,3]=0.4,s[9,4]=-1.0,s[9,5]=0.7,s[9,6]=1.1,s[9,7]=1.1,s[9,8]=1.1,s[9,9]=0.1,s[9,10]=0.6,s[9,11]=0.3,s[9,12]=0.0,s[9,13]=0.6,s[9,14]=0.1,s[9,15]=0.0 s[9,16]=-0.3,s[9,17]=-1.0,s[9,18]=-1.0,s[9,19]=0.0,s[9,20]=-0.8,s[9,21]=-0.5,s[9,22]=0.9,s[9,23]=-0.6,s[9,24]=0.6,s[9,25]=-0.6,s[9,26]=0.4,s[9,27]=-0.2,s[9,28]=1.2,s[9,29]=-0.5,s[9,30]=0.3 s[9,31]=-0.9,s[9,32]=-1.0,s[9,33]=0.2,s[9,34]=-0.4,s[9,35]=0.0,s[9,36]=0.4,s[9,37]=-0.5,s[9,38]=-0.1,s[9,39]=-0.7,s[9,40]=0.4,s[9,41]=1.2,s[9,42]=-0.3,s[9,43]=0.7,s[9,44]=1.0,s[9,45]=0.8 s[9,46]=-0.1,s[9,47]=-0.9,s[9,48]=-0.2,s[9,49]=-0.9,s[9,50]=0.6,s[9,51]=0.5,s[9,52]=-0.3,s[9,53]=-0.2,s[9,54]=0.3,s[9,55]=-0.2,s[9,56]=-1.0,s[9,57]=0.1,s[9,58]=-0.6,s[9,59]=0.8,s[9,60]=-0.2 s[10,1]=0.9,s[10,2]=0.1,s[10,3]=-1.1,s[10,4]=0.5,s[10,5]=1.2,s[10,6]=-0.9,s[10,7]=-0.4,s[10,8]=-1.0,s[10,9]=-0.1,s[10,10]=0.8,s[10,11]=-0.4,s[10,12]=1.2,s[10,13]=-0.9,s[10,14]=0.0,s[10,15]=0.1 s[10,16]=-0.3,s[10,17]=-0.3,s[10,18]=0.1,s[10,19]=0.2,s[10,20]=1.0,s[10,21]=-0.8,s[10,22]=0.4,s[10,23]=0.9,s[10,24]=0.2,s[10,25]=-0.9,s[10,26]=-0.4,s[10,27]=-0.6,s[10,28]=1.0,s[10,29]=0.4,s[10,30]=0.0 s[10,31]=0.8,s[10,32]=-0.9,s[10,33]=0.3,s[10,34]=-0.2,s[10,35]=-0.3,s[10,36]=0.0,s[10,37]=-0.4,s[10,38]=-0.6,s[10,39]=0.6,s[10,40]=0.9,s[10,41]=-0.1,s[10,42]=1.0,s[10,43]=0.7,s[10,44]=0.2,s[10,45]=0.3 s[10,46]=0.0,s[10,47]=0.7,s[10,48]=-0.8,s[10,49]=1.2,s[10,50]=0.8,s[10,51]=0.0,s[10,52]=-1.1,s[10,53]=0.2,s[10,54]=0.1,s[10,55]=-0.7,s[10,56]=-0.7,s[10,57]=-0.8,s[10,58]=0.3,s[10,59]=0.8,s[10,60]=-0.6 s[11,1]=-0.3,s[11,2]=-0.3,s[11,3]=-0.9,s[11,4]=-1.2,s[11,5]=-0.6,s[11,6]=1.2,s[11,7]=0.9,s[11,8]=-0.5,s[11,9]=-0.5,s[11,10]=-0.9,s[11,11]=-0.9,s[11,12]=0.0,s[11,13]=-0.7,s[11,14]=0.0,s[11,15]=0.1 s[11,16]=-0.5,s[11,17]=0.1,s[11,18]=1.2,s[11,19]=-1.2,s[11,20]=-0.7,s[11,21]=-0.4,s[11,22]=-0.6,s[11,23]=0.3,s[11,24]=-1.2,s[11,25]=-1.2,s[11,26]=-0.2,s[11,27]=1.2,s[11,28]=1.1,s[11,29]=0.0,s[11,30]=0.4 s[11,31]=-1.2,s[11,32]=-0.2,s[11,33]=-1.1,s[11,34]=-1.1,s[11,35]=0.5,s[11,36]=-0.2,s[11,37]=0.0,s[11,38]=0.9,s[11,39]=-0.9,s[11,40]=0.9,s[11,41]=-0.4,s[11,42]=-0.5,s[11,43]=-0.9,s[11,44]=-0.6,s[11,45]=1.1 s[11,46]=-0.2,s[11,47]=0.7,s[11,48]=0.7,s[11,49]=-0.9,s[11,50]=-0.9,s[11,51]=-1.1,s[11,52]=0.9,s[11,53]=-0.8,s[11,54]=-1.0,s[11,55]=-0.6,s[11,56]=-0.8,s[11,57]=0.3,s[11,58]=0.8,s[11,59]=0.7,s[11,60]=-0.3 s[12,1]=0.5,s[12,2]=-1.0,s[12,3]=-0.4,s[12,4]=-0.7,s[12,5]=0.9,s[12,6]=0.9,s[12,7]=-0.9,s[12,8]=0.7,s[12,9]=0.9,s[12,10]=-1.2,s[12,11]=0.8,s[12,12]=0.2,s[12,13]=-0.4,s[12,14]=-1.0,s[12,15]=-0.9 s[12,16]=0.5,s[12,17]=-0.5,s[12,18]=0.0,s[12,19]=0.9,s[12,20]=-1.0,s[12,21]=0.8,s[12,22]=-0.9,s[12,23]=-0.9,s[12,24]=0.2,s[12,25]=0.4,s[12,26]=1.2,s[12,27]=0.8,s[12,28]=1.0,s[12,29]=-1.0,s[12,30]=0.3 s[12,31]=0.2,s[12,32]=-1.2,s[12,33]=-0.2,s[12,34]=-1.0,s[12,35]=-0.5,s[12,36]=-0.4,s[12,37]=-0.3,s[12,38]=-0.9,s[12,39]=-0.2,s[12,40]=0.2,s[12,41]=-0.9,s[12,42]=-0.3,s[12,43]=-1.2,s[12,44]=0.8,s[12,45]=1.1 s[12,46]=1.1,s[12,47]=-0.9,s[12,48]=0.1,s[12,49]=0.6,s[12,50]=-0.5,s[12,51]=-0.2,s[12,52]=0.2,s[12,53]=-0.3,s[12,54]=-0.9,s[12,55]=-0.6,s[12,56]=0.3,s[12,57]=0.6,s[12,58]=-0.1,s[12,59]=0.7,s[12,60]=-0.9 s[13,1]=-0.9,s[13,2]=-0.9,s[13,3]=-0.8,s[13,4]=0.3,s[13,5]=-0.9,s[13,6]=-1.1,s[13,7]=1.0,s[13,8]=0.0,s[13,9]=0.7,s[13,10]=-0.8,s[13,11]=1.0,s[13,12]=0.0,s[13,13]=-0.7,s[13,14]=-1.1,s[13,15]=-1.1 s[13,16]=-1.2,s[13,17]=0.7,s[13,18]=-0.7,s[13,19]=-0.1,s[13,20]=-1.1,s[13,21]=-1.0,s[13,22]=0.6,s[13,23]=-1.0,s[13,24]=0.5,s[13,25]=-0.7,s[13,26]=0.2,s[13,27]=-0.9,s[13,28]=-1.1,s[13,29]=0.6,s[13,30]=0.9 s[13,31]=0.6,s[13,32]=-1.1,s[13,33]=-0.1,s[13,34]=-0.5,s[13,35]=1.0,s[13,36]=-1.1,s[13,37]=-1.2,s[13,38]=-0.8,s[13,39]=0.7,s[13,40]=-0.8,s[13,41]=-0.7,s[13,42]=-0.8,s[13,43]=-0.8,s[13,44]=0.5,s[13,45]=0.6 s[13,46]=0.2,s[13,47]=-0.2,s[13,48]=0.7,s[13,49]=0.8,s[13,50]=0.0,s[13,51]=-1.2,s[13,52]=-0.3,s[13,53]=1.1,s[13,54]=-0.9,s[13,55]=0.1,s[13,56]=0.3,s[13,57]=-0.6,s[13,58]=-0.8,s[13,59]=0.1,s[13,60]=0.3 s[14,1]=-0.4,s[14,2]=-0.2,s[14,3]=0.5,s[14,4]=-1.0,s[14,5]=-0.2,s[14,6]=0.8,s[14,7]=-0.1,s[14,8]=0.7,s[14,9]=0.7,s[14,10]=-0.4,s[14,11]=0.4,s[14,12]=0.0,s[14,13]=0.7,s[14,14]=-0.1,s[14,15]=0.3 s[14,16]=-0.4,s[14,17]=-0.1,s[14,18]=-1.0,s[14,19]=0.3,s[14,20]=1.1,s[14,21]=1.2,s[14,22]=0.8,s[14,23]=0.2,s[14,24]=0.1,s[14,25]=-0.7,s[14,26]=-0.9,s[14,27]=-0.5,s[14,28]=1.1,s[14,29]=-1.1,s[14,30]=-0.2 s[14,31]=0.2,s[14,32]=0.5,s[14,33]=-0.8,s[14,34]=-1.1,s[14,35]=-1.1,s[14,36]=-0.2,s[14,37]=0.7,s[14,38]=0.8,s[14,39]=0.2,s[14,40]=0.0,s[14,41]=-0.4,s[14,42]=0.7,s[14,43]=0.6,s[14,44]=-0.3,s[14,45]=0.9 s[14,46]=-1.1,s[14,47]=-0.7,s[14,48]=0.3,s[14,49]=1.0,s[14,50]=0.3,s[14,51]=-0.7,s[14,52]=0.0,s[14,53]=0.6,s[14,54]=0.0,s[14,55]=0.8,s[14,56]=0.5,s[14,57]=0.4,s[14,58]=1.2,s[14,59]=1.0,s[14,60]=-0.7 s[15,1]=0.1,s[15,2]=0.0,s[15,3]=-0.7,s[15,4]=-0.8,s[15,5]=0.5,s[15,6]=1.0,s[15,7]=-0.6,s[15,8]=-0.8,s[15,9]=-0.7,s[15,10]=0.8,s[15,11]=1.0,s[15,12]=0.0,s[15,13]=0.2,s[15,14]=0.7,s[15,15]=0.6 s[15,16]=-0.3,s[15,17]=-1.0,s[15,18]=-1.0,s[15,19]=-0.1,s[15,20]=-0.5,s[15,21]=0.4,s[15,22]=-1.1,s[15,23]=-0.2,s[15,24]=0.3,s[15,25]=-1.1,s[15,26]=0.6,s[15,27]=0.4,s[15,28]=0.1,s[15,29]=-0.7,s[15,30]=-0.2 s[15,31]=-0.4,s[15,32]=-0.9,s[15,33]=0.0,s[15,34]=-0.1,s[15,35]=-0.1,s[15,36]=1.1,s[15,37]=0.2,s[15,38]=-0.5,s[15,39]=-0.5,s[15,40]=-0.7,s[15,41]=-1.0,s[15,42]=-0.5,s[15,43]=0.9,s[15,44]=0.8,s[15,45]=0.6 s[15,46]=0.1,s[15,47]=-0.2,s[15,48]=-1.0,s[15,49]=-0.5,s[15,50]=0.5,s[15,51]=-0.9,s[15,52]=0.7,s[15,53]=0.8,s[15,54]=-0.5,s[15,55]=-0.5,s[15,56]=-0.3,s[15,57]=1.1,s[15,58]=0.5,s[15,59]=0.9,s[15,60]=0.1 s[16,1]=-1.1,s[16,2]=0.2,s[16,3]=0.6,s[16,4]=-0.4,s[16,5]=-0.2,s[16,6]=1.0,s[16,7]=0.8,s[16,8]=-0.6,s[16,9]=-1.2,s[16,10]=-1.0,s[16,11]=0.1,s[16,12]=-0.5,s[16,13]=0.0,s[16,14]=0.1,s[16,15]=1.1 s[16,16]=1.2,s[16,17]=0.3,s[16,18]=1.1,s[16,19]=-0.7,s[16,20]=-0.6,s[16,21]=0.5,s[16,22]=-0.5,s[16,23]=-1.0,s[16,24]=0.9,s[16,25]=-1.0,s[16,26]=0.4,s[16,27]=1.2,s[16,28]=-0.2,s[16,29]=0.7,s[16,30]=0.5 s[16,31]=-1.0,s[16,32]=1.1,s[16,33]=1.1,s[16,34]=0.6,s[16,35]=0.0,s[16,36]=1.2,s[16,37]=0.1,s[16,38]=0.5,s[16,39]=0.9,s[16,40]=0.6,s[16,41]=0.5,s[16,42]=0.2,s[16,43]=0.2,s[16,44]=1.1,s[16,45]=-0.1 s[16,46]=-0.3,s[16,47]=-0.4,s[16,48]=0.9,s[16,49]=0.5,s[16,50]=0.8,s[16,51]=0.3,s[16,52]=-0.2,s[16,53]=-1.2,s[16,54]=1.1,s[16,55]=0.3,s[16,56]=0.5,s[16,57]=0.0,s[16,58]=-1.1,s[16,59]=0.2,s[16,60]=-0.5 s[17,1]=0.1,s[17,2]=0.9,s[17,3]=0.0,s[17,4]=-1.0,s[17,5]=0.2,s[17,6]=-0.7,s[17,7]=0.3,s[17,8]=1.0,s[17,9]=-0.5,s[17,10]=0.4,s[17,11]=0.4,s[17,12]=0.8,s[17,13]=-0.7,s[17,14]=-0.5,s[17,15]=-0.9 s[17,16]=0.2,s[17,17]=0.0,s[17,18]=0.1,s[17,19]=1.0,s[17,20]=0.9,s[17,21]=-0.4,s[17,22]=-0.2,s[17,23]=0.7,s[17,24]=-1.1,s[17,25]=-0.8,s[17,26]=-0.7,s[17,27]=0.3,s[17,28]=-0.7,s[17,29]=-0.7,s[17,30]=0.3 s[17,31]=1.2,s[17,32]=0.7,s[17,33]=0.6,s[17,34]=-1.2,s[17,35]=-0.1,s[17,36]=0.3,s[17,37]=0.1,s[17,38]=-0.1,s[17,39]=-0.1,s[17,40]=-1.0,s[17,41]=0.2,s[17,42]=0.4,s[17,43]=-0.8,s[17,44]=-0.1,s[17,45]=0.7 s[17,46]=-0.8,s[17,47]=-0.6,s[17,48]=-0.4,s[17,49]=-0.8,s[17,50]=0.7,s[17,51]=0.3,s[17,52]=1.1,s[17,53]=-0.5,s[17,54]=0.9,s[17,55]=0.9,s[17,56]=-1.0,s[17,57]=-0.9,s[17,58]=-1.0,s[17,59]=0.8,s[17,60]=-1.2 s[18,1]=0.0,s[18,2]=-0.7,s[18,3]=-0.1,s[18,4]=1.1,s[18,5]=-1.2,s[18,6]=0.8,s[18,7]=1.0,s[18,8]=-0.1,s[18,9]=0.2,s[18,10]=0.0,s[18,11]=-0.5,s[18,12]=-0.3,s[18,13]=0.1,s[18,14]=0.9,s[18,15]=1.2 s[18,16]=0.8,s[18,17]=0.6,s[18,18]=-1.2,s[18,19]=-0.8,s[18,20]=1.0,s[18,21]=0.4,s[18,22]=-0.6,s[18,23]=-0.7,s[18,24]=-0.2,s[18,25]=0.7,s[18,26]=0.0,s[18,27]=-0.6,s[18,28]=1.1,s[18,29]=1.2,s[18,30]=-0.6 s[18,31]=0.9,s[18,32]=1.1,s[18,33]=-0.2,s[18,34]=-1.2,s[18,35]=0.2,s[18,36]=0.5,s[18,37]=-0.2,s[18,38]=-1.1,s[18,39]=-0.5,s[18,40]=0.9,s[18,41]=0.5,s[18,42]=0.0,s[18,43]=1.0,s[18,44]=-0.7,s[18,45]=0.6 s[18,46]=-0.4,s[18,47]=0.0,s[18,48]=-0.9,s[18,49]=1.0,s[18,50]=-0.6,s[18,51]=-0.3,s[18,52]=-0.4,s[18,53]=0.0,s[18,54]=-0.9,s[18,55]=0.9,s[18,56]=0.5,s[18,57]=-0.3,s[18,58]=-1.2,s[18,59]=-0.1,s[18,60]=-1.1 s[19,1]=-1.1,s[19,2]=0.6,s[19,3]=0.6,s[19,4]=0.0,s[19,5]=-0.4,s[19,6]=-0.4,s[19,7]=-0.1,s[19,8]=-1.2,s[19,9]=-1.0,s[19,10]=1.2,s[19,11]=0.1,s[19,12]=-1.2,s[19,13]=-1.1,s[19,14]=0.6,s[19,15]=1.1 s[19,16]=1.1,s[19,17]=-0.6,s[19,18]=0.3,s[19,19]=0.4,s[19,20]=0.3,s[19,21]=1.1,s[19,22]=0.9,s[19,23]=-0.4,s[19,24]=1.1,s[19,25]=-0.3,s[19,26]=-1.1,s[19,27]=-0.9,s[19,28]=-1.2,s[19,29]=0.3,s[19,30]=0.3 s[19,31]=-1.1,s[19,32]=0.2,s[19,33]=-0.2,s[19,34]=-1.0,s[19,35]=-1.1,s[19,36]=0.9,s[19,37]=0.4,s[19,38]=-0.6,s[19,39]=1.1,s[19,40]=-0.1,s[19,41]=-0.7,s[19,42]=0.9,s[19,43]=-0.4,s[19,44]=-0.3,s[19,45]=0.7 s[19,46]=-0.8,s[19,47]=-1.2,s[19,48]=-0.1,s[19,49]=-0.3,s[19,50]=-0.6,s[19,51]=-1.1,s[19,52]=-0.2,s[19,53]=-1.2,s[19,54]=-1.1,s[19,55]=1.1,s[19,56]=-0.5,s[19,57]=0.9,s[19,58]=-0.3,s[19,59]=0.9,s[19,60]=-1.2 s[20,1]=-0.2,s[20,2]=-0.1,s[20,3]=0.6,s[20,4]=-0.1,s[20,5]=0.7,s[20,6]=0.2,s[20,7]=0.8,s[20,8]=-0.3,s[20,9]=0.7,s[20,10]=-0.9,s[20,11]=-0.1,s[20,12]=0.6,s[20,13]=-0.4,s[20,14]=-1.1,s[20,15]=0.8 s[20,16]=1.0,s[20,17]=-0.7,s[20,18]=-0.1,s[20,19]=-0.3,s[20,20]=-0.1,s[20,21]=-0.6,s[20,22]=0.1,s[20,23]=-0.5,s[20,24]=-0.4,s[20,25]=-1.2,s[20,26]=-1.2,s[20,27]=0.6,s[20,28]=-0.9,s[20,29]=0.8,s[20,30]=0.4 s[20,31]=1.1,s[20,32]=-0.9,s[20,33]=0.9,s[20,34]=-0.8,s[20,35]=0.5,s[20,36]=0.1,s[20,37]=0.3,s[20,38]=-1.2,s[20,39]=0.2,s[20,40]=-0.9,s[20,41]=-0.5,s[20,42]=-0.3,s[20,43]=1.1,s[20,44]=1.1,s[20,45]=0.8 s[20,46]=-0.4,s[20,47]=0.1,s[20,48]=-0.6,s[20,49]=0.7,s[20,50]=-0.8,s[20,51]=1.0,s[20,52]=-0.4,s[20,53]=-0.4,s[20,54]=0.9,s[20,55]=-0.1,s[20,56]=0.3,s[20,57]=-0.4,s[20,58]=-0.1,s[20,59]=-0.3,s[20,60]=-0.3 s[21,1]=-0.2,s[21,2]=-0.3,s[21,3]=-0.2,s[21,4]=0.9,s[21,5]=1.0,s[21,6]=-0.1,s[21,7]=0.0,s[21,8]=0.0,s[21,9]=0.6,s[21,10]=-1.0,s[21,11]=-1.2,s[21,12]=-0.7,s[21,13]=-0.5,s[21,14]=-0.1,s[21,15]=-0.6 s[21,16]=-0.6,s[21,17]=-0.2,s[21,18]=0.6,s[21,19]=-0.9,s[21,20]=-0.2,s[21,21]=-0.6,s[21,22]=0.7,s[21,23]=1.1,s[21,24]=-0.3,s[21,25]=0.6,s[21,26]=-1.1,s[21,27]=-0.9,s[21,28]=0.3,s[21,29]=0.2,s[21,30]=0.7 s[21,31]=0.3,s[21,32]=-1.2,s[21,33]=-0.9,s[21,34]=-0.1,s[21,35]=0.1,s[21,36]=1.2,s[21,37]=-1.2,s[21,38]=-1.1,s[21,39]=0.4,s[21,40]=0.3,s[21,41]=0.8,s[21,42]=-0.8,s[21,43]=1.1,s[21,44]=-0.4,s[21,45]=-1.2 s[21,46]=-0.5,s[21,47]=-0.3,s[21,48]=0.9,s[21,49]=0.5,s[21,50]=0.6,s[21,51]=-1.2,s[21,52]=-0.8,s[21,53]=0.4,s[21,54]=0.9,s[21,55]=0.4,s[21,56]=1.1,s[21,57]=0.2,s[21,58]=1.2,s[21,59]=0.3,s[21,60]=-1.1 s[22,1]=0.1,s[22,2]=0.7,s[22,3]=-0.9,s[22,4]=0.0,s[22,5]=0.3,s[22,6]=-0.8,s[22,7]=-1.1,s[22,8]=-0.5,s[22,9]=0.4,s[22,10]=-1.0,s[22,11]=0.2,s[22,12]=-0.3,s[22,13]=-1.0,s[22,14]=1.0,s[22,15]=-0.5 s[22,16]=-1.1,s[22,17]=0.4,s[22,18]=-0.9,s[22,19]=0.6,s[22,20]=0.5,s[22,21]=1.0,s[22,22]=-0.2,s[22,23]=-0.4,s[22,24]=0.4,s[22,25]=0.5,s[22,26]=0.1,s[22,27]=0.0,s[22,28]=-0.7,s[22,29]=-0.9,s[22,30]=-0.9 s[22,31]=-0.1,s[22,32]=0.6,s[22,33]=-0.8,s[22,34]=-0.4,s[22,35]=-1.1,s[22,36]=-1.0,s[22,37]=-1.2,s[22,38]=0.1,s[22,39]=-0.1,s[22,40]=-1.2,s[22,41]=-0.4,s[22,42]=0.8,s[22,43]=0.5,s[22,44]=0.2,s[22,45]=-1.1 s[22,46]=0.7,s[22,47]=0.2,s[22,48]=-0.7,s[22,49]=-0.2,s[22,50]=-1.2,s[22,51]=1.2,s[22,52]=0.5,s[22,53]=-0.8,s[22,54]=0.8,s[22,55]=-0.7,s[22,56]=0.7,s[22,57]=-1.2,s[22,58]=0.4,s[22,59]=1.2,s[22,60]=-1.1 s[23,1]=0.7,s[23,2]=-0.6,s[23,3]=-0.3,s[23,4]=-0.5,s[23,5]=-0.1,s[23,6]=1.2,s[23,7]=-0.2,s[23,8]=0.4,s[23,9]=0.7,s[23,10]=-1.2,s[23,11]=-0.4,s[23,12]=0.1,s[23,13]=0.0,s[23,14]=-0.5,s[23,15]=0.4 s[23,16]=-0.4,s[23,17]=-0.6,s[23,18]=-0.9,s[23,19]=1.1,s[23,20]=-1.1,s[23,21]=0.8,s[23,22]=-1.0,s[23,23]=-0.1,s[23,24]=-0.3,s[23,25]=0.9,s[23,26]=-0.4,s[23,27]=0.5,s[23,28]=-1.0,s[23,29]=1.1,s[23,30]=-0.4 s[23,31]=-0.1,s[23,32]=0.1,s[23,33]=0.2,s[23,34]=-0.2,s[23,35]=-1.2,s[23,36]=0.8,s[23,37]=-0.9,s[23,38]=0.1,s[23,39]=-0.3,s[23,40]=-0.7,s[23,41]=-0.1,s[23,42]=-1.0,s[23,43]=0.5,s[23,44]=-0.8,s[23,45]=1.1 s[23,46]=0.4,s[23,47]=-0.9,s[23,48]=-0.2,s[23,49]=-0.7,s[23,50]=1.0,s[23,51]=-1.2,s[23,52]=-0.3,s[23,53]=-0.7,s[23,54]=1.2,s[23,55]=0.5,s[23,56]=-0.1,s[23,57]=0.6,s[23,58]=-0.7,s[23,59]=0.9,s[23,60]=-1.2 s[24,1]=0.3,s[24,2]=0.9,s[24,3]=-0.9,s[24,4]=-0.7,s[24,5]=-1.1,s[24,6]=1.2,s[24,7]=-1.1,s[24,8]=1.0,s[24,9]=0.7,s[24,10]=1.2,s[24,11]=-0.7,s[24,12]=0.3,s[24,13]=1.2,s[24,14]=1.2,s[24,15]=0.3 s[24,16]=-0.1,s[24,17]=-0.6,s[24,18]=-1.2,s[24,19]=1.2,s[24,20]=1.2,s[24,21]=-0.9,s[24,22]=-0.2,s[24,23]=0.2,s[24,24]=-0.5,s[24,25]=-1.1,s[24,26]=-1.0,s[24,27]=-1.2,s[24,28]=-0.5,s[24,29]=0.2,s[24,30]=-0.2 s[24,31]=0.3,s[24,32]=-0.9,s[24,33]=0.4,s[24,34]=-0.9,s[24,35]=-0.5,s[24,36]=-1.0,s[24,37]=0.3,s[24,38]=0.6,s[24,39]=-0.5,s[24,40]=-1.0,s[24,41]=-0.8,s[24,42]=-0.1,s[24,43]=-1.0,s[24,44]=1.1,s[24,45]=-0.3 s[24,46]=-0.1,s[24,47]=0.2,s[24,48]=0.7,s[24,49]=-0.6,s[24,50]=1.0,s[24,51]=0.0,s[24,52]=-1.0,s[24,53]=0.5,s[24,54]=-0.4,s[24,55]=-0.9,s[24,56]=-0.8,s[24,57]=-0.2,s[24,58]=0.3,s[24,59]=-0.7,s[24,60]=-0.5 s[25,1]=1.2,s[25,2]=-0.9,s[25,3]=-0.5,s[25,4]=0.1,s[25,5]=0.2,s[25,6]=-0.8,s[25,7]=0.0,s[25,8]=1.2,s[25,9]=-0.5,s[25,10]=-0.1,s[25,11]=0.9,s[25,12]=-0.9,s[25,13]=-0.8,s[25,14]=0.1,s[25,15]=-0.9 s[25,16]=0.3,s[25,17]=-0.9,s[25,18]=-0.4,s[25,19]=-0.5,s[25,20]=-0.6,s[25,21]=-1.1,s[25,22]=-0.9,s[25,23]=-0.9,s[25,24]=0.9,s[25,25]=1.1,s[25,26]=0.6,s[25,27]=-0.3,s[25,28]=-0.1,s[25,29]=-1.2,s[25,30]=-1.1 s[25,31]=0.0,s[25,32]=0.1,s[25,33]=-0.7,s[25,34]=-0.7,s[25,35]=0.5,s[25,36]=-0.4,s[25,37]=1.0,s[25,38]=0.2,s[25,39]=0.7,s[25,40]=-0.5,s[25,41]=-0.4,s[25,42]=-0.1,s[25,43]=-0.1,s[25,44]=0.2,s[25,45]=0.2 s[25,46]=-0.7,s[25,47]=0.8,s[25,48]=1.1,s[25,49]=-0.1,s[25,50]=-0.6,s[25,51]=0.1,s[25,52]=0.5,s[25,53]=-0.5,s[25,54]=-0.4,s[25,55]=0.2,s[25,56]=1.0,s[25,57]=1.1,s[25,58]=0.0,s[25,59]=-0.1,s[25,60]=-1.2 s[26,1]=-0.6,s[26,2]=0.1,s[26,3]=-0.4,s[26,4]=-1.1,s[26,5]=-0.6,s[26,6]=0.1,s[26,7]=-1.0,s[26,8]=-1.0,s[26,9]=-0.6,s[26,10]=0.1,s[26,11]=-0.7,s[26,12]=0.9,s[26,13]=-0.4,s[26,14]=-0.1,s[26,15]=-1.0 s[26,16]=0.7,s[26,17]=0.9,s[26,18]=0.9,s[26,19]=0.7,s[26,20]=0.9,s[26,21]=1.2,s[26,22]=0.8,s[26,23]=0.1,s[26,24]=-1.2,s[26,25]=0.4,s[26,26]=0.8,s[26,27]=-0.8,s[26,28]=-0.2,s[26,29]=-0.7,s[26,30]=-0.8 s[26,31]=-1.2,s[26,32]=0.5,s[26,33]=0.3,s[26,34]=-0.4,s[26,35]=-0.6,s[26,36]=1.2,s[26,37]=-1.1,s[26,38]=0.1,s[26,39]=-0.6,s[26,40]=1.0,s[26,41]=-1.1,s[26,42]=-0.3,s[26,43]=0.2,s[26,44]=-0.6,s[26,45]=0.4 s[26,46]=-1.1,s[26,47]=-0.6,s[26,48]=0.9,s[26,49]=0.1,s[26,50]=-0.2,s[26,51]=-0.8,s[26,52]=-0.3,s[26,53]=-0.5,s[26,54]=0.0,s[26,55]=-1.2,s[26,56]=1.0,s[26,57]=-0.3,s[26,58]=-0.6,s[26,59]=0.3,s[26,60]=1.0 s[27,1]=0.1,s[27,2]=1.1,s[27,3]=0.1,s[27,4]=-0.9,s[27,5]=-0.4,s[27,6]=0.7,s[27,7]=0.1,s[27,8]=0.6,s[27,9]=0.9,s[27,10]=0.1,s[27,11]=0.9,s[27,12]=-0.1,s[27,13]=-0.9,s[27,14]=-0.6,s[27,15]=1.2 s[27,16]=0.1,s[27,17]=-0.6,s[27,18]=-0.5,s[27,19]=0.4,s[27,20]=-0.8,s[27,21]=-0.5,s[27,22]=0.7,s[27,23]=-0.8,s[27,24]=0.6,s[27,25]=-1.1,s[27,26]=-0.1,s[27,27]=-0.3,s[27,28]=-1.1,s[27,29]=-0.1,s[27,30]=0.3 s[27,31]=0.2,s[27,32]=-1.1,s[27,33]=-0.5,s[27,34]=1.1,s[27,35]=-0.1,s[27,36]=-0.6,s[27,37]=-0.6,s[27,38]=-1.1,s[27,39]=0.0,s[27,40]=-0.2,s[27,41]=-0.8,s[27,42]=0.1,s[27,43]=-0.6,s[27,44]=-0.4,s[27,45]=1.2 s[27,46]=0.9,s[27,47]=1.2,s[27,48]=0.3,s[27,49]=0.5,s[27,50]=0.7,s[27,51]=0.9,s[27,52]=-1.1,s[27,53]=0.1,s[27,54]=1.2,s[27,55]=-0.5,s[27,56]=-0.3,s[27,57]=-0.8,s[27,58]=0.1,s[27,59]=-1.2,s[27,60]=-0.7 s[28,1]=0.4,s[28,2]=-0.8,s[28,3]=-0.4,s[28,4]=0.1,s[28,5]=-0.2,s[28,6]=0.2,s[28,7]=1.0,s[28,8]=-0.5,s[28,9]=1.0,s[28,10]=0.5,s[28,11]=-0.7,s[28,12]=-0.5,s[28,13]=-0.8,s[28,14]=0.1,s[28,15]=0.7 s[28,16]=-0.8,s[28,17]=1.1,s[28,18]=1.0,s[28,19]=0.3,s[28,20]=0.0,s[28,21]=1.2,s[28,22]=-0.5,s[28,23]=-1.1,s[28,24]=-0.2,s[28,25]=0.2,s[28,26]=-0.8,s[28,27]=0.4,s[28,28]=-0.7,s[28,29]=0.7,s[28,30]=-1.1 s[28,31]=-1.1,s[28,32]=1.1,s[28,33]=-1.2,s[28,34]=-1.1,s[28,35]=-0.7,s[28,36]=0.6,s[28,37]=-1.2,s[28,38]=0.5,s[28,39]=0.9,s[28,40]=-1.0,s[28,41]=-0.4,s[28,42]=0.2,s[28,43]=-0.9,s[28,44]=0.5,s[28,45]=-1.2 s[28,46]=-0.2,s[28,47]=-0.4,s[28,48]=-0.8,s[28,49]=0.4,s[28,50]=-0.6,s[28,51]=0.0,s[28,52]=0.7,s[28,53]=-0.7,s[28,54]=1.2,s[28,55]=-0.1,s[28,56]=-0.7,s[28,57]=-1.1,s[28,58]=-0.3,s[28,59]=0.9,s[28,60]=-1.1 s[29,1]=-0.4,s[29,2]=-0.9,s[29,3]=-0.1,s[29,4]=0.0,s[29,5]=-0.9,s[29,6]=-0.2,s[29,7]=-0.3,s[29,8]=-0.4,s[29,9]=-0.3,s[29,10]=-0.9,s[29,11]=0.9,s[29,12]=-1.0,s[29,13]=0.8,s[29,14]=0.5,s[29,15]=-0.2 s[29,16]=0.4,s[29,17]=-0.9,s[29,18]=-0.1,s[29,19]=-1.2,s[29,20]=-0.8,s[29,21]=0.1,s[29,22]=0.5,s[29,23]=0.6,s[29,24]=0.6,s[29,25]=1.0,s[29,26]=-0.2,s[29,27]=-0.2,s[29,28]=0.1,s[29,29]=0.3,s[29,30]=-0.3 s[29,31]=-0.7,s[29,32]=-1.0,s[29,33]=-0.2,s[29,34]=-0.5,s[29,35]=-0.6,s[29,36]=0.7,s[29,37]=-1.1,s[29,38]=1.2,s[29,39]=-0.6,s[29,40]=0.4,s[29,41]=0.5,s[29,42]=-0.5,s[29,43]=-0.8,s[29,44]=0.4,s[29,45]=1.1 s[29,46]=0.1,s[29,47]=-0.3,s[29,48]=-0.2,s[29,49]=0.0,s[29,50]=-0.8,s[29,51]=-1.2,s[29,52]=0.1,s[29,53]=-0.4,s[29,54]=-1.2,s[29,55]=-1.1,s[29,56]=0.0,s[29,57]=-0.8,s[29,58]=-0.3,s[29,59]=-0.5,s[29,60]=-1.2 s[30,1]=0.3,s[30,2]=-0.8,s[30,3]=-0.8,s[30,4]=-1.0,s[30,5]=0.9,s[30,6]=1.2,s[30,7]=-1.0,s[30,8]=-0.3,s[30,9]=-1.0,s[30,10]=-0.8,s[30,11]=-1.0,s[30,12]=0.6,s[30,13]=0.8,s[30,14]=0.6,s[30,15]=0.8 s[30,16]=-0.4,s[30,17]=0.2,s[30,18]=0.7,s[30,19]=-1.1,s[30,20]=0.0,s[30,21]=-1.1,s[30,22]=-0.2,s[30,23]=0.1,s[30,24]=1.0,s[30,25]=-0.8,s[30,26]=-0.5,s[30,27]=1.0,s[30,28]=-0.5,s[30,29]=0.0,s[30,30]=-0.5 s[30,31]=0.2,s[30,32]=0.4,s[30,33]=-0.3,s[30,34]=-0.2,s[30,35]=-1.2,s[30,36]=1.2,s[30,37]=-1.0,s[30,38]=0.2,s[30,39]=1.0,s[30,40]=0.4,s[30,41]=0.0,s[30,42]=-0.7,s[30,43]=1.1,s[30,44]=-0.8,s[30,45]=0.2 s[30,46]=-0.8,s[30,47]=-1.2,s[30,48]=1.0,s[30,49]=0.9,s[30,50]=0.9,s[30,51]=0.7,s[30,52]=0.8,s[30,53]=0.9,s[30,54]=-1.2,s[30,55]=0.6,s[30,56]=-1.0,s[30,57]=0.5,s[30,58]=-1.1,s[30,59]=-0.5,s[30,60]=-0.8 s[31,1]=-0.3,s[31,2]=-0.2,s[31,3]=0.8,s[31,4]=-1.1,s[31,5]=-0.8,s[31,6]=0.0,s[31,7]=-1.0,s[31,8]=-0.9,s[31,9]=-1.0,s[31,10]=0.4,s[31,11]=-0.6,s[31,12]=-0.9,s[31,13]=-0.9,s[31,14]=0.0,s[31,15]=0.0 s[31,16]=-0.3,s[31,17]=0.6,s[31,18]=0.2,s[31,19]=0.1,s[31,20]=1.1,s[31,21]=1.1,s[31,22]=-1.0,s[31,23]=0.6,s[31,24]=1.2,s[31,25]=0.8,s[31,26]=1.2,s[31,27]=0.6,s[31,28]=0.4,s[31,29]=0.9,s[31,30]=0.1 s[31,31]=-1.0,s[31,32]=-1.0,s[31,33]=-0.4,s[31,34]=0.1,s[31,35]=0.2,s[31,36]=0.9,s[31,37]=0.4,s[31,38]=-0.8,s[31,39]=-0.8,s[31,40]=-0.3,s[31,41]=0.9,s[31,42]=-0.3,s[31,43]=-0.5,s[31,44]=0.0,s[31,45]=0.6 s[31,46]=0.1,s[31,47]=-1.0,s[31,48]=0.3,s[31,49]=-1.2,s[31,50]=-1.1,s[31,51]=-0.8,s[31,52]=0.3,s[31,53]=0.0,s[31,54]=0.8,s[31,55]=-0.9,s[31,56]=-0.6,s[31,57]=-0.1,s[31,58]=0.4,s[31,59]=0.9,s[31,60]=-0.7 s[32,1]=-0.2,s[32,2]=-0.5,s[32,3]=-0.7,s[32,4]=-0.6,s[32,5]=0.9,s[32,6]=0.0,s[32,7]=-0.2,s[32,8]=1.1,s[32,9]=1.0,s[32,10]=-0.5,s[32,11]=-1.2,s[32,12]=0.8,s[32,13]=-0.1,s[32,14]=-1.2,s[32,15]=-0.1 s[32,16]=0.2,s[32,17]=-1.0,s[32,18]=-0.6,s[32,19]=-0.9,s[32,20]=0.7,s[32,21]=-0.6,s[32,22]=0.8,s[32,23]=-0.6,s[32,24]=-0.5,s[32,25]=-1.0,s[32,26]=-1.0,s[32,27]=1.1,s[32,28]=1.0,s[32,29]=-0.6,s[32,30]=0.0 s[32,31]=-0.2,s[32,32]=1.0,s[32,33]=0.3,s[32,34]=-1.2,s[32,35]=0.1,s[32,36]=0.2,s[32,37]=-1.2,s[32,38]=1.1,s[32,39]=-1.1,s[32,40]=0.6,s[32,41]=-0.6,s[32,42]=0.4,s[32,43]=-0.3,s[32,44]=-1.2,s[32,45]=0.1 s[32,46]=-1.0,s[32,47]=0.5,s[32,48]=-0.5,s[32,49]=0.8,s[32,50]=0.0,s[32,51]=-1.1,s[32,52]=-0.7,s[32,53]=-0.7,s[32,54]=-0.8,s[32,55]=0.6,s[32,56]=0.1,s[32,57]=-0.9,s[32,58]=-0.6,s[32,59]=-0.7,s[32,60]=0.2 s[33,1]=0.9,s[33,2]=-0.2,s[33,3]=-1.1,s[33,4]=0.2,s[33,5]=0.6,s[33,6]=0.8,s[33,7]=0.0,s[33,8]=1.0,s[33,9]=0.2,s[33,10]=-0.5,s[33,11]=-0.1,s[33,12]=-0.7,s[33,13]=-0.4,s[33,14]=0.6,s[33,15]=-0.6 s[33,16]=0.4,s[33,17]=-0.6,s[33,18]=0.0,s[33,19]=1.1,s[33,20]=-0.9,s[33,21]=-0.7,s[33,22]=-0.8,s[33,23]=0.3,s[33,24]=-0.2,s[33,25]=1.0,s[33,26]=-0.6,s[33,27]=-0.2,s[33,28]=1.0,s[33,29]=-0.5,s[33,30]=0.6 s[33,31]=0.6,s[33,32]=-0.1,s[33,33]=-0.7,s[33,34]=-0.2,s[33,35]=1.1,s[33,36]=1.1,s[33,37]=0.4,s[33,38]=-0.9,s[33,39]=0.1,s[33,40]=1.2,s[33,41]=1.0,s[33,42]=-1.1,s[33,43]=0.0,s[33,44]=0.0,s[33,45]=-1.0 s[33,46]=-1.1,s[33,47]=0.7,s[33,48]=-0.7,s[33,49]=1.0,s[33,50]=-1.0,s[33,51]=-0.2,s[33,52]=-1.0,s[33,53]=-0.7,s[33,54]=-0.7,s[33,55]=0.9,s[33,56]=-0.9,s[33,57]=0.0,s[33,58]=0.2,s[33,59]=0.6,s[33,60]=-1.1 s[34,1]=0.3,s[34,2]=-0.5,s[34,3]=1.1,s[34,4]=0.2,s[34,5]=-1.1,s[34,6]=-0.1,s[34,7]=1.0,s[34,8]=0.7,s[34,9]=-0.4,s[34,10]=-1.0,s[34,11]=0.6,s[34,12]=-0.6,s[34,13]=0.2,s[34,14]=-1.0,s[34,15]=0.1 s[34,16]=-0.5,s[34,17]=-0.7,s[34,18]=-0.6,s[34,19]=0.5,s[34,20]=-0.7,s[34,21]=0.6,s[34,22]=0.3,s[34,23]=1.0,s[34,24]=0.8,s[34,25]=-0.5,s[34,26]=-0.8,s[34,27]=-1.2,s[34,28]=1.1,s[34,29]=0.7,s[34,30]=0.5 s[34,31]=0.7,s[34,32]=0.3,s[34,33]=-0.7,s[34,34]=-0.5,s[34,35]=1.0,s[34,36]=-1.2,s[34,37]=-0.2,s[34,38]=0.0,s[34,39]=-0.5,s[34,40]=1.0,s[34,41]=0.3,s[34,42]=-0.1,s[34,43]=-0.1,s[34,44]=-0.7,s[34,45]=0.0 s[34,46]=-1.0,s[34,47]=0.1,s[34,48]=0.3,s[34,49]=-1.1,s[34,50]=1.0,s[34,51]=0.5,s[34,52]=-0.5,s[34,53]=-0.5,s[34,54]=-0.4,s[34,55]=-0.9,s[34,56]=-0.8,s[34,57]=0.6,s[34,58]=0.2,s[34,59]=-0.8,s[34,60]=-0.6 s[35,1]=1.1,s[35,2]=-0.5,s[35,3]=-0.2,s[35,4]=-0.8,s[35,5]=0.6,s[35,6]=-1.2,s[35,7]=1.2,s[35,8]=-0.7,s[35,9]=-0.9,s[35,10]=-0.1,s[35,11]=0.5,s[35,12]=-0.5,s[35,13]=-0.5,s[35,14]=-0.1,s[35,15]=-0.6 s[35,16]=-0.9,s[35,17]=-0.1,s[35,18]=0.2,s[35,19]=-0.8,s[35,20]=-0.7,s[35,21]=0.5,s[35,22]=0.6,s[35,23]=-0.2,s[35,24]=0.0,s[35,25]=-0.8,s[35,26]=-0.8,s[35,27]=0.7,s[35,28]=0.7,s[35,29]=0.5,s[35,30]=-0.1 s[35,31]=-1.1,s[35,32]=-0.8,s[35,33]=-0.4,s[35,34]=0.0,s[35,35]=-0.8,s[35,36]=-1.1,s[35,37]=0.1,s[35,38]=-0.1,s[35,39]=-0.5,s[35,40]=-0.4,s[35,41]=-0.9,s[35,42]=0.4,s[35,43]=0.6,s[35,44]=1.2,s[35,45]=1.1 s[35,46]=0.8,s[35,47]=-1.1,s[35,48]=0.3,s[35,49]=-1.0,s[35,50]=0.7,s[35,51]=0.2,s[35,52]=-0.2,s[35,53]=-1.1,s[35,54]=1.0,s[35,55]=-1.0,s[35,56]=0.3,s[35,57]=-0.4,s[35,58]=-0.5,s[35,59]=0.1,s[35,60]=0.2 s[36,1]=-0.7,s[36,2]=1.0,s[36,3]=0.7,s[36,4]=0.0,s[36,5]=0.7,s[36,6]=-0.4,s[36,7]=0.8,s[36,8]=0.9,s[36,9]=-0.8,s[36,10]=-1.1,s[36,11]=1.0,s[36,12]=0.3,s[36,13]=0.2,s[36,14]=-0.3,s[36,15]=0.8 s[36,16]=-1.2,s[36,17]=-0.1,s[36,18]=1.0,s[36,19]=-0.7,s[36,20]=0.9,s[36,21]=0.1,s[36,22]=0.8,s[36,23]=0.1,s[36,24]=0.1,s[36,25]=-1.2,s[36,26]=-0.5,s[36,27]=0.8,s[36,28]=-0.6,s[36,29]=1.0,s[36,30]=-1.0 s[36,31]=0.2,s[36,32]=1.1,s[36,33]=-0.5,s[36,34]=0.3,s[36,35]=-1.2,s[36,36]=0.9,s[36,37]=0.3,s[36,38]=-1.1,s[36,39]=0.4,s[36,40]=-1.2,s[36,41]=-0.2,s[36,42]=-0.2,s[36,43]=-0.2,s[36,44]=-0.1,s[36,45]=0.9 s[36,46]=0.7,s[36,47]=-0.5,s[36,48]=0.2,s[36,49]=0.8,s[36,50]=0.3,s[36,51]=-1.2,s[36,52]=0.3,s[36,53]=-0.3,s[36,54]=-0.9,s[36,55]=-0.4,s[36,56]=-0.9,s[36,57]=0.0,s[36,58]=-0.7,s[36,59]=0.0,s[36,60]=-1.2 s[37,1]=-1.0,s[37,2]=0.7,s[37,3]=-0.8,s[37,4]=-0.5,s[37,5]=1.0,s[37,6]=-1.0,s[37,7]=0.8,s[37,8]=0.6,s[37,9]=0.3,s[37,10]=0.0,s[37,11]=0.9,s[37,12]=0.5,s[37,13]=0.0,s[37,14]=0.6,s[37,15]=1.2 s[37,16]=-0.6,s[37,17]=0.6,s[37,18]=-1.0,s[37,19]=0.8,s[37,20]=-0.9,s[37,21]=-1.0,s[37,22]=1.2,s[37,23]=-0.8,s[37,24]=-0.1,s[37,25]=0.4,s[37,26]=-1.0,s[37,27]=0.1,s[37,28]=-0.7,s[37,29]=-0.5,s[37,30]=-0.8 s[37,31]=0.8,s[37,32]=0.4,s[37,33]=-0.4,s[37,34]=-0.6,s[37,35]=-0.9,s[37,36]=1.2,s[37,37]=-0.1,s[37,38]=-0.5,s[37,39]=-0.4,s[37,40]=0.6,s[37,41]=-1.2,s[37,42]=-0.6,s[37,43]=0.1,s[37,44]=0.1,s[37,45]=0.8 s[37,46]=-1.1,s[37,47]=0.4,s[37,48]=0.2,s[37,49]=-0.2,s[37,50]=0.9,s[37,51]=-0.3,s[37,52]=0.0,s[37,53]=0.6,s[37,54]=0.7,s[37,55]=-1.1,s[37,56]=0.1,s[37,57]=0.0,s[37,58]=0.2,s[37,59]=-0.6,s[37,60]=0.4 s[38,1]=0.3,s[38,2]=0.0,s[38,3]=-0.4,s[38,4]=-0.6,s[38,5]=1.1,s[38,6]=0.4,s[38,7]=1.2,s[38,8]=0.1,s[38,9]=-0.6,s[38,10]=0.5,s[38,11]=-0.8,s[38,12]=-0.9,s[38,13]=0.2,s[38,14]=-0.7,s[38,15]=-0.7 s[38,16]=0.2,s[38,17]=0.0,s[38,18]=1.0,s[38,19]=1.0,s[38,20]=1.2,s[38,21]=0.8,s[38,22]=0.4,s[38,23]=-1.0,s[38,24]=-0.1,s[38,25]=-0.2,s[38,26]=0.6,s[38,27]=0.5,s[38,28]=0.2,s[38,29]=-0.8,s[38,30]=1.0 s[38,31]=-0.5,s[38,32]=1.1,s[38,33]=-0.9,s[38,34]=-0.2,s[38,35]=0.4,s[38,36]=0.0,s[38,37]=-0.3,s[38,38]=-0.6,s[38,39]=-0.8,s[38,40]=-1.2,s[38,41]=-0.2,s[38,42]=-0.7,s[38,43]=-0.6,s[38,44]=-0.2,s[38,45]=-0.7 s[38,46]=0.0,s[38,47]=-1.2,s[38,48]=-0.4,s[38,49]=-0.2,s[38,50]=0.6,s[38,51]=0.1,s[38,52]=0.8,s[38,53]=-0.3,s[38,54]=0.4,s[38,55]=-0.7,s[38,56]=-1.0,s[38,57]=-0.5,s[38,58]=0.8,s[38,59]=-0.8,s[38,60]=-0.2 s[39,1]=-0.6,s[39,2]=0.8,s[39,3]=-0.9,s[39,4]=0.1,s[39,5]=0.0,s[39,6]=0.8,s[39,7]=0.3,s[39,8]=-0.8,s[39,9]=0.2,s[39,10]=0.7,s[39,11]=0.0,s[39,12]=0.7,s[39,13]=1.2,s[39,14]=-1.1,s[39,15]=0.4 s[39,16]=0.9,s[39,17]=-1.0,s[39,18]=1.2,s[39,19]=-0.5,s[39,20]=-0.8,s[39,21]=0.1,s[39,22]=-1.1,s[39,23]=0.6,s[39,24]=0.8,s[39,25]=-0.6,s[39,26]=-0.6,s[39,27]=1.0,s[39,28]=-0.6,s[39,29]=0.8,s[39,30]=0.2 s[39,31]=0.9,s[39,32]=-0.9,s[39,33]=0.5,s[39,34]=-1.2,s[39,35]=1.1,s[39,36]=0.1,s[39,37]=1.2,s[39,38]=1.2,s[39,39]=-0.5,s[39,40]=0.7,s[39,41]=1.0,s[39,42]=0.9,s[39,43]=-0.4,s[39,44]=-0.6,s[39,45]=0.5 s[39,46]=0.4,s[39,47]=-0.8,s[39,48]=0.5,s[39,49]=-0.8,s[39,50]=-0.2,s[39,51]=1.1,s[39,52]=1.1,s[39,53]=-0.8,s[39,54]=-1.2,s[39,55]=-0.5,s[39,56]=-0.4,s[39,57]=0.1,s[39,58]=0.8,s[39,59]=-0.9,s[39,60]=0.1 s[40,1]=0.0,s[40,2]=0.8,s[40,3]=0.3,s[40,4]=-0.7,s[40,5]=0.3,s[40,6]=0.0,s[40,7]=-1.2,s[40,8]=0.3,s[40,9]=-0.8,s[40,10]=-0.2,s[40,11]=0.4,s[40,12]=-0.6,s[40,13]=-0.9,s[40,14]=-0.2,s[40,15]=-0.9 s[40,16]=-0.4,s[40,17]=-0.4,s[40,18]=-0.9,s[40,19]=0.1,s[40,20]=-1.2,s[40,21]=1.2,s[40,22]=-0.3,s[40,23]=-0.4,s[40,24]=-0.1,s[40,25]=-0.9,s[40,26]=-1.0,s[40,27]=0.8,s[40,28]=0.8,s[40,29]=-0.6,s[40,30]=-0.9 s[40,31]=0.9,s[40,32]=-1.1,s[40,33]=-0.5,s[40,34]=-0.3,s[40,35]=-0.9,s[40,36]=0.6,s[40,37]=0.9,s[40,38]=0.9,s[40,39]=-0.9,s[40,40]=1.2,s[40,41]=-0.9,s[40,42]=-1.2,s[40,43]=0.5,s[40,44]=-0.1,s[40,45]=0.9 s[40,46]=-1.0,s[40,47]=1.2,s[40,48]=-0.7,s[40,49]=-0.9,s[40,50]=1.1,s[40,51]=0.1,s[40,52]=-0.6,s[40,53]=0.9,s[40,54]=0.7,s[40,55]=0.0,s[40,56]=-0.2,s[40,57]=-1.0,s[40,58]=0.6,s[40,59]=1.1,s[40,60]=-0.7 s[41,1]=-0.6,s[41,2]=-0.9,s[41,3]=-0.9,s[41,4]=-0.3,s[41,5]=-0.6,s[41,6]=-0.4,s[41,7]=0.8,s[41,8]=0.4,s[41,9]=0.8,s[41,10]=-0.7,s[41,11]=-0.4,s[41,12]=-0.4,s[41,13]=-0.1,s[41,14]=0.6,s[41,15]=0.3 s[41,16]=0.2,s[41,17]=-1.0,s[41,18]=0.7,s[41,19]=-1.1,s[41,20]=0.8,s[41,21]=-0.1,s[41,22]=-0.1,s[41,23]=-0.8,s[41,24]=-0.4,s[41,25]=0.7,s[41,26]=-1.1,s[41,27]=0.6,s[41,28]=-0.3,s[41,29]=0.1,s[41,30]=0.3 s[41,31]=1.2,s[41,32]=-0.4,s[41,33]=0.6,s[41,34]=-1.2,s[41,35]=-0.2,s[41,36]=0.4,s[41,37]=-0.7,s[41,38]=0.6,s[41,39]=0.7,s[41,40]=0.8,s[41,41]=0.7,s[41,42]=-0.6,s[41,43]=-0.2,s[41,44]=0.1,s[41,45]=-0.3 s[41,46]=0.4,s[41,47]=1.2,s[41,48]=-1.1,s[41,49]=-0.1,s[41,50]=-0.7,s[41,51]=0.4,s[41,52]=-0.3,s[41,53]=-0.2,s[41,54]=-0.2,s[41,55]=-0.7,s[41,56]=-1.1,s[41,57]=0.2,s[41,58]=0.5,s[41,59]=0.5,s[41,60]=-0.2 s[42,1]=0.1,s[42,2]=-0.2,s[42,3]=-0.2,s[42,4]=-0.6,s[42,5]=0.6,s[42,6]=-1.0,s[42,7]=1.0,s[42,8]=0.7,s[42,9]=-1.1,s[42,10]=-1.2,s[42,11]=-0.3,s[42,12]=-1.1,s[42,13]=-0.7,s[42,14]=0.3,s[42,15]=-0.1 s[42,16]=-0.5,s[42,17]=-1.2,s[42,18]=0.6,s[42,19]=0.9,s[42,20]=-0.5,s[42,21]=0.3,s[42,22]=-1.1,s[42,23]=-0.9,s[42,24]=-0.1,s[42,25]=-0.1,s[42,26]=0.9,s[42,27]=0.7,s[42,28]=0.4,s[42,29]=-0.4,s[42,30]=-0.3 s[42,31]=-0.9,s[42,32]=1.1,s[42,33]=0.3,s[42,34]=-0.1,s[42,35]=-1.0,s[42,36]=0.7,s[42,37]=-0.5,s[42,38]=1.2,s[42,39]=-0.6,s[42,40]=1.2,s[42,41]=-1.0,s[42,42]=-0.8,s[42,43]=-0.9,s[42,44]=0.1,s[42,45]=-0.3 s[42,46]=-0.4,s[42,47]=1.1,s[42,48]=0.6,s[42,49]=-1.2,s[42,50]=-0.3,s[42,51]=0.0,s[42,52]=-0.2,s[42,53]=0.1,s[42,54]=-0.9,s[42,55]=0.5,s[42,56]=0.1,s[42,57]=0.0,s[42,58]=-1.1,s[42,59]=-0.1,s[42,60]=-1.2 s[43,1]=1.0,s[43,2]=-0.9,s[43,3]=-0.9,s[43,4]=0.5,s[43,5]=-0.8,s[43,6]=-1.1,s[43,7]=-1.1,s[43,8]=-1.2,s[43,9]=0.9,s[43,10]=1.2,s[43,11]=1.0,s[43,12]=-0.9,s[43,13]=-1.1,s[43,14]=-0.9,s[43,15]=0.1 s[43,16]=0.5,s[43,17]=0.2,s[43,18]=-0.6,s[43,19]=0.6,s[43,20]=-1.1,s[43,21]=-0.1,s[43,22]=0.0,s[43,23]=-1.0,s[43,24]=-0.7,s[43,25]=1.1,s[43,26]=-0.6,s[43,27]=0.1,s[43,28]=0.9,s[43,29]=1.1,s[43,30]=0.9 s[43,31]=1.1,s[43,32]=0.4,s[43,33]=1.1,s[43,34]=-0.1,s[43,35]=-0.7,s[43,36]=-0.4,s[43,37]=-0.6,s[43,38]=0.1,s[43,39]=0.6,s[43,40]=-0.6,s[43,41]=-0.2,s[43,42]=0.1,s[43,43]=-0.8,s[43,44]=0.3,s[43,45]=1.2 s[43,46]=0.6,s[43,47]=-1.0,s[43,48]=1.1,s[43,49]=0.3,s[43,50]=-0.7,s[43,51]=0.0,s[43,52]=-0.1,s[43,53]=1.2,s[43,54]=-0.2,s[43,55]=-1.0,s[43,56]=-0.2,s[43,57]=0.1,s[43,58]=0.9,s[43,59]=-1.2,s[43,60]=0.1 s[44,1]=1.0,s[44,2]=-1.0,s[44,3]=0.9,s[44,4]=-1.2,s[44,5]=0.5,s[44,6]=0.3,s[44,7]=-0.1,s[44,8]=-0.1,s[44,9]=-0.8,s[44,10]=1.0,s[44,11]=-0.3,s[44,12]=1.0,s[44,13]=-0.2,s[44,14]=1.1,s[44,15]=-0.7 s[44,16]=-0.8,s[44,17]=-0.6,s[44,18]=-1.0,s[44,19]=0.1,s[44,20]=0.1,s[44,21]=0.3,s[44,22]=1.2,s[44,23]=0.9,s[44,24]=0.5,s[44,25]=0.2,s[44,26]=0.8,s[44,27]=-0.5,s[44,28]=-0.6,s[44,29]=-0.3,s[44,30]=-0.3 s[44,31]=-0.1,s[44,32]=0.7,s[44,33]=0.7,s[44,34]=-0.3,s[44,35]=0.3,s[44,36]=-1.1,s[44,37]=-1.1,s[44,38]=-0.1,s[44,39]=-1.1,s[44,40]=-0.9,s[44,41]=-1.1,s[44,42]=-0.5,s[44,43]=1.0,s[44,44]=0.5,s[44,45]=0.0 s[44,46]=-0.5,s[44,47]=-0.5,s[44,48]=0.6,s[44,49]=-0.8,s[44,50]=-0.3,s[44,51]=1.1,s[44,52]=-0.5,s[44,53]=-0.5,s[44,54]=0.4,s[44,55]=-1.2,s[44,56]=0.1,s[44,57]=0.4,s[44,58]=0.0,s[44,59]=-1.1,s[44,60]=-1.2 s[45,1]=-1.0,s[45,2]=0.5,s[45,3]=1.2,s[45,4]=-0.6,s[45,5]=-0.1,s[45,6]=-0.4,s[45,7]=0.8,s[45,8]=-0.8,s[45,9]=0.6,s[45,10]=-0.2,s[45,11]=0.2,s[45,12]=0.1,s[45,13]=0.2,s[45,14]=0.5,s[45,15]=0.6 s[45,16]=1.1,s[45,17]=0.4,s[45,18]=-0.4,s[45,19]=-0.1,s[45,20]=0.2,s[45,21]=0.8,s[45,22]=0.0,s[45,23]=-0.9,s[45,24]=-0.6,s[45,25]=0.1,s[45,26]=0.1,s[45,27]=-1.0,s[45,28]=1.0,s[45,29]=-0.4,s[45,30]=0.1 s[45,31]=0.0,s[45,32]=-0.4,s[45,33]=1.1,s[45,34]=-1.2,s[45,35]=0.6,s[45,36]=-0.8,s[45,37]=-0.1,s[45,38]=0.5,s[45,39]=1.2,s[45,40]=0.9,s[45,41]=0.9,s[45,42]=0.7,s[45,43]=0.5,s[45,44]=0.2,s[45,45]=-0.3 s[45,46]=0.2,s[45,47]=-1.2,s[45,48]=-1.1,s[45,49]=-0.2,s[45,50]=0.6,s[45,51]=-1.2,s[45,52]=-0.7,s[45,53]=-1.2,s[45,54]=0.4,s[45,55]=0.1,s[45,56]=-0.6,s[45,57]=0.8,s[45,58]=0.4,s[45,59]=1.0,s[45,60]=-0.7 s[46,1]=-0.4,s[46,2]=0.4,s[46,3]=0.6,s[46,4]=-0.6,s[46,5]=-0.4,s[46,6]=-1.1,s[46,7]=-0.2,s[46,8]=-0.9,s[46,9]=0.0,s[46,10]=0.3,s[46,11]=-0.1,s[46,12]=0.8,s[46,13]=-0.9,s[46,14]=0.5,s[46,15]=-0.7 s[46,16]=0.7,s[46,17]=-0.5,s[46,18]=-1.2,s[46,19]=-0.1,s[46,20]=1.1,s[46,21]=-1.2,s[46,22]=-0.6,s[46,23]=1.1,s[46,24]=0.4,s[46,25]=-0.7,s[46,26]=0.4,s[46,27]=1.2,s[46,28]=-1.1,s[46,29]=-0.2,s[46,30]=-0.8 s[46,31]=-0.3,s[46,32]=-0.6,s[46,33]=0.0,s[46,34]=-0.7,s[46,35]=-0.6,s[46,36]=-0.8,s[46,37]=-1.2,s[46,38]=-0.7,s[46,39]=0.2,s[46,40]=0.4,s[46,41]=-0.3,s[46,42]=1.2,s[46,43]=-0.9,s[46,44]=-0.8,s[46,45]=1.0 s[46,46]=-0.6,s[46,47]=-0.1,s[46,48]=-0.9,s[46,49]=0.0,s[46,50]=0.2,s[46,51]=0.5,s[46,52]=-0.8,s[46,53]=-0.7,s[46,54]=0.2,s[46,55]=-0.6,s[46,56]=0.5,s[46,57]=0.3,s[46,58]=-0.3,s[46,59]=-0.2,s[46,60]=-0.1 s[47,1]=0.4,s[47,2]=-0.5,s[47,3]=0.4,s[47,4]=-0.1,s[47,5]=0.8,s[47,6]=-0.1,s[47,7]=-1.1,s[47,8]=0.2,s[47,9]=0.8,s[47,10]=1.1,s[47,11]=-0.1,s[47,12]=-1.2,s[47,13]=0.2,s[47,14]=1.1,s[47,15]=-0.5 s[47,16]=-0.1,s[47,17]=-1.0,s[47,18]=-0.1,s[47,19]=0.3,s[47,20]=0.1,s[47,21]=1.0,s[47,22]=-0.2,s[47,23]=1.1,s[47,24]=0.9,s[47,25]=-0.6,s[47,26]=0.8,s[47,27]=-0.6,s[47,28]=-1.2,s[47,29]=0.3,s[47,30]=0.0 s[47,31]=1.1,s[47,32]=0.2,s[47,33]=1.0,s[47,34]=0.0,s[47,35]=0.6,s[47,36]=0.8,s[47,37]=-0.3,s[47,38]=-0.8,s[47,39]=0.6,s[47,40]=0.1,s[47,41]=-0.7,s[47,42]=-1.0,s[47,43]=-0.5,s[47,44]=-0.5,s[47,45]=-0.3 s[47,46]=-0.5,s[47,47]=-0.6,s[47,48]=0.9,s[47,49]=1.2,s[47,50]=-0.2,s[47,51]=0.0,s[47,52]=-0.1,s[47,53]=-1.1,s[47,54]=0.6,s[47,55]=-0.9,s[47,56]=1.1,s[47,57]=-1.1,s[47,58]=-0.1,s[47,59]=-0.4,s[47,60]=-0.3 s[48,1]=1.2,s[48,2]=-1.2,s[48,3]=-0.7,s[48,4]=-1.0,s[48,5]=-0.1,s[48,6]=0.2,s[48,7]=0.6,s[48,8]=1.2,s[48,9]=1.0,s[48,10]=-0.5,s[48,11]=0.1,s[48,12]=0.6,s[48,13]=0.3,s[48,14]=0.3,s[48,15]=-0.3 s[48,16]=1.0,s[48,17]=0.0,s[48,18]=-1.2,s[48,19]=-0.4,s[48,20]=0.7,s[48,21]=-0.7,s[48,22]=-0.7,s[48,23]=0.4,s[48,24]=0.4,s[48,25]=-0.3,s[48,26]=-1.2,s[48,27]=-0.6,s[48,28]=-0.5,s[48,29]=1.1,s[48,30]=0.5 s[48,31]=-0.1,s[48,32]=-0.8,s[48,33]=-1.2,s[48,34]=-0.5,s[48,35]=0.2,s[48,36]=0.2,s[48,37]=-0.4,s[48,38]=-0.4,s[48,39]=-1.2,s[48,40]=-0.1,s[48,41]=0.3,s[48,42]=0.1,s[48,43]=0.3,s[48,44]=-0.2,s[48,45]=1.0 s[48,46]=-0.6,s[48,47]=0.6,s[48,48]=0.6,s[48,49]=1.2,s[48,50]=-1.2,s[48,51]=-1.1,s[48,52]=-0.7,s[48,53]=-0.4,s[48,54]=-0.1,s[48,55]=-0.7,s[48,56]=-0.9,s[48,57]=0.3,s[48,58]=0.9,s[48,59]=0.6,s[48,60]=-0.5 s[49,1]=-0.2,s[49,2]=-0.3,s[49,3]=0.2,s[49,4]=-0.3,s[49,5]=-0.8,s[49,6]=-0.9,s[49,7]=-0.5,s[49,8]=-0.4,s[49,9]=-1.1,s[49,10]=0.9,s[49,11]=0.3,s[49,12]=-0.3,s[49,13]=-0.7,s[49,14]=-0.5,s[49,15]=0.6 s[49,16]=0.1,s[49,17]=-0.3,s[49,18]=0.0,s[49,19]=-0.5,s[49,20]=0.7,s[49,21]=0.0,s[49,22]=0.6,s[49,23]=-0.7,s[49,24]=1.2,s[49,25]=-1.1,s[49,26]=-0.8,s[49,27]=0.7,s[49,28]=0.9,s[49,29]=-1.2,s[49,30]=-0.2 s[49,31]=0.9,s[49,32]=0.3,s[49,33]=-1.2,s[49,34]=-1.1,s[49,35]=0.7,s[49,36]=1.0,s[49,37]=-1.2,s[49,38]=-1.1,s[49,39]=1.2,s[49,40]=0.0,s[49,41]=-0.9,s[49,42]=0.8,s[49,43]=-0.3,s[49,44]=-1.1,s[49,45]=-0.7 s[49,46]=-0.9,s[49,47]=1.2,s[49,48]=0.4,s[49,49]=0.2,s[49,50]=-1.2,s[49,51]=1.1,s[49,52]=-1.1,s[49,53]=-0.3,s[49,54]=-0.5,s[49,55]=-0.6,s[49,56]=0.2,s[49,57]=-0.5,s[49,58]=-0.6,s[49,59]=-0.8,s[49,60]=-0.2 s[50,1]=0.5,s[50,2]=-0.2,s[50,3]=-0.5,s[50,4]=-0.8,s[50,5]=1.2,s[50,6]=-0.4,s[50,7]=-0.6,s[50,8]=-0.8,s[50,9]=-0.8,s[50,10]=1.2,s[50,11]=0.1,s[50,12]=0.3,s[50,13]=0.4,s[50,14]=0.3,s[50,15]=-0.3 s[50,16]=-1.1,s[50,17]=-0.9,s[50,18]=0.5,s[50,19]=1.1,s[50,20]=-1.2,s[50,21]=0.2,s[50,22]=-0.7,s[50,23]=0.7,s[50,24]=-0.7,s[50,25]=0.1,s[50,26]=-0.4,s[50,27]=-0.5,s[50,28]=1.2,s[50,29]=-0.1,s[50,30]=-1.0 s[50,31]=0.8,s[50,32]=-0.3,s[50,33]=0.0,s[50,34]=-0.5,s[50,35]=-0.6,s[50,36]=-0.2,s[50,37]=0.3,s[50,38]=0.1,s[50,39]=-0.9,s[50,40]=-0.1,s[50,41]=0.6,s[50,42]=0.7,s[50,43]=0.8,s[50,44]=-0.4,s[50,45]=-0.2 s[50,46]=0.6,s[50,47]=-0.5,s[50,48]=1.1,s[50,49]=-0.4,s[50,50]=0.4,s[50,51]=0.9,s[50,52]=-0.2,s[50,53]=-1.2,s[50,54]=-0.2,s[50,55]=0.0,s[50,56]=-0.1,s[50,57]=0.0,s[50,58]=0.5,s[50,59]=0.0,s[50,60]=-1.1 s[51,1]=-0.3,s[51,2]=0.1,s[51,3]=-0.1,s[51,4]=-0.5,s[51,5]=0.4,s[51,6]=-0.5,s[51,7]=0.4,s[51,8]=-0.5,s[51,9]=1.0,s[51,10]=0.4,s[51,11]=0.2,s[51,12]=0.8,s[51,13]=-0.4,s[51,14]=0.7,s[51,15]=-0.7 s[51,16]=-0.6,s[51,17]=-0.1,s[51,18]=-0.1,s[51,19]=-0.3,s[51,20]=-1.0,s[51,21]=-0.8,s[51,22]=1.2,s[51,23]=0.7,s[51,24]=-0.9,s[51,25]=0.4,s[51,26]=1.0,s[51,27]=0.1,s[51,28]=-0.1,s[51,29]=1.2,s[51,30]=0.7 s[51,31]=0.7,s[51,32]=1.0,s[51,33]=1.0,s[51,34]=-0.5,s[51,35]=-1.1,s[51,36]=-0.5,s[51,37]=-0.5,s[51,38]=-0.4,s[51,39]=-0.9,s[51,40]=1.2,s[51,41]=-0.7,s[51,42]=0.6,s[51,43]=0.3,s[51,44]=0.4,s[51,45]=0.1 s[51,46]=-0.2,s[51,47]=-0.5,s[51,48]=1.0,s[51,49]=-0.7,s[51,50]=0.6,s[51,51]=-0.4,s[51,52]=0.9,s[51,53]=0.0,s[51,54]=-0.1,s[51,55]=-0.9,s[51,56]=1.2,s[51,57]=1.1,s[51,58]=0.7,s[51,59]=-0.3,s[51,60]=-0.3 s[52,1]=-0.6,s[52,2]=-0.8,s[52,3]=-1.1,s[52,4]=-0.9,s[52,5]=-1.1,s[52,6]=1.0,s[52,7]=1.0,s[52,8]=-1.1,s[52,9]=0.5,s[52,10]=-1.0,s[52,11]=1.0,s[52,12]=1.2,s[52,13]=-0.7,s[52,14]=-0.1,s[52,15]=0.0 s[52,16]=0.4,s[52,17]=-0.7,s[52,18]=0.4,s[52,19]=-1.2,s[52,20]=0.2,s[52,21]=0.0,s[52,22]=0.9,s[52,23]=-0.3,s[52,24]=1.0,s[52,25]=-1.0,s[52,26]=-0.1,s[52,27]=-0.5,s[52,28]=0.9,s[52,29]=0.6,s[52,30]=0.6 s[52,31]=-0.4,s[52,32]=0.8,s[52,33]=0.5,s[52,34]=-0.4,s[52,35]=0.3,s[52,36]=1.2,s[52,37]=-0.8,s[52,38]=0.2,s[52,39]=0.2,s[52,40]=-0.5,s[52,41]=0.4,s[52,42]=0.6,s[52,43]=-0.8,s[52,44]=-0.2,s[52,45]=-1.2 s[52,46]=-1.2,s[52,47]=-1.1,s[52,48]=0.3,s[52,49]=1.2,s[52,50]=-1.1,s[52,51]=-0.1,s[52,52]=1.1,s[52,53]=0.5,s[52,54]=0.0,s[52,55]=0.0,s[52,56]=0.6,s[52,57]=-0.7,s[52,58]=-0.8,s[52,59]=-0.1,s[52,60]=0.4 s[53,1]=1.0,s[53,2]=0.3,s[53,3]=0.2,s[53,4]=-0.7,s[53,5]=-0.7,s[53,6]=0.9,s[53,7]=-0.7,s[53,8]=-0.1,s[53,9]=-0.8,s[53,10]=0.6,s[53,11]=-0.2,s[53,12]=-0.2,s[53,13]=0.1,s[53,14]=-0.9,s[53,15]=-1.2 s[53,16]=-1.2,s[53,17]=-1.1,s[53,18]=0.2,s[53,19]=-1.0,s[53,20]=0.1,s[53,21]=1.2,s[53,22]=-0.2,s[53,23]=-1.1,s[53,24]=0.7,s[53,25]=0.9,s[53,26]=0.6,s[53,27]=-0.2,s[53,28]=0.6,s[53,29]=0.4,s[53,30]=0.2 s[53,31]=-1.1,s[53,32]=0.1,s[53,33]=1.2,s[53,34]=-0.4,s[53,35]=1.0,s[53,36]=-1.0,s[53,37]=-0.6,s[53,38]=0.3,s[53,39]=-0.7,s[53,40]=0.6,s[53,41]=-0.5,s[53,42]=-1.1,s[53,43]=0.0,s[53,44]=-0.3,s[53,45]=-1.1 s[53,46]=0.6,s[53,47]=-1.1,s[53,48]=0.9,s[53,49]=-0.8,s[53,50]=0.3,s[53,51]=-0.1,s[53,52]=-0.1,s[53,53]=0.7,s[53,54]=-0.8,s[53,55]=-1.0,s[53,56]=0.0,s[53,57]=-0.9,s[53,58]=-1.1,s[53,59]=0.4,s[53,60]=-0.9 s[54,1]=0.1,s[54,2]=-0.1,s[54,3]=0.9,s[54,4]=-1.0,s[54,5]=1.1,s[54,6]=0.1,s[54,7]=0.0,s[54,8]=-1.2,s[54,9]=-1.1,s[54,10]=-0.1,s[54,11]=0.1,s[54,12]=1.2,s[54,13]=-0.4,s[54,14]=0.8,s[54,15]=0.4 s[54,16]=1.2,s[54,17]=0.1,s[54,18]=-0.7,s[54,19]=-0.8,s[54,20]=1.0,s[54,21]=1.0,s[54,22]=-0.7,s[54,23]=-1.2,s[54,24]=0.7,s[54,25]=-1.1,s[54,26]=0.9,s[54,27]=0.9,s[54,28]=0.3,s[54,29]=0.4,s[54,30]=-0.9 s[54,31]=0.4,s[54,32]=1.0,s[54,33]=1.1,s[54,34]=-0.8,s[54,35]=-0.9,s[54,36]=-0.4,s[54,37]=-0.9,s[54,38]=0.6,s[54,39]=1.2,s[54,40]=0.7,s[54,41]=0.7,s[54,42]=1.0,s[54,43]=0.8,s[54,44]=-1.1,s[54,45]=-0.3 s[54,46]=-0.3,s[54,47]=1.0,s[54,48]=-0.9,s[54,49]=0.5,s[54,50]=1.2,s[54,51]=1.0,s[54,52]=0.4,s[54,53]=-1.2,s[54,54]=-0.5,s[54,55]=0.0,s[54,56]=-0.4,s[54,57]=1.2,s[54,58]=-0.5,s[54,59]=-0.4,s[54,60]=-0.1 s[55,1]=-0.3,s[55,2]=1.0,s[55,3]=-0.4,s[55,4]=0.0,s[55,5]=-1.2,s[55,6]=0.2,s[55,7]=-0.9,s[55,8]=0.1,s[55,9]=-0.3,s[55,10]=1.2,s[55,11]=-0.8,s[55,12]=1.2,s[55,13]=1.2,s[55,14]=-0.1,s[55,15]=-0.5 s[55,16]=-1.1,s[55,17]=1.1,s[55,18]=-0.8,s[55,19]=-0.9,s[55,20]=-1.1,s[55,21]=-0.9,s[55,22]=-0.4,s[55,23]=0.6,s[55,24]=0.4,s[55,25]=0.7,s[55,26]=0.2,s[55,27]=-0.9,s[55,28]=1.0,s[55,29]=-0.1,s[55,30]=0.1 s[55,31]=1.0,s[55,32]=-1.0,s[55,33]=0.9,s[55,34]=-0.4,s[55,35]=0.0,s[55,36]=-0.8,s[55,37]=-1.1,s[55,38]=-0.9,s[55,39]=1.1,s[55,40]=-0.1,s[55,41]=0.5,s[55,42]=0.4,s[55,43]=0.5,s[55,44]=0.7,s[55,45]=1.2 s[55,46]=-0.7,s[55,47]=-0.3,s[55,48]=0.1,s[55,49]=0.4,s[55,50]=1.1,s[55,51]=0.6,s[55,52]=0.8,s[55,53]=-0.5,s[55,54]=-0.2,s[55,55]=0.7,s[55,56]=-0.8,s[55,57]=-0.4,s[55,58]=-0.2,s[55,59]=-0.4,s[55,60]=-1.0 s[56,1]=-0.5,s[56,2]=0.5,s[56,3]=0.6,s[56,4]=-1.1,s[56,5]=-0.5,s[56,6]=1.2,s[56,7]=0.6,s[56,8]=-1.0,s[56,9]=0.2,s[56,10]=0.4,s[56,11]=0.1,s[56,12]=-0.6,s[56,13]=-0.4,s[56,14]=-0.8,s[56,15]=-1.2 s[56,16]=0.2,s[56,17]=1.1,s[56,18]=-0.4,s[56,19]=0.0,s[56,20]=-0.8,s[56,21]=1.2,s[56,22]=-0.2,s[56,23]=0.0,s[56,24]=-0.5,s[56,25]=0.2,s[56,26]=0.9,s[56,27]=0.0,s[56,28]=0.6,s[56,29]=0.6,s[56,30]=-0.2 s[56,31]=1.1,s[56,32]=0.4,s[56,33]=1.1,s[56,34]=0.0,s[56,35]=0.6,s[56,36]=1.1,s[56,37]=-0.1,s[56,38]=-0.5,s[56,39]=1.2,s[56,40]=0.3,s[56,41]=-0.5,s[56,42]=-0.5,s[56,43]=0.8,s[56,44]=0.7,s[56,45]=-0.1 s[56,46]=-1.2,s[56,47]=-0.1,s[56,48]=-0.2,s[56,49]=1.1,s[56,50]=0.6,s[56,51]=-0.9,s[56,52]=-0.7,s[56,53]=0.5,s[56,54]=-1.2,s[56,55]=1.0,s[56,56]=1.1,s[56,57]=0.0,s[56,58]=-0.5,s[56,59]=0.0,s[56,60]=-1.2 s[57,1]=-0.5,s[57,2]=-1.2,s[57,3]=-0.7,s[57,4]=-0.4,s[57,5]=0.1,s[57,6]=0.0,s[57,7]=-0.5,s[57,8]=0.9,s[57,9]=0.0,s[57,10]=-0.7,s[57,11]=0.6,s[57,12]=-1.0,s[57,13]=0.2,s[57,14]=-0.5,s[57,15]=0.2 s[57,16]=-0.2,s[57,17]=-1.0,s[57,18]=-0.2,s[57,19]=0.3,s[57,20]=0.4,s[57,21]=-1.0,s[57,22]=0.7,s[57,23]=0.1,s[57,24]=0.1,s[57,25]=-1.0,s[57,26]=0.1,s[57,27]=-0.5,s[57,28]=-0.1,s[57,29]=-0.4,s[57,30]=-0.1 s[57,31]=0.5,s[57,32]=-0.4,s[57,33]=-1.0,s[57,34]=0.0,s[57,35]=0.3,s[57,36]=0.2,s[57,37]=-0.6,s[57,38]=-0.8,s[57,39]=1.1,s[57,40]=1.0,s[57,41]=0.1,s[57,42]=-1.1,s[57,43]=-0.1,s[57,44]=0.6,s[57,45]=-1.1 s[57,46]=-1.1,s[57,47]=-1.1,s[57,48]=1.2,s[57,49]=-0.2,s[57,50]=-0.1,s[57,51]=-0.5,s[57,52]=-1.0,s[57,53]=-0.5,s[57,54]=0.0,s[57,55]=0.9,s[57,56]=0.5,s[57,57]=-0.5,s[57,58]=-1.0,s[57,59]=0.6,s[57,60]=-0.4 s[58,1]=1.2,s[58,2]=0.3,s[58,3]=-0.7,s[58,4]=-1.2,s[58,5]=0.9,s[58,6]=0.6,s[58,7]=-0.3,s[58,8]=0.0,s[58,9]=0.8,s[58,10]=-0.2,s[58,11]=0.6,s[58,12]=-1.1,s[58,13]=-0.9,s[58,14]=-1.0,s[58,15]=-0.4 s[58,16]=0.8,s[58,17]=0.5,s[58,18]=0.1,s[58,19]=0.3,s[58,20]=-1.2,s[58,21]=1.0,s[58,22]=0.4,s[58,23]=0.0,s[58,24]=1.1,s[58,25]=-0.3,s[58,26]=-0.2,s[58,27]=0.3,s[58,28]=1.2,s[58,29]=-0.6,s[58,30]=-0.4 s[58,31]=-0.9,s[58,32]=0.9,s[58,33]=-0.8,s[58,34]=-0.4,s[58,35]=0.2,s[58,36]=1.0,s[58,37]=-0.1,s[58,38]=0.5,s[58,39]=-0.4,s[58,40]=0.1,s[58,41]=-0.7,s[58,42]=-0.6,s[58,43]=0.9,s[58,44]=0.3,s[58,45]=0.8 s[58,46]=-0.6,s[58,47]=1.1,s[58,48]=1.2,s[58,49]=0.0,s[58,50]=0.5,s[58,51]=-0.4,s[58,52]=-0.8,s[58,53]=-1.0,s[58,54]=-1.2,s[58,55]=1.1,s[58,56]=-1.1,s[58,57]=-0.5,s[58,58]=-1.0,s[58,59]=-1.1,s[58,60]=-0.8 s[59,1]=0.4,s[59,2]=-1.2,s[59,3]=0.1,s[59,4]=-1.1,s[59,5]=-0.6,s[59,6]=0.3,s[59,7]=1.1,s[59,8]=-0.8,s[59,9]=-0.1,s[59,10]=0.6,s[59,11]=0.3,s[59,12]=0.2,s[59,13]=0.4,s[59,14]=-0.8,s[59,15]=1.0 s[59,16]=0.7,s[59,17]=0.3,s[59,18]=1.2,s[59,19]=0.3,s[59,20]=-0.4,s[59,21]=-0.2,s[59,22]=-1.1,s[59,23]=0.9,s[59,24]=0.7,s[59,25]=-0.6,s[59,26]=-0.4,s[59,27]=-0.7,s[59,28]=-0.3,s[59,29]=-1.0,s[59,30]=0.5 s[59,31]=1.1,s[59,32]=0.6,s[59,33]=-0.3,s[59,34]=0.1,s[59,35]=-0.8,s[59,36]=0.0,s[59,37]=-0.1,s[59,38]=-0.4,s[59,39]=0.6,s[59,40]=0.4,s[59,41]=-0.8,s[59,42]=-0.3,s[59,43]=-0.6,s[59,44]=0.8,s[59,45]=-0.9 s[59,46]=-1.2,s[59,47]=0.7,s[59,48]=1.0,s[59,49]=0.1,s[59,50]=-0.4,s[59,51]=0.5,s[59,52]=1.1,s[59,53]=-0.7,s[59,54]=-0.4,s[59,55]=-0.8,s[59,56]=0.1,s[59,57]=0.8,s[59,58]=1.1,s[59,59]=0.3,s[59,60]=-0.5 s[60,1]=1.2,s[60,2]=-0.8,s[60,3]=-0.1,s[60,4]=-0.5,s[60,5]=-0.2,s[60,6]=-0.5,s[60,7]=0.8,s[60,8]=-0.7,s[60,9]=0.3,s[60,10]=0.3,s[60,11]=-0.3,s[60,12]=-0.3,s[60,13]=-0.7,s[60,14]=0.8,s[60,15]=-0.5 s[60,16]=0.0,s[60,17]=0.2,s[60,18]=0.0,s[60,19]=-1.1,s[60,20]=0.0,s[60,21]=0.8,s[60,22]=0.7,s[60,23]=0.3,s[60,24]=-1.2,s[60,25]=0.5,s[60,26]=0.9,s[60,27]=0.9,s[60,28]=-0.8,s[60,29]=-0.1,s[60,30]=-1.2 s[60,31]=-0.6,s[60,32]=0.2,s[60,33]=0.0,s[60,34]=-0.6,s[60,35]=-0.3,s[60,36]=0.9,s[60,37]=0.9,s[60,38]=-0.2,s[60,39]=0.8,s[60,40]=-0.8,s[60,41]=0.4,s[60,42]=-0.3,s[60,43]=-0.5,s[60,44]=-0.1,s[60,45]=1.0 s[60,46]=0.6,s[60,47]=0.0,s[60,48]=-0.5,s[60,49]=-1.0,s[60,50]=0.7,s[60,51]=0.5,s[60,52]=-0.5,s[60,53]=0.9,s[60,54]=-1.1,s[60,55]=-0.3,s[60,56]=0.0,s[60,57]=-0.8,s[60,58]=-1.0,s[60,59]=0.0,s[60,60]=-1.2 s[61,1]=0.0,s[61,2]=0.7,s[61,3]=0.9,s[61,4]=0.4,s[61,5]=-1.0,s[61,6]=0.3,s[61,7]=-1.2,s[61,8]=1.1,s[61,9]=-0.3,s[61,10]=0.1,s[61,11]=-0.8,s[61,12]=-0.3,s[61,13]=-0.1,s[61,14]=-1.1,s[61,15]=-0.3 s[61,16]=-0.8,s[61,17]=0.1,s[61,18]=-0.8,s[61,19]=0.2,s[61,20]=0.7,s[61,21]=0.0,s[61,22]=1.1,s[61,23]=-0.5,s[61,24]=0.8,s[61,25]=0.1,s[61,26]=-0.4,s[61,27]=1.0,s[61,28]=-0.5,s[61,29]=-0.8,s[61,30]=-0.2 s[61,31]=1.0,s[61,32]=1.2,s[61,33]=0.3,s[61,34]=-0.1,s[61,35]=0.3,s[61,36]=-1.2,s[61,37]=-1.1,s[61,38]=-0.9,s[61,39]=1.2,s[61,40]=0.4,s[61,41]=-0.8,s[61,42]=-0.9,s[61,43]=-0.6,s[61,44]=-0.9,s[61,45]=1.2 s[61,46]=0.0,s[61,47]=0.3,s[61,48]=-0.3,s[61,49]=0.4,s[61,50]=1.0,s[61,51]=0.1,s[61,52]=0.8,s[61,53]=1.1,s[61,54]=1.2,s[61,55]=0.8,s[61,56]=-0.8,s[61,57]=0.9,s[61,58]=-0.2,s[61,59]=0.5,s[61,60]=-1.1 s[62,1]=0.8,s[62,2]=-1.2,s[62,3]=-0.7,s[62,4]=0.3,s[62,5]=-0.6,s[62,6]=1.1,s[62,7]=-0.4,s[62,8]=-0.3,s[62,9]=-0.8,s[62,10]=0.7,s[62,11]=-0.9,s[62,12]=0.3,s[62,13]=0.7,s[62,14]=1.2,s[62,15]=-0.5 s[62,16]=-1.1,s[62,17]=-0.7,s[62,18]=1.0,s[62,19]=-0.1,s[62,20]=0.0,s[62,21]=-1.2,s[62,22]=-0.9,s[62,23]=-0.3,s[62,24]=-0.3,s[62,25]=-0.1,s[62,26]=1.0,s[62,27]=-1.0,s[62,28]=0.7,s[62,29]=1.1,s[62,30]=-0.4 s[62,31]=0.7,s[62,32]=-0.9,s[62,33]=-0.3,s[62,34]=-0.7,s[62,35]=0.4,s[62,36]=1.0,s[62,37]=0.5,s[62,38]=-0.2,s[62,39]=0.8,s[62,40]=0.9,s[62,41]=-1.2,s[62,42]=1.1,s[62,43]=0.4,s[62,44]=-0.9,s[62,45]=0.7 s[62,46]=-0.5,s[62,47]=-0.5,s[62,48]=-0.6,s[62,49]=-0.7,s[62,50]=0.8,s[62,51]=1.1,s[62,52]=-1.2,s[62,53]=-0.4,s[62,54]=-0.8,s[62,55]=-0.7,s[62,56]=0.2,s[62,57]=-0.2,s[62,58]=0.4,s[62,59]=-1.1,s[62,60]=-0.7 s[63,1]=-1.2,s[63,2]=0.9,s[63,3]=0.6,s[63,4]=-0.6,s[63,5]=-0.6,s[63,6]=0.9,s[63,7]=-0.3,s[63,8]=-0.8,s[63,9]=0.5,s[63,10]=0.5,s[63,11]=0.3,s[63,12]=-0.3,s[63,13]=1.0,s[63,14]=-0.2,s[63,15]=-0.3 s[63,16]=0.2,s[63,17]=-0.9,s[63,18]=0.2,s[63,19]=0.7,s[63,20]=0.4,s[63,21]=-0.8,s[63,22]=-1.0,s[63,23]=0.7,s[63,24]=0.4,s[63,25]=0.9,s[63,26]=0.4,s[63,27]=-0.2,s[63,28]=-0.7,s[63,29]=0.4,s[63,30]=-0.7 s[63,31]=1.0,s[63,32]=0.8,s[63,33]=0.3,s[63,34]=-1.1,s[63,35]=-0.1,s[63,36]=0.0,s[63,37]=0.0,s[63,38]=0.0,s[63,39]=0.0,s[63,40]=-0.4,s[63,41]=0.0,s[63,42]=-0.2,s[63,43]=0.4,s[63,44]=0.6,s[63,45]=0.8 s[63,46]=-0.5,s[63,47]=0.4,s[63,48]=-0.6,s[63,49]=-0.9,s[63,50]=-1.0,s[63,51]=-0.9,s[63,52]=-1.2,s[63,53]=0.1,s[63,54]=0.4,s[63,55]=-0.5,s[63,56]=0.1,s[63,57]=1.1,s[63,58]=-0.8,s[63,59]=-0.5,s[63,60]=-0.6 s[64,1]=-0.2,s[64,2]=0.2,s[64,3]=-0.3,s[64,4]=0.0,s[64,5]=0.4,s[64,6]=-1.0,s[64,7]=-0.1,s[64,8]=-0.9,s[64,9]=1.2,s[64,10]=-0.6,s[64,11]=-0.7,s[64,12]=-0.4,s[64,13]=1.1,s[64,14]=0.6,s[64,15]=-1.0 s[64,16]=0.7,s[64,17]=0.2,s[64,18]=-0.1,s[64,19]=-1.1,s[64,20]=0.8,s[64,21]=-0.7,s[64,22]=1.2,s[64,23]=0.6,s[64,24]=-0.9,s[64,25]=0.0,s[64,26]=-1.0,s[64,27]=-0.4,s[64,28]=-0.6,s[64,29]=0.1,s[64,30]=0.8 s[64,31]=-1.0,s[64,32]=1.2,s[64,33]=-0.2,s[64,34]=-1.1,s[64,35]=0.3,s[64,36]=-0.4,s[64,37]=0.7,s[64,38]=1.2,s[64,39]=0.1,s[64,40]=-0.6,s[64,41]=-0.1,s[64,42]=-0.4,s[64,43]=-0.5,s[64,44]=-1.0,s[64,45]=0.7 s[64,46]=1.1,s[64,47]=-0.1,s[64,48]=-0.1,s[64,49]=-0.7,s[64,50]=0.2,s[64,51]=-0.7,s[64,52]=0.1,s[64,53]=0.9,s[64,54]=0.7,s[64,55]=-1.0,s[64,56]=0.2,s[64,57]=0.0,s[64,58]=0.1,s[64,59]=0.9,s[64,60]=-1.0 s[65,1]=-1.1,s[65,2]=0.7,s[65,3]=-1.0,s[65,4]=-0.3,s[65,5]=-0.7,s[65,6]=0.6,s[65,7]=0.6,s[65,8]=-0.2,s[65,9]=-0.4,s[65,10]=0.5,s[65,11]=-0.9,s[65,12]=0.7,s[65,13]=0.0,s[65,14]=-1.2,s[65,15]=1.0 s[65,16]=-0.9,s[65,17]=-0.8,s[65,18]=0.6,s[65,19]=0.4,s[65,20]=0.4,s[65,21]=-1.2,s[65,22]=0.7,s[65,23]=0.4,s[65,24]=0.1,s[65,25]=-0.9,s[65,26]=0.1,s[65,27]=-0.2,s[65,28]=0.2,s[65,29]=0.4,s[65,30]=-0.2 s[65,31]=-0.1,s[65,32]=0.7,s[65,33]=0.8,s[65,34]=0.1,s[65,35]=-1.1,s[65,36]=0.0,s[65,37]=-0.2,s[65,38]=-1.0,s[65,39]=1.1,s[65,40]=0.7,s[65,41]=0.1,s[65,42]=-1.1,s[65,43]=0.8,s[65,44]=0.3,s[65,45]=-0.1 s[65,46]=-1.1,s[65,47]=0.1,s[65,48]=-0.8,s[65,49]=1.2,s[65,50]=-0.1,s[65,51]=-0.6,s[65,52]=0.8,s[65,53]=-0.1,s[65,54]=0.7,s[65,55]=1.1,s[65,56]=-0.3,s[65,57]=-0.7,s[65,58]=-0.3,s[65,59]=0.0,s[65,60]=-1.0 s[66,1]=0.1,s[66,2]=-0.3,s[66,3]=-0.5,s[66,4]=-0.9,s[66,5]=0.5,s[66,6]=-1.0,s[66,7]=0.3,s[66,8]=-0.7,s[66,9]=-0.7,s[66,10]=-0.4,s[66,11]=-0.4,s[66,12]=-0.4,s[66,13]=1.1,s[66,14]=-0.8,s[66,15]=-0.9 s[66,16]=0.7,s[66,17]=0.9,s[66,18]=-0.1,s[66,19]=0.5,s[66,20]=-0.1,s[66,21]=0.5,s[66,22]=0.8,s[66,23]=-0.6,s[66,24]=-0.4,s[66,25]=-0.1,s[66,26]=-0.7,s[66,27]=-0.7,s[66,28]=1.1,s[66,29]=-0.6,s[66,30]=-0.5 s[66,31]=0.6,s[66,32]=-0.7,s[66,33]=-0.2,s[66,34]=-0.5,s[66,35]=0.2,s[66,36]=0.3,s[66,37]=0.3,s[66,38]=-0.1,s[66,39]=0.8,s[66,40]=1.1,s[66,41]=0.3,s[66,42]=-1.1,s[66,43]=-0.2,s[66,44]=0.8,s[66,45]=-0.7 s[66,46]=0.1,s[66,47]=0.5,s[66,48]=0.4,s[66,49]=0.6,s[66,50]=1.2,s[66,51]=-0.4,s[66,52]=0.5,s[66,53]=-0.6,s[66,54]=0.9,s[66,55]=-0.2,s[66,56]=0.6,s[66,57]=-0.3,s[66,58]=-0.1,s[66,59]=0.0,s[66,60]=-1.2 s[67,1]=-0.3,s[67,2]=0.7,s[67,3]=-0.9,s[67,4]=-1.0,s[67,5]=-1.0,s[67,6]=0.5,s[67,7]=-0.9,s[67,8]=-1.2,s[67,9]=0.3,s[67,10]=0.8,s[67,11]=1.2,s[67,12]=-0.2,s[67,13]=0.1,s[67,14]=-0.6,s[67,15]=-1.1 s[67,16]=0.4,s[67,17]=0.1,s[67,18]=-1.1,s[67,19]=-0.6,s[67,20]=0.8,s[67,21]=-1.2,s[67,22]=-0.4,s[67,23]=-0.8,s[67,24]=1.2,s[67,25]=0.3,s[67,26]=0.3,s[67,27]=0.6,s[67,28]=0.9,s[67,29]=0.1,s[67,30]=-0.9 s[67,31]=1.0,s[67,32]=-0.9,s[67,33]=-0.6,s[67,34]=-1.1,s[67,35]=-0.9,s[67,36]=1.0,s[67,37]=-1.2,s[67,38]=0.2,s[67,39]=-0.7,s[67,40]=0.1,s[67,41]=0.6,s[67,42]=-0.7,s[67,43]=-0.5,s[67,44]=0.4,s[67,45]=-0.9 s[67,46]=-1.2,s[67,47]=-0.2,s[67,48]=-0.9,s[67,49]=1.2,s[67,50]=0.7,s[67,51]=0.3,s[67,52]=-1.2,s[67,53]=0.6,s[67,54]=0.2,s[67,55]=0.5,s[67,56]=1.1,s[67,57]=1.0,s[67,58]=1.2,s[67,59]=-0.1,s[67,60]=0.1 s[68,1]=0.8,s[68,2]=-1.0,s[68,3]=-1.0,s[68,4]=-0.7,s[68,5]=0.2,s[68,6]=0.3,s[68,7]=-0.7,s[68,8]=0.1,s[68,9]=0.9,s[68,10]=-0.8,s[68,11]=1.0,s[68,12]=-0.5,s[68,13]=1.0,s[68,14]=-0.9,s[68,15]=-0.1 s[68,16]=0.8,s[68,17]=1.0,s[68,18]=1.0,s[68,19]=-1.2,s[68,20]=-0.6,s[68,21]=-0.9,s[68,22]=0.6,s[68,23]=0.1,s[68,24]=0.4,s[68,25]=-1.2,s[68,26]=-0.2,s[68,27]=0.4,s[68,28]=-0.3,s[68,29]=1.1,s[68,30]=-1.0 s[68,31]=-1.2,s[68,32]=-0.6,s[68,33]=0.2,s[68,34]=-0.5,s[68,35]=1.0,s[68,36]=-0.6,s[68,37]=0.7,s[68,38]=0.0,s[68,39]=1.1,s[68,40]=0.3,s[68,41]=0.7,s[68,42]=0.7,s[68,43]=0.5,s[68,44]=-0.9,s[68,45]=-0.2 s[68,46]=0.7,s[68,47]=-0.4,s[68,48]=-0.5,s[68,49]=-0.4,s[68,50]=0.8,s[68,51]=1.0,s[68,52]=-1.1,s[68,53]=-1.0,s[68,54]=-0.4,s[68,55]=-0.4,s[68,56]=-1.1,s[68,57]=-0.9,s[68,58]=1.1,s[68,59]=1.1,s[68,60]=-0.9 s[69,1]=0.5,s[69,2]=1.1,s[69,3]=-0.2,s[69,4]=-0.2,s[69,5]=1.1,s[69,6]=-0.2,s[69,7]=-1.2,s[69,8]=-1.0,s[69,9]=-1.0,s[69,10]=-0.2,s[69,11]=0.5,s[69,12]=-1.0,s[69,13]=-0.3,s[69,14]=-0.8,s[69,15]=-1.2 s[69,16]=1.2,s[69,17]=0.2,s[69,18]=-0.7,s[69,19]=-0.5,s[69,20]=-0.7,s[69,21]=-0.5,s[69,22]=0.1,s[69,23]=-0.3,s[69,24]=-0.6,s[69,25]=-0.9,s[69,26]=-0.8,s[69,27]=1.2,s[69,28]=0.1,s[69,29]=0.3,s[69,30]=0.0 s[69,31]=0.8,s[69,32]=-0.2,s[69,33]=-1.2,s[69,34]=-0.3,s[69,35]=1.2,s[69,36]=-0.5,s[69,37]=0.4,s[69,38]=1.1,s[69,39]=-0.3,s[69,40]=0.3,s[69,41]=0.0,s[69,42]=-0.3,s[69,43]=0.4,s[69,44]=0.3,s[69,45]=-0.2 s[69,46]=0.7,s[69,47]=0.8,s[69,48]=0.5,s[69,49]=0.5,s[69,50]=0.2,s[69,51]=-0.2,s[69,52]=1.0,s[69,53]=0.0,s[69,54]=-0.6,s[69,55]=0.8,s[69,56]=0.8,s[69,57]=0.3,s[69,58]=0.7,s[69,59]=-0.4,s[69,60]=-1.1 s[70,1]=-0.3,s[70,2]=0.3,s[70,3]=-0.1,s[70,4]=0.7,s[70,5]=0.0,s[70,6]=-1.0,s[70,7]=-1.2,s[70,8]=-0.1,s[70,9]=0.2,s[70,10]=-1.2,s[70,11]=-0.5,s[70,12]=-1.0,s[70,13]=1.1,s[70,14]=-0.2,s[70,15]=0.1 s[70,16]=1.0,s[70,17]=0.0,s[70,18]=1.0,s[70,19]=-1.1,s[70,20]=0.6,s[70,21]=-1.2,s[70,22]=0.6,s[70,23]=0.7,s[70,24]=-0.6,s[70,25]=0.9,s[70,26]=-0.7,s[70,27]=0.4,s[70,28]=-0.3,s[70,29]=0.8,s[70,30]=0.4 s[70,31]=0.4,s[70,32]=-1.2,s[70,33]=1.0,s[70,34]=-0.3,s[70,35]=-0.7,s[70,36]=-0.3,s[70,37]=0.8,s[70,38]=0.9,s[70,39]=0.2,s[70,40]=-0.1,s[70,41]=1.2,s[70,42]=0.4,s[70,43]=-0.4,s[70,44]=-0.3,s[70,45]=-0.3 s[70,46]=0.6,s[70,47]=-0.7,s[70,48]=-0.9,s[70,49]=0.2,s[70,50]=-0.8,s[70,51]=-0.7,s[70,52]=-0.5,s[70,53]=0.7,s[70,54]=-0.3,s[70,55]=0.6,s[70,56]=-0.6,s[70,57]=-0.6,s[70,58]=0.5,s[70,59]=1.2,s[70,60]=-0.5 s[71,1]=0.9,s[71,2]=0.1,s[71,3]=0.0,s[71,4]=-1.0,s[71,5]=-0.5,s[71,6]=-0.7,s[71,7]=-1.2,s[71,8]=0.2,s[71,9]=0.0,s[71,10]=-0.3,s[71,11]=0.8,s[71,12]=1.0,s[71,13]=-0.9,s[71,14]=-1.0,s[71,15]=-1.2 s[71,16]=-0.2,s[71,17]=-0.7,s[71,18]=-0.9,s[71,19]=-1.2,s[71,20]=-1.1,s[71,21]=-1.1,s[71,22]=0.4,s[71,23]=0.7,s[71,24]=-0.8,s[71,25]=-0.8,s[71,26]=-0.5,s[71,27]=-1.1,s[71,28]=0.7,s[71,29]=0.8,s[71,30]=0.4 s[71,31]=-0.5,s[71,32]=1.2,s[71,33]=-0.7,s[71,34]=-0.9,s[71,35]=0.4,s[71,36]=1.1,s[71,37]=-0.2,s[71,38]=0.9,s[71,39]=1.0,s[71,40]=-0.3,s[71,41]=-1.2,s[71,42]=0.0,s[71,43]=-1.0,s[71,44]=0.5,s[71,45]=-0.5 s[71,46]=0.9,s[71,47]=-1.2,s[71,48]=-0.3,s[71,49]=-0.8,s[71,50]=0.9,s[71,51]=1.2,s[71,52]=-0.3,s[71,53]=0.5,s[71,54]=-0.7,s[71,55]=-0.2,s[71,56]=-0.2,s[71,57]=-0.6,s[71,58]=0.9,s[71,59]=0.1,s[71,60]=-1.0 s[72,1]=-0.5,s[72,2]=-0.3,s[72,3]=-0.1,s[72,4]=0.2,s[72,5]=0.7,s[72,6]=-0.1,s[72,7]=-0.1,s[72,8]=-0.9,s[72,9]=-0.3,s[72,10]=0.3,s[72,11]=1.1,s[72,12]=-1.2,s[72,13]=0.2,s[72,14]=0.7,s[72,15]=-0.2 s[72,16]=-1.2,s[72,17]=1.0,s[72,18]=-1.1,s[72,19]=0.5,s[72,20]=0.4,s[72,21]=0.1,s[72,22]=-0.6,s[72,23]=0.5,s[72,24]=-0.8,s[72,25]=-0.6,s[72,26]=0.9,s[72,27]=-1.0,s[72,28]=0.9,s[72,29]=0.4,s[72,30]=-0.2 s[72,31]=0.5,s[72,32]=-0.8,s[72,33]=-0.8,s[72,34]=-1.0,s[72,35]=-1.2,s[72,36]=-0.1,s[72,37]=0.7,s[72,38]=0.6,s[72,39]=1.1,s[72,40]=0.3,s[72,41]=-1.1,s[72,42]=-0.4,s[72,43]=0.0,s[72,44]=-0.1,s[72,45]=1.2 s[72,46]=-0.7,s[72,47]=0.9,s[72,48]=-1.1,s[72,49]=-0.7,s[72,50]=0.3,s[72,51]=-0.8,s[72,52]=-0.9,s[72,53]=-1.0,s[72,54]=-1.0,s[72,55]=-0.8,s[72,56]=-1.0,s[72,57]=-0.1,s[72,58]=-1.2,s[72,59]=-1.2,s[72,60]=-1.1 s[73,1]=0.9,s[73,2]=-1.2,s[73,3]=0.7,s[73,4]=-0.8,s[73,5]=0.8,s[73,6]=1.1,s[73,7]=-1.1,s[73,8]=-0.3,s[73,9]=0.2,s[73,10]=-0.3,s[73,11]=-1.2,s[73,12]=0.6,s[73,13]=0.3,s[73,14]=-0.9,s[73,15]=1.1 s[73,16]=0.7,s[73,17]=-0.3,s[73,18]=1.1,s[73,19]=-0.8,s[73,20]=1.0,s[73,21]=1.1,s[73,22]=0.9,s[73,23]=-1.2,s[73,24]=0.8,s[73,25]=0.5,s[73,26]=1.2,s[73,27]=-1.1,s[73,28]=0.3,s[73,29]=0.2,s[73,30]=-0.6 s[73,31]=0.4,s[73,32]=-0.5,s[73,33]=0.2,s[73,34]=0.4,s[73,35]=0.6,s[73,36]=-0.3,s[73,37]=1.2,s[73,38]=0.3,s[73,39]=0.0,s[73,40]=0.3,s[73,41]=1.0,s[73,42]=-1.2,s[73,43]=-1.2,s[73,44]=-1.1,s[73,45]=-0.4 s[73,46]=0.7,s[73,47]=-1.2,s[73,48]=-0.6,s[73,49]=0.5,s[73,50]=-0.4,s[73,51]=0.3,s[73,52]=0.8,s[73,53]=-0.4,s[73,54]=-0.9,s[73,55]=-0.4,s[73,56]=-1.1,s[73,57]=-0.5,s[73,58]=0.1,s[73,59]=0.4,s[73,60]=-1.1 s[74,1]=0.6,s[74,2]=0.0,s[74,3]=-0.1,s[74,4]=-0.9,s[74,5]=0.7,s[74,6]=-1.0,s[74,7]=-1.1,s[74,8]=0.3,s[74,9]=-0.3,s[74,10]=-0.6,s[74,11]=-0.2,s[74,12]=-0.7,s[74,13]=-0.3,s[74,14]=-1.1,s[74,15]=-0.8 s[74,16]=-0.2,s[74,17]=0.0,s[74,18]=-0.7,s[74,19]=-0.4,s[74,20]=0.1,s[74,21]=-0.4,s[74,22]=1.1,s[74,23]=0.0,s[74,24]=0.0,s[74,25]=-0.4,s[74,26]=-0.7,s[74,27]=1.2,s[74,28]=-0.8,s[74,29]=0.1,s[74,30]=0.7 s[74,31]=-0.7,s[74,32]=1.2,s[74,33]=0.4,s[74,34]=-0.8,s[74,35]=-0.1,s[74,36]=0.1,s[74,37]=-0.6,s[74,38]=-0.9,s[74,39]=1.2,s[74,40]=0.1,s[74,41]=0.2,s[74,42]=-1.1,s[74,43]=-0.7,s[74,44]=-0.3,s[74,45]=-0.7 s[74,46]=-0.9,s[74,47]=1.1,s[74,48]=0.6,s[74,49]=0.9,s[74,50]=0.0,s[74,51]=-1.2,s[74,52]=-0.5,s[74,53]=0.2,s[74,54]=1.0,s[74,55]=0.2,s[74,56]=-0.3,s[74,57]=-0.6,s[74,58]=-0.6,s[74,59]=-1.0,s[74,60]=-1.2 s[75,1]=0.2,s[75,2]=-1.0,s[75,3]=-1.1,s[75,4]=-0.7,s[75,5]=0.0,s[75,6]=0.7,s[75,7]=-1.1,s[75,8]=0.6,s[75,9]=0.8,s[75,10]=0.7,s[75,11]=1.0,s[75,12]=-0.2,s[75,13]=-1.0,s[75,14]=0.0,s[75,15]=-0.8 s[75,16]=-1.0,s[75,17]=-0.2,s[75,18]=0.4,s[75,19]=0.9,s[75,20]=1.2,s[75,21]=-0.7,s[75,22]=-0.1,s[75,23]=1.2,s[75,24]=0.1,s[75,25]=-0.5,s[75,26]=0.7,s[75,27]=-0.7,s[75,28]=-1.0,s[75,29]=1.1,s[75,30]=1.2 s[75,31]=1.1,s[75,32]=0.1,s[75,33]=0.5,s[75,34]=0.1,s[75,35]=1.1,s[75,36]=-0.3,s[75,37]=0.0,s[75,38]=0.1,s[75,39]=0.4,s[75,40]=-1.0,s[75,41]=0.1,s[75,42]=-0.5,s[75,43]=1.2,s[75,44]=-0.8,s[75,45]=1.1 s[75,46]=0.4,s[75,47]=0.9,s[75,48]=0.3,s[75,49]=-0.3,s[75,50]=0.1,s[75,51]=-1.0,s[75,52]=0.0,s[75,53]=-1.2,s[75,54]=-1.0,s[75,55]=0.5,s[75,56]=0.4,s[75,57]=0.5,s[75,58]=-0.2,s[75,59]=0.3,s[75,60]=-0.6 s[76,1]=0.7,s[76,2]=-0.4,s[76,3]=-0.2,s[76,4]=0.4,s[76,5]=0.2,s[76,6]=0.9,s[76,7]=-0.1,s[76,8]=-1.2,s[76,9]=0.1,s[76,10]=-1.2,s[76,11]=-0.3,s[76,12]=1.1,s[76,13]=-0.7,s[76,14]=0.5,s[76,15]=1.0 s[76,16]=-1.2,s[76,17]=0.2,s[76,18]=1.2,s[76,19]=-1.1,s[76,20]=0.9,s[76,21]=1.2,s[76,22]=-0.2,s[76,23]=1.2,s[76,24]=-0.5,s[76,25]=-0.2,s[76,26]=-0.2,s[76,27]=-0.4,s[76,28]=0.3,s[76,29]=-0.4,s[76,30]=0.5 s[76,31]=0.3,s[76,32]=1.0,s[76,33]=-1.2,s[76,34]=-0.6,s[76,35]=1.1,s[76,36]=-1.1,s[76,37]=-0.5,s[76,38]=-1.2,s[76,39]=-0.1,s[76,40]=-1.0,s[76,41]=0.1,s[76,42]=0.4,s[76,43]=-1.1,s[76,44]=-0.3,s[76,45]=1.2 s[76,46]=0.2,s[76,47]=0.6,s[76,48]=-1.0,s[76,49]=-1.0,s[76,50]=0.5,s[76,51]=-0.9,s[76,52]=1.2,s[76,53]=-0.1,s[76,54]=0.0,s[76,55]=-0.8,s[76,56]=-0.2,s[76,57]=0.3,s[76,58]=-1.2,s[76,59]=-1.1,s[76,60]=-1.0 s[77,1]=-0.1,s[77,2]=0.9,s[77,3]=0.8,s[77,4]=-1.1,s[77,5]=-0.1,s[77,6]=0.6,s[77,7]=-0.5,s[77,8]=0.1,s[77,9]=-0.1,s[77,10]=0.8,s[77,11]=-1.1,s[77,12]=0.3,s[77,13]=1.2,s[77,14]=1.2,s[77,15]=-1.2 s[77,16]=0.5,s[77,17]=0.8,s[77,18]=-0.8,s[77,19]=-1.0,s[77,20]=1.0,s[77,21]=0.9,s[77,22]=1.1,s[77,23]=0.9,s[77,24]=0.6,s[77,25]=-0.1,s[77,26]=1.2,s[77,27]=0.7,s[77,28]=-1.0,s[77,29]=1.0,s[77,30]=0.8 s[77,31]=-0.8,s[77,32]=-0.3,s[77,33]=0.2,s[77,34]=0.0,s[77,35]=-0.7,s[77,36]=0.4,s[77,37]=0.6,s[77,38]=-0.5,s[77,39]=-0.2,s[77,40]=0.5,s[77,41]=-0.7,s[77,42]=0.1,s[77,43]=-0.1,s[77,44]=0.2,s[77,45]=-0.4 s[77,46]=-0.2,s[77,47]=-1.0,s[77,48]=-0.6,s[77,49]=0.6,s[77,50]=1.2,s[77,51]=-0.1,s[77,52]=0.4,s[77,53]=0.0,s[77,54]=-1.2,s[77,55]=1.0,s[77,56]=0.2,s[77,57]=-1.0,s[77,58]=0.1,s[77,59]=0.7,s[77,60]=-0.3 s[78,1]=0.4,s[78,2]=-0.3,s[78,3]=-0.6,s[78,4]=-0.7,s[78,5]=1.0,s[78,6]=-0.8,s[78,7]=-1.1,s[78,8]=0.2,s[78,9]=1.1,s[78,10]=-1.0,s[78,11]=1.0,s[78,12]=-0.8,s[78,13]=0.6,s[78,14]=-0.1,s[78,15]=-1.0 s[78,16]=-0.9,s[78,17]=1.1,s[78,18]=1.2,s[78,19]=-0.7,s[78,20]=0.6,s[78,21]=0.5,s[78,22]=-0.6,s[78,23]=-0.1,s[78,24]=-0.4,s[78,25]=-0.5,s[78,26]=-0.9,s[78,27]=0.1,s[78,28]=0.1,s[78,29]=0.0,s[78,30]=0.4 s[78,31]=0.4,s[78,32]=-1.2,s[78,33]=-0.2,s[78,34]=-1.0,s[78,35]=-0.4,s[78,36]=0.1,s[78,37]=0.1,s[78,38]=0.1,s[78,39]=0.3,s[78,40]=0.8,s[78,41]=-1.2,s[78,42]=0.6,s[78,43]=0.0,s[78,44]=-1.0,s[78,45]=0.5 s[78,46]=0.6,s[78,47]=0.7,s[78,48]=0.2,s[78,49]=0.0,s[78,50]=-0.2,s[78,51]=-0.8,s[78,52]=1.0,s[78,53]=0.1,s[78,54]=-1.1,s[78,55]=-0.3,s[78,56]=0.6,s[78,57]=0.7,s[78,58]=-0.7,s[78,59]=-0.5,s[78,60]=0.5 s[79,1]=-1.0,s[79,2]=-0.2,s[79,3]=0.1,s[79,4]=-0.8,s[79,5]=-0.6,s[79,6]=-0.5,s[79,7]=0.5,s[79,8]=-0.7,s[79,9]=-1.1,s[79,10]=-0.7,s[79,11]=0.4,s[79,12]=1.1,s[79,13]=1.0,s[79,14]=1.2,s[79,15]=-0.5 s[79,16]=0.1,s[79,17]=-0.5,s[79,18]=0.4,s[79,19]=0.8,s[79,20]=-0.8,s[79,21]=-0.6,s[79,22]=-0.3,s[79,23]=-0.7,s[79,24]=-0.5,s[79,25]=1.0,s[79,26]=0.8,s[79,27]=-0.6,s[79,28]=0.3,s[79,29]=-1.0,s[79,30]=1.1 s[79,31]=0.5,s[79,32]=-0.6,s[79,33]=-0.8,s[79,34]=-0.7,s[79,35]=-0.9,s[79,36]=-1.2,s[79,37]=1.0,s[79,38]=0.2,s[79,39]=-0.6,s[79,40]=-0.7,s[79,41]=-1.2,s[79,42]=-1.1,s[79,43]=-0.6,s[79,44]=-0.2,s[79,45]=-0.1 s[79,46]=-0.7,s[79,47]=0.2,s[79,48]=-0.5,s[79,49]=-0.1,s[79,50]=0.6,s[79,51]=0.0,s[79,52]=-1.2,s[79,53]=0.9,s[79,54]=1.1,s[79,55]=-0.3,s[79,56]=0.9,s[79,57]=-0.3,s[79,58]=0.5,s[79,59]=-0.8,s[79,60]=-0.8 s[80,1]=-0.8,s[80,2]=1.2,s[80,3]=0.1,s[80,4]=0.0,s[80,5]=0.7,s[80,6]=-0.9,s[80,7]=0.5,s[80,8]=-1.1,s[80,9]=-0.5,s[80,10]=0.7,s[80,11]=-0.6,s[80,12]=-0.6,s[80,13]=0.1,s[80,14]=-1.1,s[80,15]=0.7 s[80,16]=-0.5,s[80,17]=-0.4,s[80,18]=-0.7,s[80,19]=0.4,s[80,20]=0.5,s[80,21]=0.7,s[80,22]=0.8,s[80,23]=-0.7,s[80,24]=0.8,s[80,25]=-0.9,s[80,26]=0.0,s[80,27]=0.4,s[80,28]=0.0,s[80,29]=-0.4,s[80,30]=0.5 s[80,31]=1.0,s[80,32]=-1.1,s[80,33]=0.8,s[80,34]=0.0,s[80,35]=0.5,s[80,36]=0.3,s[80,37]=0.3,s[80,38]=0.5,s[80,39]=1.1,s[80,40]=-0.2,s[80,41]=1.0,s[80,42]=-0.7,s[80,43]=-1.0,s[80,44]=-0.9,s[80,45]=1.1 s[80,46]=-0.5,s[80,47]=-0.3,s[80,48]=1.0,s[80,49]=-0.2,s[80,50]=1.2,s[80,51]=-0.9,s[80,52]=1.0,s[80,53]=-0.1,s[80,54]=0.5,s[80,55]=0.8,s[80,56]=-0.4,s[80,57]=-0.5,s[80,58]=1.0,s[80,59]=-0.1,s[80,60]=-0.9 s[81,1]=0.6,s[81,2]=0.5,s[81,3]=0.7,s[81,4]=-1.0,s[81,5]=0.3,s[81,6]=0.8,s[81,7]=1.2,s[81,8]=-0.7,s[81,9]=-0.7,s[81,10]=-0.9,s[81,11]=-1.1,s[81,12]=0.0,s[81,13]=-0.6,s[81,14]=0.4,s[81,15]=1.0 s[81,16]=-0.6,s[81,17]=0.8,s[81,18]=0.0,s[81,19]=-1.1,s[81,20]=0.0,s[81,21]=0.1,s[81,22]=-0.5,s[81,23]=-0.2,s[81,24]=0.4,s[81,25]=1.1,s[81,26]=0.0,s[81,27]=0.4,s[81,28]=1.1,s[81,29]=-1.2,s[81,30]=0.7 s[81,31]=0.5,s[81,32]=-0.3,s[81,33]=0.4,s[81,34]=-1.1,s[81,35]=0.3,s[81,36]=0.2,s[81,37]=0.4,s[81,38]=-1.0,s[81,39]=-0.9,s[81,40]=-1.1,s[81,41]=0.2,s[81,42]=-1.2,s[81,43]=0.3,s[81,44]=-1.1,s[81,45]=1.2 s[81,46]=0.1,s[81,47]=0.5,s[81,48]=1.1,s[81,49]=0.9,s[81,50]=-0.7,s[81,51]=-0.5,s[81,52]=0.8,s[81,53]=1.1,s[81,54]=0.8,s[81,55]=-1.0,s[81,56]=0.2,s[81,57]=0.2,s[81,58]=0.3,s[81,59]=-0.4,s[81,60]=0.4 s[82,1]=-0.5,s[82,2]=0.3,s[82,3]=0.6,s[82,4]=-1.1,s[82,5]=0.1,s[82,6]=-1.2,s[82,7]=-0.9,s[82,8]=1.1,s[82,9]=1.1,s[82,10]=1.1,s[82,11]=-0.2,s[82,12]=0.5,s[82,13]=0.7,s[82,14]=-0.7,s[82,15]=-1.2 s[82,16]=-0.7,s[82,17]=0.4,s[82,18]=1.1,s[82,19]=-0.3,s[82,20]=-0.6,s[82,21]=0.2,s[82,22]=-0.4,s[82,23]=-0.8,s[82,24]=0.1,s[82,25]=-0.8,s[82,26]=-0.1,s[82,27]=-0.6,s[82,28]=0.3,s[82,29]=-0.7,s[82,30]=1.0 s[82,31]=0.1,s[82,32]=-0.5,s[82,33]=1.1,s[82,34]=-1.2,s[82,35]=-1.2,s[82,36]=-0.6,s[82,37]=1.2,s[82,38]=0.9,s[82,39]=0.7,s[82,40]=-0.3,s[82,41]=1.2,s[82,42]=0.3,s[82,43]=1.2,s[82,44]=0.8,s[82,45]=0.3 s[82,46]=0.1,s[82,47]=1.0,s[82,48]=-0.8,s[82,49]=-0.9,s[82,50]=0.4,s[82,51]=0.1,s[82,52]=0.2,s[82,53]=-0.1,s[82,54]=-0.2,s[82,55]=0.0,s[82,56]=0.0,s[82,57]=-0.8,s[82,58]=0.1,s[82,59]=1.0,s[82,60]=-0.7 s[83,1]=-0.7,s[83,2]=0.5,s[83,3]=-0.8,s[83,4]=-0.1,s[83,5]=0.4,s[83,6]=1.2,s[83,7]=0.4,s[83,8]=0.1,s[83,9]=0.1,s[83,10]=0.2,s[83,11]=0.6,s[83,12]=0.8,s[83,13]=0.2,s[83,14]=-0.8,s[83,15]=-0.3 s[83,16]=0.2,s[83,17]=0.2,s[83,18]=0.7,s[83,19]=-0.1,s[83,20]=-0.4,s[83,21]=-0.7,s[83,22]=-1.0,s[83,23]=0.5,s[83,24]=1.2,s[83,25]=-0.3,s[83,26]=-1.2,s[83,27]=0.5,s[83,28]=-0.6,s[83,29]=1.2,s[83,30]=0.7 s[83,31]=0.5,s[83,32]=-0.8,s[83,33]=1.1,s[83,34]=-0.4,s[83,35]=-0.6,s[83,36]=-1.1,s[83,37]=0.1,s[83,38]=1.2,s[83,39]=0.1,s[83,40]=-0.7,s[83,41]=-0.4,s[83,42]=-0.9,s[83,43]=1.0,s[83,44]=0.7,s[83,45]=-1.2 s[83,46]=1.0,s[83,47]=0.1,s[83,48]=-0.4,s[83,49]=1.1,s[83,50]=0.0,s[83,51]=-0.4,s[83,52]=0.7,s[83,53]=-0.1,s[83,54]=1.0,s[83,55]=-1.2,s[83,56]=-0.1,s[83,57]=0.2,s[83,58]=-0.5,s[83,59]=-0.3,s[83,60]=-1.1 s[84,1]=0.9,s[84,2]=1.1,s[84,3]=-0.1,s[84,4]=-0.6,s[84,5]=0.8,s[84,6]=0.1,s[84,7]=0.1,s[84,8]=0.1,s[84,9]=-0.6,s[84,10]=0.1,s[84,11]=1.1,s[84,12]=0.2,s[84,13]=-0.5,s[84,14]=-0.3,s[84,15]=-0.1 s[84,16]=-0.2,s[84,17]=1.0,s[84,18]=-0.5,s[84,19]=1.1,s[84,20]=0.1,s[84,21]=-0.9,s[84,22]=-0.5,s[84,23]=0.7,s[84,24]=-0.4,s[84,25]=-1.0,s[84,26]=0.3,s[84,27]=-0.8,s[84,28]=0.6,s[84,29]=-0.4,s[84,30]=0.4 s[84,31]=0.5,s[84,32]=0.1,s[84,33]=0.5,s[84,34]=-0.4,s[84,35]=1.2,s[84,36]=-0.4,s[84,37]=1.0,s[84,38]=-1.1,s[84,39]=0.7,s[84,40]=-0.5,s[84,41]=0.6,s[84,42]=1.1,s[84,43]=0.6,s[84,44]=0.2,s[84,45]=-0.1 s[84,46]=-0.7,s[84,47]=0.1,s[84,48]=0.2,s[84,49]=-0.4,s[84,50]=1.2,s[84,51]=-0.1,s[84,52]=-0.8,s[84,53]=0.3,s[84,54]=0.0,s[84,55]=0.1,s[84,56]=-0.3,s[84,57]=0.2,s[84,58]=1.1,s[84,59]=-0.6,s[84,60]=-1.2 s[85,1]=0.7,s[85,2]=0.2,s[85,3]=0.2,s[85,4]=-0.2,s[85,5]=0.8,s[85,6]=-1.0,s[85,7]=-0.5,s[85,8]=0.2,s[85,9]=-1.2,s[85,10]=0.8,s[85,11]=0.4,s[85,12]=1.0,s[85,13]=1.2,s[85,14]=-0.4,s[85,15]=-1.1 s[85,16]=0.7,s[85,17]=0.2,s[85,18]=-0.3,s[85,19]=0.9,s[85,20]=1.0,s[85,21]=-1.2,s[85,22]=0.0,s[85,23]=-1.2,s[85,24]=0.2,s[85,25]=-0.8,s[85,26]=-0.6,s[85,27]=-1.1,s[85,28]=0.5,s[85,29]=-0.8,s[85,30]=0.0 s[85,31]=0.5,s[85,32]=-0.6,s[85,33]=-0.3,s[85,34]=0.2,s[85,35]=-0.7,s[85,36]=-0.2,s[85,37]=-0.8,s[85,38]=1.0,s[85,39]=-1.1,s[85,40]=1.0,s[85,41]=-0.1,s[85,42]=-0.2,s[85,43]=-0.6,s[85,44]=-1.1,s[85,45]=-0.5 s[85,46]=0.4,s[85,47]=-1.2,s[85,48]=-0.2,s[85,49]=-1.1,s[85,50]=-1.2,s[85,51]=0.9,s[85,52]=0.0,s[85,53]=0.4,s[85,54]=-0.3,s[85,55]=-0.8,s[85,56]=0.9,s[85,57]=-1.0,s[85,58]=-0.2,s[85,59]=0.2,s[85,60]=0.2 s[86,1]=-1.0,s[86,2]=0.1,s[86,3]=-0.9,s[86,4]=0.0,s[86,5]=-0.6,s[86,6]=0.5,s[86,7]=-1.2,s[86,8]=1.1,s[86,9]=-0.3,s[86,10]=0.8,s[86,11]=-1.1,s[86,12]=0.4,s[86,13]=0.0,s[86,14]=0.7,s[86,15]=0.6 s[86,16]=0.1,s[86,17]=0.4,s[86,18]=0.7,s[86,19]=1.1,s[86,20]=0.9,s[86,21]=0.2,s[86,22]=0.5,s[86,23]=1.1,s[86,24]=0.4,s[86,25]=-1.1,s[86,26]=0.8,s[86,27]=1.0,s[86,28]=0.9,s[86,29]=-0.8,s[86,30]=0.2 s[86,31]=-1.2,s[86,32]=0.5,s[86,33]=0.5,s[86,34]=1.2,s[86,35]=0.0,s[86,36]=-1.0,s[86,37]=-0.9,s[86,38]=-0.5,s[86,39]=-1.0,s[86,40]=-0.8,s[86,41]=-0.5,s[86,42]=1.0,s[86,43]=-0.2,s[86,44]=-1.2,s[86,45]=-0.5 s[86,46]=-0.8,s[86,47]=-0.7,s[86,48]=0.6,s[86,49]=-0.1,s[86,50]=-0.7,s[86,51]=0.9,s[86,52]=1.2,s[86,53]=-0.7,s[86,54]=-0.8,s[86,55]=-1.0,s[86,56]=-0.8,s[86,57]=0.0,s[86,58]=-1.2,s[86,59]=0.4,s[86,60]=-0.3 s[87,1]=-0.2,s[87,2]=1.2,s[87,3]=0.1,s[87,4]=-0.6,s[87,5]=-0.2,s[87,6]=0.6,s[87,7]=-1.2,s[87,8]=-0.1,s[87,9]=0.5,s[87,10]=0.9,s[87,11]=-1.2,s[87,12]=-0.6,s[87,13]=-0.3,s[87,14]=0.3,s[87,15]=-0.6 s[87,16]=0.7,s[87,17]=-1.1,s[87,18]=-0.6,s[87,19]=0.0,s[87,20]=0.6,s[87,21]=-0.9,s[87,22]=0.4,s[87,23]=-0.9,s[87,24]=0.9,s[87,25]=-0.9,s[87,26]=-1.2,s[87,27]=0.0,s[87,28]=0.4,s[87,29]=0.5,s[87,30]=-0.8 s[87,31]=-0.5,s[87,32]=0.2,s[87,33]=-0.6,s[87,34]=-0.6,s[87,35]=-0.1,s[87,36]=0.1,s[87,37]=0.9,s[87,38]=1.2,s[87,39]=0.5,s[87,40]=-0.8,s[87,41]=0.3,s[87,42]=0.5,s[87,43]=0.5,s[87,44]=-0.5,s[87,45]=1.2 s[87,46]=0.3,s[87,47]=0.7,s[87,48]=0.6,s[87,49]=0.3,s[87,50]=-0.5,s[87,51]=0.9,s[87,52]=-0.1,s[87,53]=0.5,s[87,54]=0.2,s[87,55]=-1.2,s[87,56]=-0.5,s[87,57]=-0.6,s[87,58]=-0.6,s[87,59]=0.7,s[87,60]=0.0 s[88,1]=0.2,s[88,2]=0.7,s[88,3]=0.0,s[88,4]=-1.2,s[88,5]=-0.6,s[88,6]=0.0,s[88,7]=-0.7,s[88,8]=1.2,s[88,9]=0.7,s[88,10]=0.4,s[88,11]=0.4,s[88,12]=0.6,s[88,13]=-0.2,s[88,14]=0.6,s[88,15]=-1.1 s[88,16]=0.3,s[88,17]=-0.9,s[88,18]=-0.6,s[88,19]=0.6,s[88,20]=0.5,s[88,21]=-0.5,s[88,22]=-0.7,s[88,23]=0.8,s[88,24]=-0.1,s[88,25]=-1.1,s[88,26]=-0.3,s[88,27]=0.6,s[88,28]=0.8,s[88,29]=-0.8,s[88,30]=-0.2 s[88,31]=-0.8,s[88,32]=0.9,s[88,33]=0.6,s[88,34]=-1.1,s[88,35]=0.4,s[88,36]=0.6,s[88,37]=-1.0,s[88,38]=1.1,s[88,39]=0.1,s[88,40]=0.7,s[88,41]=-0.6,s[88,42]=1.0,s[88,43]=-0.7,s[88,44]=1.1,s[88,45]=0.3 s[88,46]=0.5,s[88,47]=0.8,s[88,48]=0.8,s[88,49]=0.1,s[88,50]=1.2,s[88,51]=-1.0,s[88,52]=0.8,s[88,53]=-0.2,s[88,54]=-0.8,s[88,55]=1.1,s[88,56]=1.1,s[88,57]=-0.9,s[88,58]=0.1,s[88,59]=-1.0,s[88,60]=-0.9 s[89,1]=-0.8,s[89,2]=-1.0,s[89,3]=1.2,s[89,4]=0.6,s[89,5]=-0.5,s[89,6]=-0.3,s[89,7]=-0.2,s[89,8]=-1.0,s[89,9]=-0.7,s[89,10]=-0.2,s[89,11]=-0.6,s[89,12]=-0.4,s[89,13]=-0.3,s[89,14]=-1.0,s[89,15]=0.8 s[89,16]=0.5,s[89,17]=-0.2,s[89,18]=-0.4,s[89,19]=-0.6,s[89,20]=1.2,s[89,21]=-0.9,s[89,22]=-1.1,s[89,23]=0.7,s[89,24]=-0.3,s[89,25]=-0.4,s[89,26]=-0.7,s[89,27]=1.0,s[89,28]=0.2,s[89,29]=-0.5,s[89,30]=-0.6 s[89,31]=0.0,s[89,32]=0.6,s[89,33]=1.1,s[89,34]=0.0,s[89,35]=0.1,s[89,36]=0.5,s[89,37]=0.5,s[89,38]=0.9,s[89,39]=-0.9,s[89,40]=-0.1,s[89,41]=-0.5,s[89,42]=-0.6,s[89,43]=0.1,s[89,44]=-0.3,s[89,45]=-0.1 s[89,46]=-0.3,s[89,47]=-1.1,s[89,48]=-0.3,s[89,49]=0.4,s[89,50]=0.9,s[89,51]=-0.5,s[89,52]=-0.1,s[89,53]=-0.1,s[89,54]=0.2,s[89,55]=1.1,s[89,56]=-1.2,s[89,57]=0.4,s[89,58]=-0.8,s[89,59]=-0.3,s[89,60]=-1.2 s[90,1]=0.6,s[90,2]=-1.2,s[90,3]=-0.6,s[90,4]=-0.8,s[90,5]=-0.1,s[90,6]=-1.0,s[90,7]=0.1,s[90,8]=-0.6,s[90,9]=0.8,s[90,10]=0.9,s[90,11]=-0.4,s[90,12]=0.2,s[90,13]=0.3,s[90,14]=0.0,s[90,15]=0.0 s[90,16]=1.2,s[90,17]=0.1,s[90,18]=0.1,s[90,19]=-0.6,s[90,20]=0.2,s[90,21]=0.9,s[90,22]=-0.3,s[90,23]=0.5,s[90,24]=0.0,s[90,25]=-0.3,s[90,26]=-0.4,s[90,27]=-1.0,s[90,28]=-0.8,s[90,29]=-0.6,s[90,30]=0.0 s[90,31]=0.6,s[90,32]=-0.5,s[90,33]=-0.3,s[90,34]=-0.6,s[90,35]=0.4,s[90,36]=-0.9,s[90,37]=1.1,s[90,38]=0.6,s[90,39]=-0.5,s[90,40]=-1.1,s[90,41]=0.4,s[90,42]=-1.1,s[90,43]=1.1,s[90,44]=-1.2,s[90,45]=0.5 s[90,46]=1.0,s[90,47]=0.6,s[90,48]=1.1,s[90,49]=0.2,s[90,50]=0.4,s[90,51]=0.7,s[90,52]=0.0,s[90,53]=0.0,s[90,54]=0.0,s[90,55]=-1.2,s[90,56]=-0.4,s[90,57]=-0.5,s[90,58]=1.2,s[90,59]=0.5,s[90,60]=-0.4 s[91,1]=-0.5,s[91,2]=0.4,s[91,3]=0.6,s[91,4]=0.2,s[91,5]=0.8,s[91,6]=-0.6,s[91,7]=0.1,s[91,8]=1.0,s[91,9]=-1.0,s[91,10]=0.4,s[91,11]=-0.6,s[91,12]=0.4,s[91,13]=1.0,s[91,14]=-0.7,s[91,15]=-0.5,s[91,16]=1.0,s[91,17]=-0.5,s[91,18]=0.7,s[91,19]=-0.2,s[91,20]=0.4,s[91,21]=0.0,s[91,22]=-1.1,s[91,23]=-1.0,s[91,24]=0.6,s[91,25]=-0.6,s[91,26]=-0.6,s[91,27]=0.2,s[91,28]=0.8,s[91,29]=0.7,s[91,30]=-1.1 s[91,31]=0.8,s[91,32]=0.7,s[91,33]=0.2,s[91,34]=-1.1,s[91,35]=0.1,s[91,36]=0.9,s[91,37]=0.4,s[91,38]=0.5,s[91,39]=-0.1,s[91,40]=0.0,s[91,41]=-1.1,s[91,42]=-0.4,s[91,43]=0.6,s[91,44]=0.9,s[91,45]=1.0,s[91,46]=-0.1,s[91,47]=-0.9,s[91,48]=0.1,s[91,49]=0.6,s[91,50]=-0.8,s[91,51]=-0.9,s[91,52]=0.0,s[91,53]=-0.1,s[91,54]=0.6,s[91,55]=-0.5,s[91,56]=-0.7,s[91,57]=-0.9,s[91,58]=-1.0,s[91,59]=0.2,s[91,60]=-1.1 s[92,1]=0.7,s[92,2]=-0.1,s[92,3]=0.5,s[92,4]=-0.7,s[92,5]=1.1,s[92,6]=-1.2,s[92,7]=-1.0,s[92,8]=-1.1,s[92,9]=-1.2,s[92,10]=0.1,s[92,11]=-0.4,s[92,12]=1.0,s[92,13]=0.0,s[92,14]=-0.1,s[92,15]=-0.4,s[92,16]=-0.1,s[92,17]=0.8,s[92,18]=-0.2,s[92,19]=-0.4,s[92,20]=0.7,s[92,21]=0.8,s[92,22]=0.3,s[92,23]=1.2,s[92,24]=-0.7,s[92,25]=-0.2,s[92,26]=-0.5,s[92,27]=-1.1,s[92,28]=-0.5,s[92,29]=0.7,s[92,30]=0.7 s[92,31]=-1.1,s[92,32]=0.7,s[92,33]=0.5,s[92,34]=-0.7,s[92,35]=-0.2,s[92,36]=0.1,s[92,37]=0.8,s[92,38]=-1.1,s[92,39]=-0.3,s[92,40]=0.0,s[92,41]=-0.3,s[92,42]=-1.0,s[92,43]=0.3,s[92,44]=-1.0,s[92,45]=-0.4,s[92,46]=0.6,s[92,47]=1.1,s[92,48]=-0.3,s[92,49]=-0.3,s[92,50]=-1.2,s[92,51]=0.9,s[92,52]=0.5,s[92,53]=-1.1,s[92,54]=-0.1,s[92,55]=0.1,s[92,56]=-1.2,s[92,57]=0.1,s[92,58]=-1.0,s[92,59]=0.2,s[92,60]=-0.9 s[93,1]=0.0,s[93,2]=0.7,s[93,3]=-0.3,s[93,4]=-0.8,s[93,5]=-1.2,s[93,6]=-0.5,s[93,7]=-0.2,s[93,8]=-1.1,s[93,9]=-0.4,s[93,10]=-0.3,s[93,11]=0.6,s[93,12]=-1.2,s[93,13]=0.0,s[93,14]=0.1,s[93,15]=1.2,s[93,16]=0.2,s[93,17]=0.8,s[93,18]=1.2,s[93,19]=-0.6,s[93,20]=0.6,s[93,21]=1.1,s[93,22]=1.0,s[93,23]=0.2,s[93,24]=0.3,s[93,25]=-1.0,s[93,26]=0.9,s[93,27]=-0.4,s[93,28]=-1.1,s[93,29]=1.0,s[93,30]=0.1 s[93,31]=0.3,s[93,32]=0.4,s[93,33]=-0.8,s[93,34]=-0.3,s[93,35]=0.1,s[93,36]=0.9,s[93,37]=-0.9,s[93,38]=-0.6,s[93,39]=-0.6,s[93,40]=0.4,s[93,41]=-0.7,s[93,42]=-0.3,s[93,43]=0.3,s[93,44]=-0.7,s[93,45]=0.3,s[93,46]=-1.2,s[93,47]=-0.6,s[93,48]=0.4,s[93,49]=0.1,s[93,50]=-0.1,s[93,51]=-1.1,s[93,52]=0.1,s[93,53]=-0.7,s[93,54]=0.2,s[93,55]=-1.1,s[93,56]=0.6,s[93,57]=-0.1,s[93,58]=0.9,s[93,59]=0.5,s[93,60]=-0.5 s[94,1]=-1.0,s[94,2]=-1.0,s[94,3]=-1.2,s[94,4]=-1.0,s[94,5]=0.5,s[94,6]=-0.9,s[94,7]=0.2,s[94,8]=1.0,s[94,9]=0.4,s[94,10]=0.7,s[94,11]=-0.2,s[94,12]=0.3,s[94,13]=1.2,s[94,14]=0.4,s[94,15]=1.0,s[94,16]=0.1,s[94,17]=0.1,s[94,18]=-0.8,s[94,19]=1.0,s[94,20]=0.3,s[94,21]=-0.1,s[94,22]=-0.3,s[94,23]=0.5,s[94,24]=0.5,s[94,25]=0.5,s[94,26]=0.1,s[94,27]=-0.2,s[94,28]=-0.8,s[94,29]=-0.9,s[94,30]=1.0 s[94,31]=0.0,s[94,32]=-0.8,s[94,33]=-0.6,s[94,34]=-1.0,s[94,35]=-0.2,s[94,36]=0.3,s[94,37]=0.0,s[94,38]=0.6,s[94,39]=-0.1,s[94,40]=0.4,s[94,41]=-0.4,s[94,42]=0.1,s[94,43]=-1.2,s[94,44]=1.0,s[94,45]=-0.4,s[94,46]=0.1,s[94,47]=-0.4,s[94,48]=-1.0,s[94,49]=-0.1,s[94,50]=0.8,s[94,51]=-1.1,s[94,52]=-0.4,s[94,53]=-0.5,s[94,54]=0.1,s[94,55]=0.8,s[94,56]=0.6,s[94,57]=0.9,s[94,58]=0.1,s[94,59]=0.2,s[94,60]=-0.4 s[95,1]=0.3,s[95,2]=-0.5,s[95,3]=0.8,s[95,4]=-1.1,s[95,5]=-0.4,s[95,6]=-0.6,s[95,7]=0.4,s[95,8]=-0.1,s[95,9]=-0.5,s[95,10]=-0.5,s[95,11]=1.1,s[95,12]=-1.1,s[95,13]=-0.9,s[95,14]=-0.3,s[95,15]=-0.9,s[95,16]=-0.7,s[95,17]=0.6,s[95,18]=-0.9,s[95,19]=-0.4,s[95,20]=-0.3,s[95,21]=-0.3,s[95,22]=0.5,s[95,23]=0.8,s[95,24]=0.8,s[95,25]=1.0,s[95,26]=-0.7,s[95,27]=-1.1,s[95,28]=0.0,s[95,29]=-1.2,s[95,30]=0.2 s[95,31]=0.2,s[95,32]=0.9,s[95,33]=-1.0,s[95,34]=-1.0,s[95,35]=-1.1,s[95,36]=0.4,s[95,37]=0.6,s[95,38]=1.1,s[95,39]=0.9,s[95,40]=-0.1,s[95,41]=0.1,s[95,42]=0.2,s[95,43]=0.4,s[95,44]=0.5,s[95,45]=0.0,s[95,46]=-1.2,s[95,47]=0.2,s[95,48]=0.7,s[95,49]=-0.3,s[95,50]=-0.8,s[95,51]=-0.1,s[95,52]=0.3,s[95,53]=0.3,s[95,54]=-0.9,s[95,55]=-0.4,s[95,56]=0.5,s[95,57]=0.3,s[95,58]=-0.2,s[95,59]=0.7,s[95,60]=-0.2 s[96,1]=0.1,s[96,2]=0.7,s[96,3]=-0.9,s[96,4]=1.0,s[96,5]=0.1,s[96,6]=1.2,s[96,7]=-0.4,s[96,8]=-1.2,s[96,9]=0.7,s[96,10]=1.2,s[96,11]=1.1,s[96,12]=-0.9,s[96,13]=0.7,s[96,14]=0.4,s[96,15]=-1.1,s[96,16]=0.9,s[96,17]=0.9,s[96,18]=-1.1,s[96,19]=-0.6,s[96,20]=0.6,s[96,21]=-1.2,s[96,22]=-0.8,s[96,23]=-1.2,s[96,24]=0.2,s[96,25]=1.2,s[96,26]=1.1,s[96,27]=-0.8,s[96,28]=-0.7,s[96,29]=0.2,s[96,30]=-0.2 s[96,31]=0.6,s[96,32]=-0.7,s[96,33]=1.1,s[96,34]=0.1,s[96,35]=0.7,s[96,36]=0.7,s[96,37]=0.5,s[96,38]=0.4,s[96,39]=0.1,s[96,40]=0.3,s[96,41]=1.0,s[96,42]=0.0,s[96,43]=-0.9,s[96,44]=-0.3,s[96,45]=0.4,s[96,46]=0.7,s[96,47]=-0.2,s[96,48]=0.7,s[96,49]=-0.6,s[96,50]=-0.2,s[96,51]=0.9,s[96,52]=1.2,s[96,53]=-0.9,s[96,54]=-0.4,s[96,55]=-1.0,s[96,56]=0.0,s[96,57]=0.4,s[96,58]=-0.9,s[96,59]=0.6,s[96,60]=-0.5 s[97,1]=-0.2,s[97,2]=-0.4,s[97,3]=-0.2,s[97,4]=-0.6,s[97,5]=0.7,s[97,6]=-0.8,s[97,7]=-1.0,s[97,8]=-0.7,s[97,9]=-1.1,s[97,10]=-0.1,s[97,11]=-0.7,s[97,12]=1.2,s[97,13]=1.0,s[97,14]=-0.3,s[97,15]=0.6,s[97,16]=-0.4,s[97,17]=-0.7,s[97,18]=1.0,s[97,19]=-0.1,s[97,20]=0.9,s[97,21]=1.1,s[97,22]=0.7,s[97,23]=-0.8,s[97,24]=0.8,s[97,25]=0.9,s[97,26]=-0.3,s[97,27]=-0.6,s[97,28]=0.5,s[97,29]=0.8,s[97,30]=-1.2 s[97,31]=-0.1,s[97,32]=-0.3,s[97,33]=0.3,s[97,34]=-1.1,s[97,35]=-0.1,s[97,36]=-0.9,s[97,37]=0.5,s[97,38]=0.9,s[97,39]=-0.8,s[97,40]=0.5,s[97,41]=-0.4,s[97,42]=-0.2,s[97,43]=0.2,s[97,44]=-0.3,s[97,45]=-0.8,s[97,46]=-0.4,s[97,47]=1.2,s[97,48]=-0.3,s[97,49]=0.4,s[97,50]=-0.2,s[97,51]=0.1,s[97,52]=-0.7,s[97,53]=-0.8,s[97,54]=0.3,s[97,55]=-0.5,s[97,56]=0.5,s[97,57]=-0.4,s[97,58]=0.7,s[97,59]=-0.8,s[97,60]=-0.8 s[98,1]=-0.5,s[98,2]=-0.3,s[98,3]=-0.9,s[98,4]=-1.1,s[98,5]=-0.3,s[98,6]=0.9,s[98,7]=1.0,s[98,8]=-0.5,s[98,9]=0.2,s[98,10]=-1.2,s[98,11]=0.0,s[98,12]=-0.8,s[98,13]=-0.3,s[98,14]=0.8,s[98,15]=1.1,s[98,16]=-0.4,s[98,17]=-0.9,s[98,18]=0.0,s[98,19]=0.9,s[98,20]=0.1,s[98,21]=0.6,s[98,22]=-0.5,s[98,23]=0.6,s[98,24]=-1.0,s[98,25]=-1.1,s[98,26]=-1.1,s[98,27]=-0.5,s[98,28]=-0.6,s[98,29]=0.9,s[98,30]=0.3 s[98,31]=-1.2,s[98,32]=-0.4,s[98,33]=-0.3,s[98,34]=-0.6,s[98,35]=-1.1,s[98,36]=0.1,s[98,37]=-0.1,s[98,38]=0.8,s[98,39]=-0.7,s[98,40]=1.0,s[98,41]=-0.1,s[98,42]=0.6,s[98,43]=-1.2,s[98,44]=-0.6,s[98,45]=0.1,s[98,46]=-1.0,s[98,47]=0.7,s[98,48]=-0.6,s[98,49]=0.4,s[98,50]=-1.2,s[98,51]=-0.7,s[98,52]=-0.6,s[98,53]=-0.9,s[98,54]=0.4,s[98,55]=-0.3,s[98,56]=-0.5,s[98,57]=-0.8,s[98,58]=0.1,s[98,59]=0.8,s[98,60]=-1.2 s[99,1]=0.3,s[99,2]=1.0,s[99,3]=0.3,s[99,4]=0.0,s[99,5]=-0.7,s[99,6]=-0.9,s[99,7]=-0.8,s[99,8]=0.5,s[99,9]=0.8,s[99,10]=-0.8,s[99,11]=-0.5,s[99,12]=0.6,s[99,13]=-0.3,s[99,14]=-0.5,s[99,15]=0.4,s[99,16]=1.2,s[99,17]=-0.1,s[99,18]=0.4,s[99,19]=0.6,s[99,20]=0.5,s[99,21]=0.6,s[99,22]=0.2,s[99,23]=-0.2,s[99,24]=0.7,s[99,25]=1.0,s[99,26]=0.9,s[99,27]=0.4,s[99,28]=0.1,s[99,29]=-0.1,s[99,30]=1.0 s[99,31]=-0.2,s[99,32]=-1.0,s[99,33]=0.5,s[99,34]=-0.8,s[99,35]=-0.8,s[99,36]=0.1,s[99,37]=0.5,s[99,38]=-0.2,s[99,39]=1.2,s[99,40]=-1.0,s[99,41]=0.0,s[99,42]=-0.4,s[99,43]=-0.2,s[99,44]=-0.6,s[99,45]=1.2,s[99,46]=0.3,s[99,47]=-0.3,s[99,48]=-1.1,s[99,49]=-0.2,s[99,50]=-0.3,s[99,51]=1.1,s[99,52]=-1.0,s[99,53]=0.0,s[99,54]=0.9,s[99,55]=0.6,s[99,56]=-1.2,s[99,57]=-0.6,s[99,58]=-0.1,s[99,59]=-0.2,s[99,60]=0.3 s[100,1]=-1.1,s[100,2]=0.5,s[100,3]=0.5,s[100,4]=0.0,s[100,5]=0.9,s[100,6]=-0.8,s[100,7]=0.3,s[100,8]=-0.9,s[100,9]=0.9,s[100,10]=-0.7,s[100,11]=-1.2,s[100,12]=0.5,s[100,13]=-1.2,s[100,14]=-0.1,s[100,15]=0.0,s[100,16]=1.1,s[100,17]=-0.9,s[100,18]=-1.1,s[100,19]=-0.9,s[100,20]=0.0,s[100,21]=-0.3,s[100,22]=-0.1,s[100,23]=1.2,s[100,24]=-1.2,s[100,25]=0.8,s[100,26]=0.5,s[100,27]=0.4,s[100,28]=-0.5,s[100,29]=0.6,s[100,30]=0.3 s[100,31]=-0.3,s[100,32]=-0.3,s[100,33]=-0.5,s[100,34]=-0.9,s[100,35]=-0.9,s[100,36]=0.7,s[100,37]=0.3,s[100,38]=-0.3,s[100,39]=-0.2,s[100,40]=-1.0,s[100,41]=-0.7,s[100,42]=0.1,s[100,43]=0.2,s[100,44]=0.4,s[100,45]=0.2,s[100,46]=1.1,s[100,47]=-1.2,s[100,48]=0.3,s[100,49]=-0.3,s[100,50]=0.2,s[100,51]=0.9,s[100,52]=0.7,s[100,53]=-0.6,s[100,54]=0.9,s[100,55]=-1.2,s[100,56]=1.2,s[100,57]=0.6,s[100,58]=0.3,s[100,59]=-0.5,s[100,60]=-0.1 s[101,1]=0.8,s[101,2]=-0.3,s[101,3]=-0.4,s[101,4]=-1.1,s[101,5]=-0.2,s[101,6]=0.4,s[101,7]=0.5,s[101,8]=-0.1,s[101,9]=-0.1,s[101,10]=0.4,s[101,11]=0.6,s[101,12]=0.1,s[101,13]=-1.0,s[101,14]=0.2,s[101,15]=0.8,s[101,16]=0.8,s[101,17]=1.2,s[101,18]=-1.0,s[101,19]=0.1,s[101,20]=0.0,s[101,21]=-0.1,s[101,22]=-0.2,s[101,23]=-1.1,s[101,24]=-0.2,s[101,25]=-0.9,s[101,26]=0.0,s[101,27]=-0.7,s[101,28]=-1.1,s[101,29]=0.8,s[101,30]=0.8 s[101,31]=-0.6,s[101,32]=-1.1,s[101,33]=0.0,s[101,34]=-1.2,s[101,35]=1.2,s[101,36]=-1.2,s[101,37]=-1.0,s[101,38]=1.0,s[101,39]=-0.7,s[101,40]=0.2,s[101,41]=-0.1,s[101,42]=-0.1,s[101,43]=-0.2,s[101,44]=-0.5,s[101,45]=0.0,s[101,46]=0.9,s[101,47]=0.1,s[101,48]=1.0,s[101,49]=0.0,s[101,50]=-0.4,s[101,51]=-0.3,s[101,52]=1.2,s[101,53]=-0.3,s[101,54]=1.0,s[101,55]=1.2,s[101,56]=-0.4,s[101,57]=0.0,s[101,58]=-0.5,s[101,59]=1.1,s[101,60]=-0.6 s[102,1]=0.9,s[102,2]=-0.1,s[102,3]=-1.0,s[102,4]=-0.3,s[102,5]=-0.3,s[102,6]=-0.4,s[102,7]=0.4,s[102,8]=-0.2,s[102,9]=0.8,s[102,10]=-0.1,s[102,11]=-0.7,s[102,12]=0.3,s[102,13]=1.2,s[102,14]=0.3,s[102,15]=0.8,s[102,16]=-0.7,s[102,17]=-0.8,s[102,18]=0.3,s[102,19]=0.7,s[102,20]=-1.2,s[102,21]=-0.7,s[102,22]=-0.9,s[102,23]=-0.7,s[102,24]=-1.0,s[102,25]=0.8,s[102,26]=0.2,s[102,27]=0.4,s[102,28]=-0.9,s[102,29]=0.8,s[102,30]=0.7 s[102,31]=0.1,s[102,32]=0.2,s[102,33]=0.0,s[102,34]=-1.1,s[102,35]=-0.1,s[102,36]=1.1,s[102,37]=-0.6,s[102,38]=0.0,s[102,39]=0.9,s[102,40]=0.1,s[102,41]=-1.0,s[102,42]=1.0,s[102,43]=0.4,s[102,44]=-1.1,s[102,45]=-0.5,s[102,46]=0.7,s[102,47]=-0.9,s[102,48]=0.4,s[102,49]=0.3,s[102,50]=0.0,s[102,51]=0.1,s[102,52]=0.5,s[102,53]=-1.2,s[102,54]=-0.4,s[102,55]=-1.2,s[102,56]=1.2,s[102,57]=-0.8,s[102,58]=-1.2,s[102,59]=-1.2,s[102,60]=0.0 s[103,1]=1.1,s[103,2]=-1.0,s[103,3]=-1.1,s[103,4]=1.1,s[103,5]=0.6,s[103,6]=0.1,s[103,7]=-0.9,s[103,8]=-0.6,s[103,9]=0.4,s[103,10]=0.1,s[103,11]=-0.4,s[103,12]=0.2,s[103,13]=0.0,s[103,14]=0.6,s[103,15]=0.1,s[103,16]=0.7,s[103,17]=-0.7,s[103,18]=0.5,s[103,19]=-1.0,s[103,20]=-0.7,s[103,21]=0.7,s[103,22]=0.7,s[103,23]=0.0,s[103,24]=-0.6,s[103,25]=0.8,s[103,26]=-0.1,s[103,27]=-1.1,s[103,28]=-0.3,s[103,29]=0.6,s[103,30]=0.5 s[103,31]=1.1,s[103,32]=0.9,s[103,33]=0.7,s[103,34]=-0.2,s[103,35]=-0.8,s[103,36]=0.7,s[103,37]=-0.8,s[103,38]=-0.2,s[103,39]=1.0,s[103,40]=0.4,s[103,41]=-0.7,s[103,42]=0.8,s[103,43]=0.4,s[103,44]=0.7,s[103,45]=0.3,s[103,46]=0.1,s[103,47]=-0.4,s[103,48]=-0.2,s[103,49]=0.9,s[103,50]=-1.2,s[103,51]=-0.6,s[103,52]=-0.8,s[103,53]=-0.5,s[103,54]=0.2,s[103,55]=1.1,s[103,56]=-0.9,s[103,57]=0.1,s[103,58]=-1.0,s[103,59]=0.0,s[103,60]=-0.5 s[104,1]=0.2,s[104,2]=-0.5,s[104,3]=0.0,s[104,4]=-0.7,s[104,5]=0.6,s[104,6]=-0.3,s[104,7]=0.6,s[104,8]=-0.4,s[104,9]=0.5,s[104,10]=-0.6,s[104,11]=-1.0,s[104,12]=-0.1,s[104,13]=-1.1,s[104,14]=-0.4,s[104,15]=-1.2,s[104,16]=0.6,s[104,17]=1.0,s[104,18]=0.3,s[104,19]=0.8,s[104,20]=0.7,s[104,21]=0.3,s[104,22]=-0.3,s[104,23]=-0.3,s[104,24]=-1.2,s[104,25]=0.8,s[104,26]=-1.1,s[104,27]=0.4,s[104,28]=1.2,s[104,29]=0.4,s[104,30]=0.3 s[104,31]=-0.4,s[104,32]=0.0,s[104,33]=0.3,s[104,34]=-0.9,s[104,35]=-1.1,s[104,36]=-0.7,s[104,37]=0.7,s[104,38]=-1.1,s[104,39]=-0.8,s[104,40]=-0.6,s[104,41]=-0.1,s[104,42]=1.0,s[104,43]=0.8,s[104,44]=-0.7,s[104,45]=0.3,s[104,46]=1.1,s[104,47]=-0.9,s[104,48]=0.3,s[104,49]=0.6,s[104,50]=-0.8,s[104,51]=-0.3,s[104,52]=0.4,s[104,53]=0.3,s[104,54]=-0.2,s[104,55]=1.2,s[104,56]=0.1,s[104,57]=0.2,s[104,58]=-0.3,s[104,59]=-0.1,s[104,60]=0.0 s[105,1]=-1.1,s[105,2]=-0.4,s[105,3]=-0.9,s[105,4]=-0.6,s[105,5]=-0.3,s[105,6]=0.7,s[105,7]=0.7,s[105,8]=-0.1,s[105,9]=-1.2,s[105,10]=0.9,s[105,11]=-0.2,s[105,12]=0.8,s[105,13]=-0.9,s[105,14]=0.2,s[105,15]=1.2,s[105,16]=-0.7,s[105,17]=0.7,s[105,18]=0.2,s[105,19]=0.2,s[105,20]=-1.1,s[105,21]=0.3,s[105,22]=1.1,s[105,23]=-0.9,s[105,24]=0.5,s[105,25]=0.1,s[105,26]=-0.8,s[105,27]=0.8,s[105,28]=0.0,s[105,29]=-0.6,s[105,30]=0.1 s[105,31]=-1.0,s[105,32]=0.8,s[105,33]=-0.9,s[105,34]=-1.0,s[105,35]=-0.4,s[105,36]=0.6,s[105,37]=-0.3,s[105,38]=1.2,s[105,39]=0.0,s[105,40]=-0.3,s[105,41]=1.2,s[105,42]=1.2,s[105,43]=0.9,s[105,44]=-0.1,s[105,45]=0.0,s[105,46]=-0.8,s[105,47]=-0.7,s[105,48]=-0.9,s[105,49]=-0.4,s[105,50]=0.5,s[105,51]=-0.4,s[105,52]=-0.1,s[105,53]=-1.1,s[105,54]=1.2,s[105,55]=-0.8,s[105,56]=-1.0,s[105,57]=-0.6,s[105,58]=-1.2,s[105,59]=0.3,s[105,60]=-0.4 s[106,1]=0.0,s[106,2]=0.4,s[106,3]=0.9,s[106,4]=0.1,s[106,5]=0.7,s[106,6]=0.0,s[106,7]=1.1,s[106,8]=-1.1,s[106,9]=-0.8,s[106,10]=-1.2,s[106,11]=0.8,s[106,12]=-1.1,s[106,13]=0.6,s[106,14]=1.0,s[106,15]=0.9,s[106,16]=-0.2,s[106,17]=-0.1,s[106,18]=0.1,s[106,19]=0.9,s[106,20]=1.2,s[106,21]=0.3,s[106,22]=0.4,s[106,23]=-0.2,s[106,24]=-0.2,s[106,25]=1.2,s[106,26]=0.6,s[106,27]=-0.8,s[106,28]=-1.2,s[106,29]=0.1,s[106,30]=-1.1 s[106,31]=0.0,s[106,32]=-0.6,s[106,33]=-1.0,s[106,34]=-0.1,s[106,35]=0.8,s[106,36]=1.1,s[106,37]=0.4,s[106,38]=0.6,s[106,39]=-0.5,s[106,40]=-0.2,s[106,41]=-0.1,s[106,42]=-1.0,s[106,43]=0.4,s[106,44]=0.6,s[106,45]=-0.6,s[106,46]=0.3,s[106,47]=0.1,s[106,48]=0.9,s[106,49]=0.4,s[106,50]=1.2,s[106,51]=-1.0,s[106,52]=-0.8,s[106,53]=-0.3,s[106,54]=-0.1,s[106,55]=0.2,s[106,56]=-0.3,s[106,57]=-0.4,s[106,58]=0.0,s[106,59]=0.9,s[106,60]=0.6 s[107,1]=1.0,s[107,2]=-0.9,s[107,3]=0.8,s[107,4]=0.9,s[107,5]=0.0,s[107,6]=0.1,s[107,7]=0.9,s[107,8]=0.4,s[107,9]=-1.1,s[107,10]=-0.6,s[107,11]=-0.3,s[107,12]=1.1,s[107,13]=0.7,s[107,14]=-0.7,s[107,15]=0.8,s[107,16]=-1.2,s[107,17]=0.4,s[107,18]=-0.1,s[107,19]=-1.0,s[107,20]=0.2,s[107,21]=-0.3,s[107,22]=-1.2,s[107,23]=-1.0,s[107,24]=0.9,s[107,25]=-0.7,s[107,26]=-0.8,s[107,27]=0.7,s[107,28]=1.0,s[107,29]=0.2,s[107,30]=0.7 s[107,31]=0.6,s[107,32]=-0.3,s[107,33]=-0.2,s[107,34]=0.8,s[107,35]=0.1,s[107,36]=-0.6,s[107,37]=-0.2,s[107,38]=-0.4,s[107,39]=0.7,s[107,40]=-1.0,s[107,41]=0.4,s[107,42]=-0.7,s[107,43]=-1.2,s[107,44]=-0.4,s[107,45]=-0.2,s[107,46]=1.0,s[107,47]=-1.0,s[107,48]=-0.5,s[107,49]=-1.2,s[107,50]=0.7,s[107,51]=0.7,s[107,52]=0.1,s[107,53]=-1.2,s[107,54]=1.1,s[107,55]=-0.5,s[107,56]=1.0,s[107,57]=-0.9,s[107,58]=0.3,s[107,59]=-0.3,s[107,60]=-0.8 s[108,1]=-0.8,s[108,2]=1.2,s[108,3]=1.1,s[108,4]=-0.9,s[108,5]=1.1,s[108,6]=0.2,s[108,7]=-0.2,s[108,8]=-0.1,s[108,9]=0.5,s[108,10]=-0.7,s[108,11]=-0.3,s[108,12]=-0.3,s[108,13]=0.4,s[108,14]=0.4,s[108,15]=0.1,s[108,16]=0.1,s[108,17]=-0.1,s[108,18]=-0.2,s[108,19]=1.0,s[108,20]=-0.7,s[108,21]=0.2,s[108,22]=0.5,s[108,23]=0.2,s[108,24]=-0.6,s[108,25]=-1.0,s[108,26]=-1.1,s[108,27]=0.2,s[108,28]=-1.0,s[108,29]=-0.2,s[108,30]=-1.1 s[108,31]=0.4,s[108,32]=1.2,s[108,33]=0.0,s[108,34]=-0.9,s[108,35]=-0.6,s[108,36]=-0.7,s[108,37]=0.4,s[108,38]=1.2,s[108,39]=-0.7,s[108,40]=0.6,s[108,41]=-0.1,s[108,42]=1.0,s[108,43]=-0.5,s[108,44]=0.6,s[108,45]=-0.3,s[108,46]=1.0,s[108,47]=-0.1,s[108,48]=1.2,s[108,49]=-0.8,s[108,50]=-0.5,s[108,51]=-0.1,s[108,52]=-1.0,s[108,53]=0.0,s[108,54]=-1.2,s[108,55]=-0.2,s[108,56]=-1.1,s[108,57]=0.1,s[108,58]=0.6,s[108,59]=0.7,s[108,60]=-0.6 s[109,1]=0.3,s[109,2]=0.7,s[109,3]=-0.9,s[109,4]=-1.0,s[109,5]=-0.2,s[109,6]=0.7,s[109,7]=-0.5,s[109,8]=0.7,s[109,9]=0.8,s[109,10]=0.9,s[109,11]=-0.6,s[109,12]=-1.2,s[109,13]=1.1,s[109,14]=-0.4,s[109,15]=0.9,s[109,16]=1.0,s[109,17]=-1.1,s[109,18]=0.3,s[109,19]=0.6,s[109,20]=0.2,s[109,21]=0.9,s[109,22]=-0.1,s[109,23]=-0.7,s[109,24]=-0.4,s[109,25]=-0.8,s[109,26]=-0.4,s[109,27]=-0.1,s[109,28]=-0.6,s[109,29]=0.1,s[109,30]=1.0 s[109,31]=-0.7,s[109,32]=-1.1,s[109,33]=0.8,s[109,34]=0.0,s[109,35]=-0.7,s[109,36]=-0.2,s[109,37]=-1.2,s[109,38]=1.2,s[109,39]=-1.1,s[109,40]=0.1,s[109,41]=1.2,s[109,42]=-0.5,s[109,43]=0.7,s[109,44]=-1.1,s[109,45]=-0.6,s[109,46]=0.1,s[109,47]=-1.0,s[109,48]=-0.3,s[109,49]=0.7,s[109,50]=0.0,s[109,51]=-0.6,s[109,52]=-0.6,s[109,53]=-1.0,s[109,54]=-1.0,s[109,55]=0.5,s[109,56]=0.3,s[109,57]=-1.0,s[109,58]=-0.9,s[109,59]=-1.1,s[109,60]=-0.6 s[110,1]=-0.3,s[110,2]=-1.2,s[110,3]=0.9,s[110,4]=-1.2,s[110,5]=-0.6,s[110,6]=-0.4,s[110,7]=-1.1,s[110,8]=1.0,s[110,9]=0.9,s[110,10]=-0.6,s[110,11]=-0.5,s[110,12]=0.1,s[110,13]=-0.6,s[110,14]=0.2,s[110,15]=0.0,s[110,16]=0.7,s[110,17]=0.7,s[110,18]=0.4,s[110,19]=0.1,s[110,20]=0.0,s[110,21]=0.8,s[110,22]=1.0,s[110,23]=0.9,s[110,24]=0.0,s[110,25]=0.6,s[110,26]=-0.9,s[110,27]=-0.8,s[110,28]=0.1,s[110,29]=0.6,s[110,30]=-0.8 s[110,31]=1.0,s[110,32]=1.1,s[110,33]=-0.2,s[110,34]=-1.1,s[110,35]=0.6,s[110,36]=0.3,s[110,37]=-1.1,s[110,38]=0.7,s[110,39]=-0.8,s[110,40]=-0.8,s[110,41]=-0.3,s[110,42]=-0.1,s[110,43]=-0.3,s[110,44]=-0.4,s[110,45]=0.6,s[110,46]=0.1,s[110,47]=-0.4,s[110,48]=-1.1,s[110,49]=0.8,s[110,50]=-0.5,s[110,51]=-0.5,s[110,52]=-1.1,s[110,53]=-1.2,s[110,54]=-0.1,s[110,55]=0.4,s[110,56]=1.2,s[110,57]=1.1,s[110,58]=0.8,s[110,59]=0.0,s[110,60]=-1.0 s[111,1]=1.2,s[111,2]=0.8,s[111,3]=0.4,s[111,4]=-1.1,s[111,5]=1.0,s[111,6]=-1.2,s[111,7]=-0.4,s[111,8]=-0.9,s[111,9]=-0.3,s[111,10]=-0.4,s[111,11]=1.1,s[111,12]=1.0,s[111,13]=0.7,s[111,14]=0.9,s[111,15]=-0.7,s[111,16]=-0.5,s[111,17]=-0.6,s[111,18]=0.0,s[111,19]=1.2,s[111,20]=-0.9,s[111,21]=-0.6,s[111,22]=-1.0,s[111,23]=1.1,s[111,24]=1.1,s[111,25]=-0.2,s[111,26]=-0.4,s[111,27]=-0.8,s[111,28]=-0.3,s[111,29]=0.2,s[111,30]=0.9 s[111,31]=-0.9,s[111,32]=-1.0,s[111,33]=-0.2,s[111,34]=-0.8,s[111,35]=-0.7,s[111,36]=-0.6,s[111,37]=0.7,s[111,38]=-0.7,s[111,39]=-1.1,s[111,40]=-0.4,s[111,41]=-1.1,s[111,42]=-1.1,s[111,43]=1.2,s[111,44]=1.0,s[111,45]=0.8,s[111,46]=0.8,s[111,47]=-1.0,s[111,48]=-1.1,s[111,49]=0.9,s[111,50]=-0.4,s[111,51]=-0.9,s[111,52]=0.6,s[111,53]=-0.5,s[111,54]=-0.7,s[111,55]=-0.9,s[111,56]=0.5,s[111,57]=0.4,s[111,58]=1.1,s[111,59]=1.2,s[111,60]=-0.8 s[112,1]=1.0,s[112,2]=0.6,s[112,3]=-0.2,s[112,4]=-1.1,s[112,5]=0.3,s[112,6]=-0.8,s[112,7]=0.1,s[112,8]=-0.7,s[112,9]=0.9,s[112,10]=-0.1,s[112,11]=-1.1,s[112,12]=-1.1,s[112,13]=0.7,s[112,14]=0.4,s[112,15]=-0.2,s[112,16]=0.4,s[112,17]=0.7,s[112,18]=0.9,s[112,19]=-0.4,s[112,20]=0.6,s[112,21]=-0.9,s[112,22]=-0.1,s[112,23]=0.6,s[112,24]=-0.8,s[112,25]=0.6,s[112,26]=-0.7,s[112,27]=-1.2,s[112,28]=-0.6,s[112,29]=-0.2,s[112,30]=-0.7 s[112,31]=-0.1,s[112,32]=-0.3,s[112,33]=0.0,s[112,34]=0.3,s[112,35]=1.1,s[112,36]=1.2,s[112,37]=-0.1,s[112,38]=1.1,s[112,39]=0.4,s[112,40]=-0.3,s[112,41]=-1.0,s[112,42]=-1.2,s[112,43]=-0.6,s[112,44]=1.1,s[112,45]=-0.5,s[112,46]=-1.1,s[112,47]=-1.2,s[112,48]=0.2,s[112,49]=1.1,s[112,50]=-0.8,s[112,51]=-1.1,s[112,52]=0.0,s[112,53]=0.7,s[112,54]=0.5,s[112,55]=1.1,s[112,56]=-0.9,s[112,57]=1.0,s[112,58]=-0.7,s[112,59]=-0.6,s[112,60]=-0.2 s[113,1]=0.1,s[113,2]=-0.3,s[113,3]=-0.2,s[113,4]=-0.2,s[113,5]=0.3,s[113,6]=-0.8,s[113,7]=-0.2,s[113,8]=1.2,s[113,9]=-0.8,s[113,10]=0.9,s[113,11]=-0.9,s[113,12]=0.0,s[113,13]=-0.6,s[113,14]=0.0,s[113,15]=0.7,s[113,16]=-0.4,s[113,17]=0.3,s[113,18]=-0.8,s[113,19]=-0.8,s[113,20]=-0.2,s[113,21]=0.8,s[113,22]=0.6,s[113,23]=0.7,s[113,24]=1.1,s[113,25]=-0.2,s[113,26]=-0.4,s[113,27]=0.0,s[113,28]=-1.0,s[113,29]=0.6,s[113,30]=-0.4 s[113,31]=-0.2,s[113,32]=-0.2,s[113,33]=-0.6,s[113,34]=0.7,s[113,35]=0.3,s[113,36]=-0.2,s[113,37]=-1.2,s[113,38]=-0.7,s[113,39]=1.1,s[113,40]=0.2,s[113,41]=-0.5,s[113,42]=0.2,s[113,43]=0.2,s[113,44]=1.1,s[113,45]=0.4,s[113,46]=0.8,s[113,47]=0.4,s[113,48]=-0.5,s[113,49]=-1.0,s[113,50]=1.2,s[113,51]=1.1,s[113,52]=0.8,s[113,53]=0.6,s[113,54]=0.7,s[113,55]=-0.6,s[113,56]=-0.7,s[113,57]=-0.6,s[113,58]=-0.2,s[113,59]=0.9,s[113,60]=-1.0 s[114,1]=-1.1,s[114,2]=0.2,s[114,3]=1.1,s[114,4]=-0.8,s[114,5]=0.3,s[114,6]=0.8,s[114,7]=-1.1,s[114,8]=0.3,s[114,9]=0.2,s[114,10]=0.8,s[114,11]=-1.1,s[114,12]=0.1,s[114,13]=-0.1,s[114,14]=-0.2,s[114,15]=0.4,s[114,16]=-0.1,s[114,17]=-0.7,s[114,18]=0.6,s[114,19]=-0.7,s[114,20]=0.0,s[114,21]=-0.8,s[114,22]=0.9,s[114,23]=0.7,s[114,24]=0.4,s[114,25]=0.2,s[114,26]=-0.4,s[114,27]=0.5,s[114,28]=1.0,s[114,29]=-0.1,s[114,30]=0.4 s[114,31]=0.5,s[114,32]=-0.8,s[114,33]=-0.4,s[114,34]=-1.2,s[114,35]=-0.5,s[114,36]=0.8,s[114,37]=0.5,s[114,38]=1.1,s[114,39]=-0.9,s[114,40]=-0.5,s[114,41]=1.1,s[114,42]=-1.2,s[114,43]=-0.5,s[114,44]=-0.9,s[114,45]=-1.0,s[114,46]=-0.3,s[114,47]=1.1,s[114,48]=-0.3,s[114,49]=0.9,s[114,50]=0.0,s[114,51]=0.2,s[114,52]=0.6,s[114,53]=0.2,s[114,54]=0.9,s[114,55]=0.4,s[114,56]=-0.1,s[114,57]=1.2,s[114,58]=-0.1,s[114,59]=0.7,s[114,60]=-0.4 s[115,1]=1.2,s[115,2]=-0.5,s[115,3]=0.1,s[115,4]=0.3,s[115,5]=0.3,s[115,6]=0.4,s[115,7]=0.9,s[115,8]=1.1,s[115,9]=0.1,s[115,10]=0.0,s[115,11]=-0.2,s[115,12]=0.0,s[115,13]=-1.1,s[115,14]=-0.5,s[115,15]=0.1,s[115,16]=-0.6,s[115,17]=0.6,s[115,18]=-0.9,s[115,19]=-1.1,s[115,20]=-0.2,s[115,21]=-0.8,s[115,22]=-1.2,s[115,23]=-0.1,s[115,24]=-0.1,s[115,25]=-1.0,s[115,26]=0.5,s[115,27]=0.9,s[115,28]=-0.1,s[115,29]=1.1,s[115,30]=-0.1 s[115,31]=0.2,s[115,32]=1.2,s[115,33]=1.1,s[115,34]=0.1,s[115,35]=1.0,s[115,36]=-0.2,s[115,37]=-0.7,s[115,38]=-1.1,s[115,39]=0.2,s[115,40]=0.0,s[115,41]=-0.3,s[115,42]=0.2,s[115,43]=0.4,s[115,44]=-1.2,s[115,45]=-1.2,s[115,46]=-0.2,s[115,47]=0.5,s[115,48]=-1.1,s[115,49]=0.3,s[115,50]=0.0,s[115,51]=0.3,s[115,52]=0.7,s[115,53]=0.5,s[115,54]=-0.1,s[115,55]=-0.6,s[115,56]=0.0,s[115,57]=0.8,s[115,58]=0.1,s[115,59]=0.4,s[115,60]=-1.0 s[116,1]=-0.9,s[116,2]=-0.7,s[116,3]=-0.8,s[116,4]=0.6,s[116,5]=-1.1,s[116,6]=0.1,s[116,7]=0.9,s[116,8]=0.0,s[116,9]=0.8,s[116,10]=0.6,s[116,11]=0.2,s[116,12]=-1.0,s[116,13]=0.2,s[116,14]=-0.7,s[116,15]=-0.2,s[116,16]=1.0,s[116,17]=-0.6,s[116,18]=1.0,s[116,19]=0.1,s[116,20]=0.0,s[116,21]=-0.3,s[116,22]=1.1,s[116,23]=0.5,s[116,24]=0.5,s[116,25]=0.0,s[116,26]=-0.8,s[116,27]=-1.0,s[116,28]=-1.0,s[116,29]=0.7,s[116,30]=0.8 s[116,31]=0.0,s[116,32]=0.3,s[116,33]=0.0,s[116,34]=0.1,s[116,35]=-0.5,s[116,36]=-0.6,s[116,37]=0.2,s[116,38]=-0.1,s[116,39]=-1.0,s[116,40]=-0.7,s[116,41]=0.6,s[116,42]=0.8,s[116,43]=-0.2,s[116,44]=0.2,s[116,45]=0.3,s[116,46]=-1.1,s[116,47]=0.3,s[116,48]=-0.2,s[116,49]=-0.3,s[116,50]=-1.1,s[116,51]=-1.0,s[116,52]=0.3,s[116,53]=-0.7,s[116,54]=0.9,s[116,55]=1.2,s[116,56]=1.1,s[116,57]=-0.7,s[116,58]=0.0,s[116,59]=-0.7,s[116,60]=-0.3 s[117,1]=0.0,s[117,2]=1.2,s[117,3]=-1.0,s[117,4]=-0.6,s[117,5]=0.0,s[117,6]=0.6,s[117,7]=-0.6,s[117,8]=1.2,s[117,9]=0.3,s[117,10]=-0.4,s[117,11]=-1.0,s[117,12]=-0.7,s[117,13]=1.2,s[117,14]=-1.1,s[117,15]=0.9,s[117,16]=-0.4,s[117,17]=-0.3,s[117,18]=0.8,s[117,19]=-1.0,s[117,20]=-0.8,s[117,21]=-1.2,s[117,22]=0.3,s[117,23]=-0.8,s[117,24]=0.0,s[117,25]=-1.2,s[117,26]=-1.0,s[117,27]=1.2,s[117,28]=0.1,s[117,29]=0.2,s[117,30]=0.6 s[117,31]=-0.6,s[117,32]=-0.7,s[117,33]=0.2,s[117,34]=-0.4,s[117,35]=1.0,s[117,36]=0.4,s[117,37]=0.0,s[117,38]=0.0,s[117,39]=-0.3,s[117,40]=-0.3,s[117,41]=-1.2,s[117,42]=-1.2,s[117,43]=-1.0,s[117,44]=0.9,s[117,45]=0.1,s[117,46]=0.0,s[117,47]=0.7,s[117,48]=-0.9,s[117,49]=-0.7,s[117,50]=0.3,s[117,51]=-0.7,s[117,52]=-0.2,s[117,53]=0.0,s[117,54]=0.2,s[117,55]=1.2,s[117,56]=-0.3,s[117,57]=1.1,s[117,58]=-0.7,s[117,59]=0.5,s[117,60]=-1.2 s[118,1]=-0.7,s[118,2]=-0.5,s[118,3]=1.2,s[118,4]=0.1,s[118,5]=-1.1,s[118,6]=0.5,s[118,7]=-0.6,s[118,8]=-0.3,s[118,9]=-0.1,s[118,10]=-1.0,s[118,11]=-0.2,s[118,12]=0.0,s[118,13]=-0.2,s[118,14]=0.9,s[118,15]=-0.9,s[118,16]=-0.9,s[118,17]=-0.9,s[118,18]=1.1,s[118,19]=1.0,s[118,20]=0.1,s[118,21]=-0.3,s[118,22]=-1.2,s[118,23]=0.7,s[118,24]=1.2,s[118,25]=-0.8,s[118,26]=-0.1,s[118,27]=0.4,s[118,28]=-1.2,s[118,29]=-0.3,s[118,30]=0.9 s[118,31]=-0.4,s[118,32]=-1.2,s[118,33]=0.5,s[118,34]=-0.8,s[118,35]=1.0,s[118,36]=0.7,s[118,37]=0.0,s[118,38]=1.1,s[118,39]=-0.7,s[118,40]=0.1,s[118,41]=0.2,s[118,42]=-0.9,s[118,43]=-0.7,s[118,44]=-0.9,s[118,45]=0.3,s[118,46]=-0.3,s[118,47]=1.2,s[118,48]=0.3,s[118,49]=-1.2,s[118,50]=-0.5,s[118,51]=0.8,s[118,52]=0.3,s[118,53]=0.3,s[118,54]=0.2,s[118,55]=-0.4,s[118,56]=0.9,s[118,57]=-0.3,s[118,58]=0.3,s[118,59]=0.4,s[118,60]=-0.5 s[119,1]=0.7,s[119,2]=-1.0,s[119,3]=-0.5,s[119,4]=-1.1,s[119,5]=-0.7,s[119,6]=-0.4,s[119,7]=0.2,s[119,8]=0.1,s[119,9]=0.7,s[119,10]=-0.1,s[119,11]=-0.1,s[119,12]=1.1,s[119,13]=-0.7,s[119,14]=-0.2,s[119,15]=0.1,s[119,16]=0.6,s[119,17]=-1.2,s[119,18]=-1.1,s[119,19]=0.4,s[119,20]=1.1,s[119,21]=-0.6,s[119,22]=-1.2,s[119,23]=-0.4,s[119,24]=1.1,s[119,25]=1.1,s[119,26]=1.2,s[119,27]=0.5,s[119,28]=-0.4,s[119,29]=0.0,s[119,30]=-1.1 s[119,31]=-0.1,s[119,32]=-1.2,s[119,33]=-1.2,s[119,34]=-0.6,s[119,35]=-1.0,s[119,36]=0.5,s[119,37]=-1.1,s[119,38]=-0.2,s[119,39]=0.2,s[119,40]=-0.2,s[119,41]=-0.7,s[119,42]=-0.7,s[119,43]=0.8,s[119,44]=0.0,s[119,45]=-0.1,s[119,46]=-1.0,s[119,47]=0.6,s[119,48]=-1.1,s[119,49]=-1.1,s[119,50]=-0.5,s[119,51]=0.2,s[119,52]=-1.2,s[119,53]=1.2,s[119,54]=0.6,s[119,55]=-0.1,s[119,56]=-0.3,s[119,57]=0.2,s[119,58]=-0.6,s[119,59]=-0.5,s[119,60]=0.0 s[120,1]=-0.8,s[120,2]=-0.4,s[120,3]=0.3,s[120,4]=-1.0,s[120,5]=-1.0,s[120,6]=-1.2,s[120,7]=0.1,s[120,8]=0.4,s[120,9]=-0.2,s[120,10]=0.6,s[120,11]=0.6,s[120,12]=0.8,s[120,13]=-0.3,s[120,14]=-1.0,s[120,15]=-1.2,s[120,16]=0.1,s[120,17]=1.1,s[120,18]=-0.7,s[120,19]=0.6,s[120,20]=-0.8,s[120,21]=-0.9,s[120,22]=-0.8,s[120,23]=-0.2,s[120,24]=-0.3,s[120,25]=-1.2,s[120,26]=1.0,s[120,27]=-0.8,s[120,28]=-0.6,s[120,29]=1.2,s[120,30]=-1.1 s[120,31]=0.9,s[120,32]=1.1,s[120,33]=-0.1,s[120,34]=-0.5,s[120,35]=0.3,s[120,36]=1.2,s[120,37]=-0.4,s[120,38]=0.5,s[120,39]=0.1,s[120,40]=-0.6,s[120,41]=0.7,s[120,42]=0.6,s[120,43]=0.6,s[120,44]=1.1,s[120,45]=-1.2,s[120,46]=-0.7,s[120,47]=-0.6,s[120,48]=0.2,s[120,49]=1.1,s[120,50]=-0.8,s[120,51]=-1.0,s[120,52]=-1.0,s[120,53]=-0.7,s[120,54]=1.2,s[120,55]=-0.8,s[120,56]=0.5,s[120,57]=-0.9,s[120,58]=0.2,s[120,59]=0.7,s[120,60]=-1.1 s[121,1]=-0.6,s[121,2]=-0.1,s[121,3]=-0.4,s[121,4]=-1.0,s[121,5]=-0.2,s[121,6]=-0.9,s[121,7]=0.4,s[121,8]=-1.0,s[121,9]=0.9,s[121,10]=-0.6,s[121,11]=1.0,s[121,12]=1.2,s[121,13]=1.1,s[121,14]=0.9,s[121,15]=-0.8,s[121,16]=-0.8,s[121,17]=-1.2,s[121,18]=-0.3,s[121,19]=0.1,s[121,20]=0.7,s[121,21]=-0.1,s[121,22]=-0.3,s[121,23]=0.0,s[121,24]=0.8,s[121,25]=-1.2,s[121,26]=0.5,s[121,27]=0.9,s[121,28]=1.2,s[121,29]=-0.2,s[121,30]=-0.8 s[121,31]=0.3,s[121,32]=1.0,s[121,33]=0.4,s[121,34]=1.2,s[121,35]=-0.9,s[121,36]=-0.2,s[121,37]=-0.2,s[121,38]=-0.3,s[121,39]=1.1,s[121,40]=0.2,s[121,41]=0.2,s[121,42]=-0.4,s[121,43]=0.9,s[121,44]=-0.8,s[121,45]=0.8,s[121,46]=-1.1,s[121,47]=0.0,s[121,48]=1.0,s[121,49]=-0.6,s[121,50]=-1.0,s[121,51]=0.9,s[121,52]=-0.3,s[121,53]=0.8,s[121,54]=-0.6,s[121,55]=-0.8,s[121,56]=0.1,s[121,57]=0.5,s[121,58]=0.1,s[121,59]=1.2,s[121,60]=-0.9 s[122,1]=0.7,s[122,2]=0.9,s[122,3]=-1.0,s[122,4]=-1.2,s[122,5]=-0.1,s[122,6]=-1.2,s[122,7]=0.4,s[122,8]=0.8,s[122,9]=-1.1,s[122,10]=0.3,s[122,11]=-1.0,s[122,12]=0.6,s[122,13]=-0.1,s[122,14]=0.8,s[122,15]=0.3,s[122,16]=-1.1,s[122,17]=0.0,s[122,18]=-0.7,s[122,19]=1.1,s[122,20]=1.1,s[122,21]=0.8,s[122,22]=-1.2,s[122,23]=-0.8,s[122,24]=-0.5,s[122,25]=0.0,s[122,26]=-0.8,s[122,27]=-0.1,s[122,28]=0.2,s[122,29]=0.5,s[122,30]=-0.1 s[122,31]=0.5,s[122,32]=1.2,s[122,33]=0.7,s[122,34]=-1.0,s[122,35]=-1.1,s[122,36]=-1.1,s[122,37]=0.0,s[122,38]=-0.4,s[122,39]=-0.5,s[122,40]=0.9,s[122,41]=0.7,s[122,42]=-1.0,s[122,43]=0.1,s[122,44]=-0.6,s[122,45]=0.8,s[122,46]=0.4,s[122,47]=-0.3,s[122,48]=0.0,s[122,49]=-0.2,s[122,50]=-0.6,s[122,51]=-0.8,s[122,52]=-0.8,s[122,53]=-0.3,s[122,54]=-0.3,s[122,55]=0.7,s[122,56]=-1.0,s[122,57]=-1.1,s[122,58]=-0.6,s[122,59]=1.2,s[122,60]=-0.1 s[123,1]=0.9,s[123,2]=0.1,s[123,3]=0.1,s[123,4]=-1.2,s[123,5]=0.1,s[123,6]=0.7,s[123,7]=-1.0,s[123,8]=-0.6,s[123,9]=0.1,s[123,10]=0.6,s[123,11]=-1.1,s[123,12]=0.8,s[123,13]=-0.1,s[123,14]=0.1,s[123,15]=0.0,s[123,16]=-0.9,s[123,17]=-0.3,s[123,18]=1.1,s[123,19]=-1.0,s[123,20]=-0.9,s[123,21]=-0.9,s[123,22]=-0.7,s[123,23]=-1.0,s[123,24]=-1.1,s[123,25]=-1.2,s[123,26]=-0.8,s[123,27]=-0.1,s[123,28]=-0.2,s[123,29]=-0.7,s[123,30]=-1.2 s[123,31]=1.2,s[123,32]=-0.2,s[123,33]=-1.2,s[123,34]=-0.7,s[123,35]=-0.2,s[123,36]=-0.1,s[123,37]=0.4,s[123,38]=-0.8,s[123,39]=0.0,s[123,40]=1.1,s[123,41]=0.4,s[123,42]=1.1,s[123,43]=-0.7,s[123,44]=1.2,s[123,45]=-0.8,s[123,46]=-1.2,s[123,47]=0.7,s[123,48]=-0.7,s[123,49]=0.1,s[123,50]=1.1,s[123,51]=0.0,s[123,52]=-0.8,s[123,53]=-0.1,s[123,54]=-1.1,s[123,55]=0.9,s[123,56]=-1.2,s[123,57]=-1.2,s[123,58]=0.4,s[123,59]=-0.4,s[123,60]=-1.0 s[124,1]=-0.7,s[124,2]=0.9,s[124,3]=0.9,s[124,4]=-0.8,s[124,5]=1.0,s[124,6]=-1.1,s[124,7]=0.6,s[124,8]=-0.1,s[124,9]=-0.3,s[124,10]=-0.9,s[124,11]=0.1,s[124,12]=1.0,s[124,13]=-0.3,s[124,14]=0.5,s[124,15]=-0.5,s[124,16]=0.3,s[124,17]=1.2,s[124,18]=-0.2,s[124,19]=1.2,s[124,20]=-0.2,s[124,21]=-1.1,s[124,22]=-0.5,s[124,23]=1.0,s[124,24]=-0.9,s[124,25]=-1.0,s[124,26]=-1.1,s[124,27]=0.8,s[124,28]=0.9,s[124,29]=-0.3,s[124,30]=-1.1 s[124,31]=0.1,s[124,32]=-0.1,s[124,33]=-0.4,s[124,34]=0.6,s[124,35]=0.9,s[124,36]=0.5,s[124,37]=0.4,s[124,38]=-1.0,s[124,39]=0.8,s[124,40]=1.0,s[124,41]=-0.5,s[124,42]=-0.5,s[124,43]=1.2,s[124,44]=-1.1,s[124,45]=-0.4,s[124,46]=0.3,s[124,47]=-1.2,s[124,48]=0.6,s[124,49]=0.3,s[124,50]=-0.4,s[124,51]=-0.5,s[124,52]=1.0,s[124,53]=-0.4,s[124,54]=-0.7,s[124,55]=0.6,s[124,56]=-0.7,s[124,57]=-0.1,s[124,58]=-0.4,s[124,59]=-1.1,s[124,60]=-0.4 s[125,1]=-0.1,s[125,2]=-0.2,s[125,3]=-0.6,s[125,4]=-0.3,s[125,5]=0.7,s[125,6]=-0.2,s[125,7]=-0.5,s[125,8]=-0.1,s[125,9]=-0.5,s[125,10]=0.4,s[125,11]=0.7,s[125,12]=1.1,s[125,13]=0.6,s[125,14]=0.5,s[125,15]=1.1,s[125,16]=-0.9,s[125,17]=0.2,s[125,18]=-0.8,s[125,19]=0.7,s[125,20]=1.2,s[125,21]=-0.1,s[125,22]=0.7,s[125,23]=-1.0,s[125,24]=-1.1,s[125,25]=1.0,s[125,26]=-0.2,s[125,27]=0.4,s[125,28]=-0.9,s[125,29]=0.2,s[125,30]=0.8 s[125,31]=0.3,s[125,32]=-0.3,s[125,33]=-0.4,s[125,34]=-1.0,s[125,35]=0.6,s[125,36]=1.0,s[125,37]=0.3,s[125,38]=0.8,s[125,39]=1.1,s[125,40]=1.1,s[125,41]=-1.0,s[125,42]=0.5,s[125,43]=0.4,s[125,44]=-0.5,s[125,45]=0.3,s[125,46]=-0.4,s[125,47]=-0.3,s[125,48]=1.2,s[125,49]=0.8,s[125,50]=-0.3,s[125,51]=-0.1,s[125,52]=-1.0,s[125,53]=0.6,s[125,54]=-0.4,s[125,55]=-0.9,s[125,56]=-0.6,s[125,57]=0.0,s[125,58]=-1.1,s[125,59]=-1.0,s[125,60]=-0.6 s[126,1]=0.2,s[126,2]=1.1,s[126,3]=-0.9,s[126,4]=-0.1,s[126,5]=0.6,s[126,6]=0.2,s[126,7]=1.1,s[126,8]=-0.6,s[126,9]=-0.8,s[126,10]=0.2,s[126,11]=-1.2,s[126,12]=0.4,s[126,13]=-0.1,s[126,14]=-1.2,s[126,15]=-0.5,s[126,16]=-0.6,s[126,17]=-0.7,s[126,18]=0.0,s[126,19]=-0.5,s[126,20]=0.3,s[126,21]=0.1,s[126,22]=1.2,s[126,23]=-0.2,s[126,24]=-0.5,s[126,25]=-1.0,s[126,26]=0.6,s[126,27]=1.2,s[126,28]=1.1,s[126,29]=0.5,s[126,30]=0.1 s[126,31]=0.0,s[126,32]=-0.2,s[126,33]=-0.6,s[126,34]=1.0,s[126,35]=-1.2,s[126,36]=0.2,s[126,37]=-0.4,s[126,38]=0.4,s[126,39]=0.7,s[126,40]=0.7,s[126,41]=-0.8,s[126,42]=0.4,s[126,43]=0.6,s[126,44]=-0.1,s[126,45]=0.7,s[126,46]=-0.9,s[126,47]=1.2,s[126,48]=-0.2,s[126,49]=0.2,s[126,50]=-0.5,s[126,51]=-0.2,s[126,52]=-1.2,s[126,53]=-0.8,s[126,54]=-0.8,s[126,55]=0.7,s[126,56]=-0.9,s[126,57]=-0.1,s[126,58]=0.9,s[126,59]=-1.2,s[126,60]=-0.7 s[127,1]=-0.1,s[127,2]=-0.1,s[127,3]=-0.3,s[127,4]=-0.3,s[127,5]=-0.6,s[127,6]=1.0,s[127,7]=-0.5,s[127,8]=0.4,s[127,9]=-0.3,s[127,10]=-0.8,s[127,11]=0.3,s[127,12]=0.9,s[127,13]=0.3,s[127,14]=0.6,s[127,15]=1.1,s[127,16]=-0.7,s[127,17]=-0.9,s[127,18]=1.1,s[127,19]=1.1,s[127,20]=0.9,s[127,21]=0.1,s[127,22]=0.1,s[127,23]=0.7,s[127,24]=-1.2,s[127,25]=-0.1,s[127,26]=-0.5,s[127,27]=-0.7,s[127,28]=0.5,s[127,29]=0.0,s[127,30]=1.1 s[127,31]=-1.0,s[127,32]=-0.4,s[127,33]=-0.4,s[127,34]=-1.0,s[127,35]=0.9,s[127,36]=-0.9,s[127,37]=-0.9,s[127,38]=0.8,s[127,39]=0.0,s[127,40]=0.6,s[127,41]=-0.5,s[127,42]=0.4,s[127,43]=0.6,s[127,44]=0.7,s[127,45]=1.1,s[127,46]=-0.9,s[127,47]=0.5,s[127,48]=-0.9,s[127,49]=-0.5,s[127,50]=1.1,s[127,51]=0.3,s[127,52]=0.4,s[127,53]=-0.9,s[127,54]=-0.4,s[127,55]=-0.4,s[127,56]=0.9,s[127,57]=-0.7,s[127,58]=-1.2,s[127,59]=-0.5,s[127,60]=1.1 s[128,1]=-0.5,s[128,2]=-0.3,s[128,3]=1.1,s[128,4]=-1.0,s[128,5]=-0.6,s[128,6]=0.8,s[128,7]=0.6,s[128,8]=0.4,s[128,9]=-1.1,s[128,10]=-1.1,s[128,11]=1.1,s[128,12]=0.2,s[128,13]=-1.2,s[128,14]=0.1,s[128,15]=0.8,s[128,16]=0.3,s[128,17]=-0.4,s[128,18]=-0.1,s[128,19]=0.7,s[128,20]=1.1,s[128,21]=-0.3,s[128,22]=-0.1,s[128,23]=-1.0,s[128,24]=0.2,s[128,25]=0.4,s[128,26]=0.5,s[128,27]=1.0,s[128,28]=-0.4,s[128,29]=-0.7,s[128,30]=1.0 s[128,31]=0.4,s[128,32]=-1.1,s[128,33]=-1.2,s[128,34]=-1.2,s[128,35]=0.2,s[128,36]=-0.4,s[128,37]=-0.9,s[128,38]=0.7,s[128,39]=-0.7,s[128,40]=0.5,s[128,41]=1.1,s[128,42]=-1.0,s[128,43]=0.1,s[128,44]=-0.5,s[128,45]=-1.2,s[128,46]=-0.6,s[128,47]=0.4,s[128,48]=0.8,s[128,49]=0.8,s[128,50]=-0.1,s[128,51]=-0.7,s[128,52]=0.8,s[128,53]=0.3,s[128,54]=1.1,s[128,55]=-0.9,s[128,56]=-0.3,s[128,57]=1.1,s[128,58]=0.4,s[128,59]=1.0,s[128,60]=-0.1 s[129,1]=0.4,s[129,2]=-1.1,s[129,3]=1.2,s[129,4]=-0.5,s[129,5]=0.1,s[129,6]=0.9,s[129,7]=-1.0,s[129,8]=-0.9,s[129,9]=0.5,s[129,10]=-1.1,s[129,11]=-0.2,s[129,12]=-0.2,s[129,13]=0.9,s[129,14]=-0.5,s[129,15]=0.7,s[129,16]=-0.4,s[129,17]=-0.2,s[129,18]=0.4,s[129,19]=0.3,s[129,20]=0.8,s[129,21]=-0.7,s[129,22]=-0.5,s[129,23]=0.5,s[129,24]=-0.4,s[129,25]=0.3,s[129,26]=1.1,s[129,27]=-0.2,s[129,28]=1.0,s[129,29]=-0.7,s[129,30]=-0.5 s[129,31]=-0.2,s[129,32]=1.2,s[129,33]=-1.1,s[129,34]=-1.1,s[129,35]=-1.1,s[129,36]=-1.0,s[129,37]=-0.4,s[129,38]=1.2,s[129,39]=-0.5,s[129,40]=0.2,s[129,41]=0.1,s[129,42]=-0.2,s[129,43]=0.1,s[129,44]=0.8,s[129,45]=-1.0,s[129,46]=-1.2,s[129,47]=-0.4,s[129,48]=-0.4,s[129,49]=0.3,s[129,50]=-1.2,s[129,51]=0.7,s[129,52]=0.4,s[129,53]=-0.7,s[129,54]=-0.8,s[129,55]=-1.1,s[129,56]=-0.7,s[129,57]=-0.3,s[129,58]=-0.8,s[129,59]=0.4,s[129,60]=0.2 s[130,1]=-0.6,s[130,2]=-1.0,s[130,3]=1.2,s[130,4]=1.0,s[130,5]=0.6,s[130,6]=-0.5,s[130,7]=1.0,s[130,8]=0.8,s[130,9]=-0.9,s[130,10]=-0.2,s[130,11]=-1.0,s[130,12]=-0.3,s[130,13]=-1.2,s[130,14]=0.1,s[130,15]=-0.2,s[130,16]=-1.2,s[130,17]=-1.0,s[130,18]=-1.2,s[130,19]=0.4,s[130,20]=0.9,s[130,21]=0.7,s[130,22]=-0.6,s[130,23]=-0.5,s[130,24]=1.1,s[130,25]=0.2,s[130,26]=1.2,s[130,27]=0.1,s[130,28]=1.2,s[130,29]=0.7,s[130,30]=0.1 s[130,31]=-0.6,s[130,32]=-0.2,s[130,33]=0.6,s[130,34]=0.2,s[130,35]=-0.7,s[130,36]=1.2,s[130,37]=-1.1,s[130,38]=-0.1,s[130,39]=0.3,s[130,40]=-1.0,s[130,41]=-0.8,s[130,42]=-1.1,s[130,43]=0.9,s[130,44]=0.0,s[130,45]=-0.9,s[130,46]=-1.2,s[130,47]=0.7,s[130,48]=-0.2,s[130,49]=-0.6,s[130,50]=-0.3,s[130,51]=-0.2,s[130,52]=-1.0,s[130,53]=-0.6,s[130,54]=0.6,s[130,55]=-0.5,s[130,56]=-0.3,s[130,57]=0.4,s[130,58]=-1.0,s[130,59]=1.1,s[130,60]=-0.2 s[131,1]=0.2,s[131,2]=-1.1,s[131,3]=-0.4,s[131,4]=0.6,s[131,5]=0.8,s[131,6]=-1.1,s[131,7]=-0.4,s[131,8]=0.0,s[131,9]=0.1,s[131,10]=-0.3,s[131,11]=0.5,s[131,12]=0.6,s[131,13]=0.4,s[131,14]=-0.1,s[131,15]=-0.6,s[131,16]=0.9,s[131,17]=-1.1,s[131,18]=0.6,s[131,19]=-1.2,s[131,20]=-1.1,s[131,21]=0.2,s[131,22]=0.7,s[131,23]=0.5,s[131,24]=-0.6,s[131,25]=-1.0,s[131,26]=0.1,s[131,27]=0.1,s[131,28]=-0.5,s[131,29]=-0.7,s[131,30]=-0.6 s[131,31]=1.0,s[131,32]=-1.1,s[131,33]=-0.9,s[131,34]=1.1,s[131,35]=0.2,s[131,36]=-0.2,s[131,37]=-0.3,s[131,38]=0.9,s[131,39]=0.6,s[131,40]=0.4,s[131,41]=1.2,s[131,42]=-1.0,s[131,43]=-0.7,s[131,44]=0.6,s[131,45]=0.3,s[131,46]=0.0,s[131,47]=0.9,s[131,48]=-0.4,s[131,49]=0.5,s[131,50]=1.1,s[131,51]=1.0,s[131,52]=-0.2,s[131,53]=-0.9,s[131,54]=-0.7,s[131,55]=-1.1,s[131,56]=-0.4,s[131,57]=0.7,s[131,58]=1.2,s[131,59]=-0.9,s[131,60]=0.4 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float ppz = @ppz float pxx = 0 float pyy = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x pyy = y x = x + 0.1*(s[@sd,1] + s[@sd,2]*x + s[@sd,3]*x*x + s[@sd,4]*x*x*x + s[@sd,5]*x*x*y + s[@sd,6]*x*x*ppz + s[@sd,7]*x*y + \ s[@sd,8]*x*y*y + s[@sd,9]*x*y*ppz + s[@sd,10]*x*ppz + s[@sd,11]*x*ppz*ppz + s[@sd,12]*y + s[@sd,13]*y*y + s[@sd,14]*y*y*y + \ s[@sd,15]*y*y*ppz + s[@sd,16]*y*ppz + s[@sd,17]*y*ppz*ppz + s[@sd,18]*ppz +s[@sd,19]*ppz*ppz +s[@sd,20]*ppz*ppz*ppz) y = y + 0.1*(s[@sd,21] +s[@sd,22]*pxx +s[@sd,23]*pxx*pxx +s[@sd,24]*pxx*pxx*pxx +s[@sd,25]*pxx*pxx*y +s[@sd,26]*pxx*pxx*ppz +s[@sd,27]*pxx*y +\ s[@sd,28]*pxx*y*y +s[@sd,29]*pxx*y*ppz +s[@sd,30]*pxx*ppz +s[@sd,31]*pxx*ppz*ppz +s[@sd,32]*y +s[@sd,33]*y*y +s[@sd,34]*y*y*y + \ s[@sd,35]*y*y*ppz +s[@sd,36]*y*ppz +s[@sd,37]*y*ppz*ppz +s[@sd,38]*ppz +s[@sd,39]*ppz*ppz +s[@sd,40]*ppz*ppz*ppz) ppz = ppz + 0.1*(s[@sd,41] +s[@sd,42]*pxx +s[@sd,43]*pxx*pxx +s[@sd,44]*pxx*pxx*pxx +s[@sd,45]*pxx*pxx*pyy +s[@sd,46]*pxx*pxx*ppz +s[@sd,47]*pxx*pyy + \ s[@sd,48]*pxx*pyy*pyy +s[@sd,49]*pxx*pyy*ppz +s[@sd,50]*pxx*ppz +s[@sd,51]*pxx*ppz*ppz +s[@sd,52]*pyy +s[@sd,53]*pyy*pyy +s[@sd,54]*pyy*pyy*pyy + \ s[@sd,55]*pyy*pyy*ppz +s[@sd,56]*pyy*ppz +s[@sd,57]*pyy*ppz*ppz +s[@sd,58]*ppz +s[@sd,59]*ppz*ppz +s[@sd,60]*ppz*ppz*ppz) att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y) + ppz*@pw) float d = @distscale*|pz-(x + sgn*flip(y) + ppz*@pw)| return d endfunc private: float s[132,61] default: title = "Sprott3D_Cubic_ODE" heading text="Sprott 3D cubic attractors" endheading heading text=" x -> x + 0.1*(Cubic in x, y and z)" endheading heading text=" y -> y + 0.1*(Cubic in x, y and z)" endheading heading text=" z -> z + 0.1*(Cubic in x, y and z)" endheading int param v_trapshapesprott3d_Cubic_ODE caption = "Version (Trap Shape Sprott3D_Cubic_ODE)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesprott3d_Cubic_ODE < 100 endparam param sd caption = "Sprott selector" default = 0 enum = "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" \ "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" \ "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" \ "45" "46" "47" "48" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" \ "60" "61" "62" "63" "64" "65" "66" "67" "69" "69" "70" "71" "72" "73" "74" \ "75" "76" "77" "78" "79" "80" "81" "82" "83" "84" "85" "86" "87" "88" "89" \ "90" "91" "92" "93" "94" "95" "96" "97" "98" "99" "100" "101" "102" "103" \ "104" "105" "106" "107" "108" "109" "110" "111" "112" "113" "114" "115" \ "116" "117" "118" "119" "120" "121" "122" "123" "124" "125" "126" "127" \ "128" "129" "130" "131" hint = "Each Sprott selector uses a different strange attractor." endparam heading text = "'Initialize Height' sets the starting z value for the attractor." endheading float param ppz caption = "Initialize Height" default = 0.0 endparam heading text = "'Height weight' determines the weight of the final z value which is added \ to the trap distance." endheading complex param pw caption = "Height weight" default = (0.5,0) endparam float param distscale caption = "Distance scale" default = 2 endparam float param s caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 15 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeSprott4D(common.ulb:TrapShape) { ; This shape uses a Sprott strange attractor.
;

; The Sprott attractors were developed by Julien C. Sprott, and are ; based upon polynomials and linear differential equations of polynomials. public: import "common.ulb" ; Constructor func REB_TrapShapeSprott4D(Generic pparent) TrapShape.TrapShape(pparent) s[0,1]=-0.6,s[0,2]=0.5,s[0,3]=1.0,s[0,4]=-0.6,s[0,5]=0.9,s[0,6]=0.3,s[0,7]=1.0,s[0,8]=0.4,s[0,9]=-0.6,s[0,10]=1.0,s[0,11]=-0.3,s[0,12]=-1.0,s[0,13]=0.3,s[0,14]=-0.4,s[0,15]=0.5,s[0,16]=-0.3,s[0,17]=1.0,s[0,18]=0.0,s[0,19]=0.1,s[0,20]=0.7,s[0,21]=0.3,s[0,22]=0.3,s[0,23]=0.3,s[0,24]=-0.6,s[0,25]=0.7,s[0,26]=0.4,s[0,27]=-0.7,s[0,28]=-0.5,s[0,29]=0.1,s[0,30]=-0.1 s[0,31]=0.0,s[0,32]=-0.1,s[0,33]=0.8,s[0,34]=0.3,s[0,35]=0.3,s[0,36]=-0.1,s[0,37]=-0.3,s[0,38]=0.9,s[0,39]=1.0,s[0,40]=-0.8,s[0,41]=0.6,s[0,42]=-0.6,s[0,43]=-0.4,s[0,44]=0.6,s[0,45]=-0.4,s[0,46]=-0.5,s[0,47]=0.3,s[0,48]=-0.5,s[0,49]=0.5,s[0,50]=1.2,s[0,51]=-0.1,s[0,52]=1.1,s[0,53]=0.3,s[0,54]=-1.2,s[0,55]=1.0,s[0,56]=0.2,s[0,57]=-1.2,s[0,58]=0.3,s[0,59]=-0.5,s[0,60]=0.1 s[1,1]=-0.4,s[1,2]=0.1,s[1,3]=1.1,s[1,4]=0.6,s[1,5]=-1.2,s[1,6]=-0.6,s[1,7]=0.4,s[1,8]=0.4,s[1,9]=0.0,s[1,10]=0.0,s[1,11]=0.2,s[1,12]=-0.9,s[1,13]=-0.8,s[1,14]=-0.3,s[1,15]=-0.2,s[1,16]=0.3,s[1,17]=0.1,s[1,18]=0.3,s[1,19]=-0.4,s[1,20]=0.7,s[1,21]=0.2,s[1,22]=-0.5,s[1,23]=-0.5,s[1,24]=-0.6,s[1,25]=-1.2,s[1,26]=0.4,s[1,27]=0.1,s[1,28]=0.1,s[1,29]=0.3,s[1,30]=-0.3,s[1,31]=0.6,s[1,32]=0.8,s[1,33]=0.0,s[1,34]=1.0,s[1,35]=-1.0,s[1,36]=0.4,s[1,37]=1.2,s[1,38]=0.4,s[1,39]=-0.5,s[1,40]=-0.5,s[1,41]=-0.7,s[1,42]=0.3,s[1,43]=1.1,s[1,44]=-0.4,s[1,45]=-0.3,s[1,46]=0.0,s[1,47]=0.6,s[1,48]=-0.7,s[1,49]=1.0,s[1,50]=0.3,s[1,51]=1.0,s[1,52]=-0.1,s[1,53]=0.1,s[1,54]=1.0,s[1,55]=0.1,s[1,56]=0.4,s[1,57]=0.9,s[1,58]=-0.1,s[1,59]=0.5,s[1,60]=-0.5 s[2,1]=-0.2,s[2,2]=0.6,s[2,3]=0.2,s[2,4]=-0.2,s[2,5]=0.4,s[2,6]=-0.9,s[2,7]=-0.6,s[2,8]=0.9,s[2,9]=-0.6,s[2,10]=0.8,s[2,11]=-0.7,s[2,12]=-0.5,s[2,13]=1.0,s[2,14]=0.4,s[2,15]=1.2,s[2,16]=-0.1,s[2,17]=0.6,s[2,18]=-0.7,s[2,19]=0.8,s[2,20]=1.2,s[2,21]=-0.7,s[2,22]=0.4,s[2,23]=-1.1,s[2,24]=-0.9,s[2,25]=-0.5,s[2,26]=0.7,s[2,27]=-1.1,s[2,28]=0.6,s[2,29]=1.1,s[2,30]=-0.8,s[2,31]=0.0,s[2,32]=-0.5,s[2,33]=0.2,s[2,34]=0.8,s[2,35]=0.6,s[2,36]=0.1,s[2,37]=-0.9,s[2,38]=-1.0,s[2,39]=-0.3,s[2,40]=0.3,s[2,41]=-0.6,s[2,42]=-0.4,s[2,43]=-0.9,s[2,44]=0.1,s[2,45]=-0.2,s[2,46]=0.1,s[2,47]=-0.6,s[2,48]=0.3,s[2,49]=-0.2,s[2,50]=0.4,s[2,51]=-0.1,s[2,52]=0.6,s[2,53]=-0.1,s[2,54]=-0.9,s[2,55]=0.4,s[2,56]=1.0,s[2,57]=0.3,s[2,58]=-0.3,s[2,59]=0.1,s[2,60]=0.4 s[3,1]=-0.1,s[3,2]=0.4,s[3,3]=-1.2,s[3,4]=-0.1,s[3,5]=-0.7,s[3,6]=1.2,s[3,7]=-0.4,s[3,8]=-0.3,s[3,9]=0.0,s[3,10]=-0.3,s[3,11]=-0.2,s[3,12]=-0.2,s[3,13]=-1.0,s[3,14]=0.2,s[3,15]=-1.1,s[3,16]=-0.7,s[3,17]=-0.4,s[3,18]=0.9,s[3,19]=0.1,s[3,20]=1.1,s[3,21]=-0.7,s[3,22]=-0.8,s[3,23]=-0.1,s[3,24]=0.8,s[3,25]=-0.6,s[3,26]=0.6,s[3,27]=-0.6,s[3,28]=-1.1,s[3,29]=0.1,s[3,30]=1.0,s[3,31]=-0.5,s[3,32]=-1.2,s[3,33]=1.2,s[3,34]=1.0,s[3,35]=-0.9,s[3,36]=-0.4,s[3,37]=0.4,s[3,38]=1.2,s[3,39]=-0.9,s[3,40]=0.5,s[3,41]=-0.3,s[3,42]=0.2,s[3,43]=0.8,s[3,44]=1.0,s[3,45]=0.1,s[3,46]=-0.1,s[3,47]=0.0,s[3,48]=-0.1,s[3,49]=0.2,s[3,50]=0.3,s[3,51]=-1.2,s[3,52]=-0.2,s[3,53]=-0.3,s[3,54]=-0.7,s[3,55]=-1.1,s[3,56]=-0.7,s[3,57]=0.4,s[3,58]=-0.5,s[3,59]=-0.5,s[3,60]=-0.9 s[4,1]=-0.1,s[4,2]=0.5,s[4,3]=-0.1,s[4,4]=-0.9,s[4,5]=0.9,s[4,6]=-0.4,s[4,7]=0.5,s[4,8]=-0.7,s[4,9]=-0.3,s[4,10]=0.5,s[4,11]=-0.3,s[4,12]=-0.6,s[4,13]=-0.4,s[4,14]=-0.1,s[4,15]=0.8,s[4,16]=0.4,s[4,17]=1.2,s[4,18]=1.2,s[4,19]=1.2,s[4,20]=0.6,s[4,21]=-0.7,s[4,22]=-0.2,s[4,23]=-0.5,s[4,24]=0.0,s[4,25]=0.4,s[4,26]=0.4,s[4,27]=0.2,s[4,28]=1.0,s[4,29]=0.5,s[4,30]=0.0,s[4,31]=-0.4,s[4,32]=-0.4,s[4,33]=0.3,s[4,34]=0.5,s[4,35]=-0.6,s[4,36]=0.1,s[4,37]=0.4,s[4,38]=-0.3,s[4,39]=-0.5,s[4,40]=0.5,s[4,41]=-0.2,s[4,42]=-0.2,s[4,43]=-0.5,s[4,44]=1.2,s[4,45]=-0.9,s[4,46]=0.0,s[4,47]=1.1,s[4,48]=0.6,s[4,49]=-0.4,s[4,50]=1.2,s[4,51]=0.0,s[4,52]=-0.7,s[4,53]=0.3,s[4,54]=-0.1,s[4,55]=0.4,s[4,56]=0.5,s[4,57]=1.0,s[4,58]=0.6,s[4,59]=0.6,s[4,60]=-0.9 s[5,1]=0.0,s[5,2]=-0.9,s[5,3]=-0.9,s[5,4]=-0.2,s[5,5]=-1.0,s[5,6]=-1.1,s[5,7]=0.5,s[5,8]=0.2,s[5,9]=-0.2,s[5,10]=1.2,s[5,11]=-0.3,s[5,12]=0.0,s[5,13]=1.1,s[5,14]=1.1,s[5,15]=0.4,s[5,16]=-0.2,s[5,17]=0.3,s[5,18]=-1.1,s[5,19]=0.0,s[5,20]=-0.3,s[5,21]=0.6,s[5,22]=0.6,s[5,23]=0.0,s[5,24]=0.6,s[5,25]=0.8,s[5,26]=0.5,s[5,27]=0.1,s[5,28]=-0.4,s[5,29]=-0.2,s[5,30]=0.6,s[5,31]=0.2,s[5,32]=0.1,s[5,33]=-1.1,s[5,34]=0.7,s[5,35]=1.0,s[5,36]=0.8,s[5,37]=-1.0,s[5,38]=-1.0,s[5,39]=0.2,s[5,40]=0.3,s[5,41]=0.5,s[5,42]=-1.2,s[5,43]=-0.6,s[5,44]=0.0,s[5,45]=-0.7,s[5,46]=0.3,s[5,47]=0.1,s[5,48]=0.1,s[5,49]=0.7,s[5,50]=0.9,s[5,51]=-0.6,s[5,52]=0.5,s[5,53]=0.1,s[5,54]=-0.8,s[5,55]=0.4,s[5,56]=-0.9,s[5,57]=0.4,s[5,58]=1.2,s[5,59]=0.1,s[5,60]=-0.1 s[6,1]=0.0,s[6,2]=1.0,s[6,3]=1.2,s[6,4]=-0.2,s[6,5]=-1.2,s[6,6]=0.5,s[6,7]=1.1,s[6,8]=-0.3,s[6,9]=-0.6,s[6,10]=1.1,s[6,11]=0.5,s[6,12]=-0.9,s[6,13]=-0.1,s[6,14]=0.0,s[6,15]=-0.2,s[6,16]=-0.2,s[6,17]=-0.8,s[6,18]=0.6,s[6,19]=-0.5,s[6,20]=0.1,s[6,21]=0.6,s[6,22]=-0.3,s[6,23]=-0.8,s[6,24]=0.4,s[6,25]=-0.5,s[6,26]=-0.3,s[6,27]=0.5,s[6,28]=0.9,s[6,29]=-0.8,s[6,30]=-0.8,s[6,31]=0.5,s[6,32]=0.6,s[6,33]=1.0,s[6,34]=1.0,s[6,35]=-0.7,s[6,36]=1.1,s[6,37]=-0.8,s[6,38]=-0.8,s[6,39]=-0.1,s[6,40]=0.6,s[6,41]=-0.6,s[6,42]=-0.6,s[6,43]=0.0,s[6,44]=0.8,s[6,45]=-1.2,s[6,46]=0.2,s[6,47]=-0.8,s[6,48]=-0.5,s[6,49]=1.0,s[6,50]=1.2,s[6,51]=1.1,s[6,52]=-0.1,s[6,53]=0.0,s[6,54]=-0.5,s[6,55]=0.1,s[6,56]=-0.1,s[6,57]=0.0,s[6,58]=-0.1,s[6,59]=0.2,s[6,60]=0.1 s[7,1]=-0.2,s[7,2]=1.0,s[7,3]=1.0,s[7,4]=-0.7,s[7,5]=0.7,s[7,6]=0.4,s[7,7]=-0.5,s[7,8]=1.0,s[7,9]=-0.7,s[7,10]=-0.7,s[7,11]=-1.1,s[7,12]=-0.2,s[7,13]=-1.0,s[7,14]=-0.7,s[7,15]=-0.5,s[7,16]=0.0,s[7,17]=0.8,s[7,18]=0.6,s[7,19]=0.9,s[7,20]=-0.7,s[7,21]=-0.7,s[7,22]=-0.7,s[7,23]=-1.2,s[7,24]=0.1,s[7,25]=-1.0,s[7,26]=0.5,s[7,27]=0.2,s[7,28]=-0.6,s[7,29]=0.6,s[7,30]=0.6,s[7,31]=0.3,s[7,32]=0.3,s[7,33]=-0.6,s[7,34]=0.2,s[7,35]=1.2,s[7,36]=0.7,s[7,37]=0.7,s[7,38]=-1.0,s[7,39]=-1.2,s[7,40]=0.2,s[7,41]=0.1,s[7,42]=-0.4,s[7,43]=0.8,s[7,44]=-0.1,s[7,45]=0.3,s[7,46]=-0.6,s[7,47]=0.5,s[7,48]=-0.4,s[7,49]=0.7,s[7,50]=-0.8,s[7,51]=-1.2,s[7,52]=0.4,s[7,53]=0.9,s[7,54]=0.9,s[7,55]=0.4,s[7,56]=-0.4,s[7,57]=-1.0,s[7,58]=-1.1,s[7,59]=-0.2,s[7,60]=-0.2 s[8,1]=0.1,s[8,2]=-0.6,s[8,3]=-0.7,s[8,4]=0.2,s[8,5]=-0.7,s[8,6]=0.0,s[8,7]=-0.2,s[8,8]=-1.0,s[8,9]=1.2,s[8,10]=-0.4,s[8,11]=-0.7,s[8,12]=-0.6,s[8,13]=-0.3,s[8,14]=0.6,s[8,15]=0.6,s[8,16]=0.2,s[8,17]=0.9,s[8,18]=0.4,s[8,19]=-0.2,s[8,20]=0.8,s[8,21]=1.2,s[8,22]=-0.2,s[8,23]=0.8,s[8,24]=-0.5,s[8,25]=0.7,s[8,26]=-0.4,s[8,27]=0.7,s[8,28]=-0.3,s[8,29]=1.0,s[8,30]=-0.8,s[8,31]=0.0,s[8,32]=0.8,s[8,33]=-0.5,s[8,34]=0.1,s[8,35]=0.3,s[8,36]=1.1,s[8,37]=0.0,s[8,38]=-0.7,s[8,39]=-1.2,s[8,40]=-1.1,s[8,41]=0.8,s[8,42]=1.0,s[8,43]=1.1,s[8,44]=-0.6,s[8,45]=-1.2,s[8,46]=0.0,s[8,47]=0.4,s[8,48]=0.1,s[8,49]=0.4,s[8,50]=0.2,s[8,51]=1.1,s[8,52]=0.0,s[8,53]=-0.6,s[8,54]=0.4,s[8,55]=0.7,s[8,56]=0.9,s[8,57]=-0.3,s[8,58]=0.4,s[8,59]=0.2,s[8,60]=-1.2 s[9,1]=0.5,s[9,2]=-0.4,s[9,3]=-0.9,s[9,4]=-0.7,s[9,5]=0.0,s[9,6]=-0.4,s[9,7]=-0.5,s[9,8]=0.5,s[9,9]=-0.2,s[9,10]=-0.4,s[9,11]=0.5,s[9,12]=-1.2,s[9,13]=0.1,s[9,14]=-0.8,s[9,15]=0.1,s[9,16]=-0.4,s[9,17]=0.1,s[9,18]=0.9,s[9,19]=0.7,s[9,20]=-0.9,s[9,21]=0.1,s[9,22]=-0.3,s[9,23]=-0.2,s[9,24]=-1.1,s[9,25]=0.5,s[9,26]=0.9,s[9,27]=-1.2,s[9,28]=-0.7,s[9,29]=0.1,s[9,30]=1.0,s[9,31]=0.3,s[9,32]=0.4,s[9,33]=-0.3,s[9,34]=-0.9,s[9,35]=-0.9,s[9,36]=0.2,s[9,37]=-0.9,s[9,38]=-1.2,s[9,39]=0.0,s[9,40]=0.9,s[9,41]=-0.3,s[9,42]=-0.4,s[9,43]=1.0,s[9,44]=0.2,s[9,45]=-0.4,s[9,46]=0.4,s[9,47]=0.2,s[9,48]=1.0,s[9,49]=-0.7,s[9,50]=0.4,s[9,51]=-1.1,s[9,52]=-0.6,s[9,53]=-0.3,s[9,54]=-0.3,s[9,55]=-0.8,s[9,56]=-0.7,s[9,57]=-0.4,s[9,58]=0.5,s[9,59]=-0.8,s[9,60]=1.2 s[10,1]=-0.4,s[10,2]=0.9,s[10,3]=-0.4,s[10,4]=-0.3,s[10,5]=1.2,s[10,6]=-0.9,s[10,7]=1.0,s[10,8]=0.6,s[10,9]=-0.2,s[10,10]=-1.0,s[10,11]=-1.2,s[10,12]=-0.6,s[10,13]=0.7,s[10,14]=0.4,s[10,15]=-1.2,s[10,16]=0.0,s[10,17]=-0.3,s[10,18]=-0.9,s[10,19]=1.0,s[10,20]=-0.1,s[10,21]=1.2,s[10,22]=-1.0,s[10,23]=-1.1,s[10,24]=-0.2,s[10,25]=-0.3,s[10,26]=-0.6,s[10,27]=-0.9,s[10,28]=-0.3,s[10,29]=-0.2,s[10,30]=-0.1,s[10,31]=-0.6,s[10,32]=-0.8,s[10,33]=-0.8,s[10,34]=-1.2,s[10,35]=-0.1,s[10,36]=-1.0,s[10,37]=-1.1,s[10,38]=-1.0,s[10,39]=-1.0,s[10,40]=-0.7,s[10,41]=0.5,s[10,42]=0.5,s[10,43]=0.0,s[10,44]=-0.3,s[10,45]=-0.6,s[10,46]=0.1,s[10,47]=0.0,s[10,48]=0.1,s[10,49]=0.6,s[10,50]=0.7,s[10,51]=-0.1,s[10,52]=-1.1,s[10,53]=1.1,s[10,54]=0.4,s[10,55]=1.2,s[10,56]=1.2,s[10,57]=0.1,s[10,58]=1.2,s[10,59]=0.7,s[10,60]=0.8 s[11,1]=-0.2,s[11,2]=0.1,s[11,3]=-0.9,s[11,4]=0.9,s[11,5]=1.0,s[11,6]=1.1,s[11,7]=0.0,s[11,8]=0.2,s[11,9]=-0.3,s[11,10]=-1.0,s[11,11]=-0.1,s[11,12]=0.3,s[11,13]=0.3,s[11,14]=-0.7,s[11,15]=-0.9,s[11,16]=-0.9,s[11,17]=-0.6,s[11,18]=1.0,s[11,19]=-0.6,s[11,20]=-0.7,s[11,21]=-1.2,s[11,22]=-0.5,s[11,23]=0.0,s[11,24]=0.2,s[11,25]=0.3,s[11,26]=-0.2,s[11,27]=-0.2,s[11,28]=0.6,s[11,29]=-0.3,s[11,30]=1.0,s[11,31]=-0.3,s[11,32]=0.7,s[11,33]=-0.4,s[11,34]=0.5,s[11,35]=-1.0,s[11,36]=-0.7,s[11,37]=-0.9,s[11,38]=0.3,s[11,39]=-1.1,s[11,40]=1.2,s[11,41]=-0.3,s[11,42]=0.8,s[11,43]=0.1,s[11,44]=0.8,s[11,45]=-1.2,s[11,46]=-0.1,s[11,47]=-0.9,s[11,48]=-0.5,s[11,49]=1.2,s[11,50]=-0.8,s[11,51]=0.0,s[11,52]=1.0,s[11,53]=0.3,s[11,54]=0.1,s[11,55]=0.7,s[11,56]=0.8,s[11,57]=1.2,s[11,58]=0.6,s[11,59]=0.0,s[11,60]=0.1 s[12,1]=0.2,s[12,2]=-0.1,s[12,3]=0.6,s[12,4]=-0.1,s[12,5]=-1.2,s[12,6]=-0.9,s[12,7]=-0.9,s[12,8]=-0.9,s[12,9]=0.4,s[12,10]=-0.7,s[12,11]=0.3,s[12,12]=-0.4,s[12,13]=-1.2,s[12,14]=-0.4,s[12,15]=0.8,s[12,16]=-0.4,s[12,17]=1.0,s[12,18]=-0.5,s[12,19]=-1.1,s[12,20]=-0.7,s[12,21]=1.2,s[12,22]=0.4,s[12,23]=0.6,s[12,24]=0.8,s[12,25]=0.3,s[12,26]=0.6,s[12,27]=0.5,s[12,28]=0.3,s[12,29]=-0.8,s[12,30]=-0.9,s[12,31]=0.0,s[12,32]=-0.3,s[12,33]=1.1,s[12,34]=0.5,s[12,35]=-0.4,s[12,36]=-0.9,s[12,37]=0.7,s[12,38]=0.6,s[12,39]=1.1,s[12,40]=-0.6,s[12,41]=0.1,s[12,42]=-0.4,s[12,43]=0.9,s[12,44]=0.8,s[12,45]=-0.1,s[12,46]=0.0,s[12,47]=0.8,s[12,48]=0.8,s[12,49]=0.3,s[12,50]=-0.4,s[12,51]=-0.1,s[12,52]=-0.1,s[12,53]=-0.7,s[12,54]=-0.6,s[12,55]=-0.9,s[12,56]=0.4,s[12,57]=-0.5,s[12,58]=0.5,s[12,59]=0.6,s[12,60]=-0.9 s[13,1]=0.0,s[13,2]=-0.5,s[13,3]=0.5,s[13,4]=-0.5,s[13,5]=0.9,s[13,6]=-0.4,s[13,7]=0.2,s[13,8]=-0.5,s[13,9]=0.3,s[13,10]=-0.2,s[13,11]=-0.1,s[13,12]=-0.9,s[13,13]=-0.3,s[13,14]=0.1,s[13,15]=-1.0,s[13,16]=-0.2,s[13,17]=-0.8,s[13,18]=-0.1,s[13,19]=-1.2,s[13,20]=0.6,s[13,21]=-0.2,s[13,22]=-0.9,s[13,23]=0.4,s[13,24]=-0.3,s[13,25]=-0.6,s[13,26]=0.8,s[13,27]=0.0,s[13,28]=-1.2,s[13,29]=0.1,s[13,30]=1.1,s[13,31]=-0.4,s[13,32]=-0.1,s[13,33]=1.2,s[13,34]=0.1,s[13,35]=0.4,s[13,36]=-0.5,s[13,37]=-0.9,s[13,38]=0.2,s[13,39]=1.0,s[13,40]=-0.7,s[13,41]=0.7,s[13,42]=-0.6,s[13,43]=-0.6,s[13,44]=0.4,s[13,45]=1.1,s[13,46]=0.0,s[13,47]=0.1,s[13,48]=0.4,s[13,49]=-0.2,s[13,50]=0.4,s[13,51]=1.2,s[13,52]=0.7,s[13,53]=-0.4,s[13,54]=0.5,s[13,55]=1.2,s[13,56]=-0.8,s[13,57]=0.2,s[13,58]=-1.1,s[13,59]=0.2,s[13,60]=-0.9 s[14,1]=0.6,s[14,2]=-0.7,s[14,3]=-0.5,s[14,4]=-0.7,s[14,5]=1.0,s[14,6]=0.4,s[14,7]=-0.5,s[14,8]=-1.0,s[14,9]=-0.6,s[14,10]=-0.3,s[14,11]=-0.9,s[14,12]=-1.0,s[14,13]=0.0,s[14,14]=1.2,s[14,15]=-0.5,s[14,16]=0.1,s[14,17]=-0.4,s[14,18]=0.0,s[14,19]=0.5,s[14,20]=-1.0,s[14,21]=0.3,s[14,22]=0.3,s[14,23]=1.2,s[14,24]=0.0,s[14,25]=-0.4,s[14,26]=0.7,s[14,27]=0.5,s[14,28]=1.0,s[14,29]=0.3,s[14,30]=0.6,s[14,31]=0.1,s[14,32]=0.6,s[14,33]=-1.1,s[14,34]=0.2,s[14,35]=-0.8,s[14,36]=1.1,s[14,37]=-0.8,s[14,38]=0.6,s[14,39]=-1.1,s[14,40]=0.8,s[14,41]=0.0,s[14,42]=-0.3,s[14,43]=-0.5,s[14,44]=-0.5,s[14,45]=-0.8,s[14,46]=0.3,s[14,47]=-0.6,s[14,48]=0.1,s[14,49]=0.2,s[14,50]=1.0,s[14,51]=1.0,s[14,52]=-1.0,s[14,53]=1.2,s[14,54]=0.3,s[14,55]=-0.1,s[14,56]=0.3,s[14,57]=0.8,s[14,58]=0.2,s[14,59]=0.1,s[14,60]=0.5 s[15,1]=-0.1,s[15,2]=-1.0,s[15,3]=0.1,s[15,4]=0.8,s[15,5]=0.3,s[15,6]=1.1,s[15,7]=0.1,s[15,8]=-0.3,s[15,9]=0.5,s[15,10]=0.5,s[15,11]=0.7,s[15,12]=0.9,s[15,13]=0.4,s[15,14]=0.5,s[15,15]=-0.3,s[15,16]=0.2,s[15,17]=0.1,s[15,18]=0.1,s[15,19]=0.6,s[15,20]=-1.2,s[15,21]=0.5,s[15,22]=-0.7,s[15,23]=0.7,s[15,24]=-0.6,s[15,25]=0.5,s[15,26]=-0.2,s[15,27]=0.4,s[15,28]=0.1,s[15,29]=0.9,s[15,30]=0.2,s[15,31]=-0.2,s[15,32]=-1.2,s[15,33]=0.9,s[15,34]=-0.1,s[15,35]=-1.1,s[15,36]=0.6,s[15,37]=0.1,s[15,38]=-0.1,s[15,39]=-1.0,s[15,40]=0.4,s[15,41]=0.5,s[15,42]=0.7,s[15,43]=0.3,s[15,44]=0.4,s[15,45]=-0.4,s[15,46]=-0.2,s[15,47]=-0.5,s[15,48]=0.6,s[15,49]=0.1,s[15,50]=-0.8,s[15,51]=0.8,s[15,52]=-0.6,s[15,53]=0.5,s[15,54]=-1.2,s[15,55]=-1.0,s[15,56]=0.3,s[15,57]=1.1,s[15,58]=0.3,s[15,59]=-0.4,s[15,60]=-0.3 s[16,1]=0.1,s[16,2]=-0.2,s[16,3]=-0.7,s[16,4]=-1.1,s[16,5]=-0.4,s[16,6]=0.0,s[16,7]=-0.7,s[16,8]=-0.8,s[16,9]=-0.2,s[16,10]=-0.7,s[16,11]=-0.1,s[16,12]=0.1,s[16,13]=0.0,s[16,14]=0.0,s[16,15]=-1.1,s[16,16]=-0.2,s[16,17]=0.3,s[16,18]=1.2,s[16,19]=0.3,s[16,20]=0.9,s[16,21]=0.9,s[16,22]=-0.6,s[16,23]=0.0,s[16,24]=0.8,s[16,25]=1.0,s[16,26]=0.2,s[16,27]=-0.6,s[16,28]=-1.2,s[16,29]=-0.8,s[16,30]=0.5,s[16,31]=0.0,s[16,32]=-0.3,s[16,33]=-0.6,s[16,34]=-0.2,s[16,35]=-0.9,s[16,36]=0.2,s[16,37]=0.2,s[16,38]=-0.8,s[16,39]=-0.3,s[16,40]=-0.8,s[16,41]=-0.2,s[16,42]=1.0,s[16,43]=0.8,s[16,44]=1.0,s[16,45]=0.3,s[16,46]=0.3,s[16,47]=-0.6,s[16,48]=-1.1,s[16,49]=0.6,s[16,50]=-1.0,s[16,51]=0.2,s[16,52]=0.3,s[16,53]=0.1,s[16,54]=0.4,s[16,55]=1.1,s[16,56]=0.6,s[16,57]=-0.3,s[16,58]=0.1,s[16,59]=0.7,s[16,60]=0.0 s[17,1]=0.0,s[17,2]=0.1,s[17,3]=1.1,s[17,4]=1.1,s[17,5]=0.9,s[17,6]=1.2,s[17,7]=-0.8,s[17,8]=-0.3,s[17,9]=0.6,s[17,10]=0.2,s[17,11]=0.0,s[17,12]=0.0,s[17,13]=0.7,s[17,14]=-1.0,s[17,15]=-0.2,s[17,16]=-0.2,s[17,17]=0.2,s[17,18]=0.4,s[17,19]=0.0,s[17,20]=0.2,s[17,21]=0.2,s[17,22]=0.2,s[17,23]=-1.2,s[17,24]=0.0,s[17,25]=-0.8,s[17,26]=0.8,s[17,27]=1.0,s[17,28]=-1.2,s[17,29]=0.1,s[17,30]=0.0,s[17,31]=-0.2,s[17,32]=-0.8,s[17,33]=-0.3,s[17,34]=1.2,s[17,35]=-0.6,s[17,36]=1.0,s[17,37]=-0.9,s[17,38]=0.5,s[17,39]=-0.6,s[17,40]=-1.1,s[17,41]=-1.1,s[17,42]=-0.1,s[17,43]=-0.4,s[17,44]=0.6,s[17,45]=0.1,s[17,46]=-0.2,s[17,47]=0.1,s[17,48]=-1.1,s[17,49]=-1.1,s[17,50]=-0.5,s[17,51]=0.6,s[17,52]=-0.3,s[17,53]=0.8,s[17,54]=0.2,s[17,55]=0.9,s[17,56]=-0.8,s[17,57]=1.1,s[17,58]=0.7,s[17,59]=0.0,s[17,60]=-0.3 s[18,1]=0.1,s[18,2]=-0.1,s[18,3]=0.8,s[18,4]=1.1,s[18,5]=0.9,s[18,6]=-0.7,s[18,7]=0.7,s[18,8]=1.0,s[18,9]=-0.5,s[18,10]=-0.2,s[18,11]=0.0,s[18,12]=-1.1,s[18,13]=-0.7,s[18,14]=0.5,s[18,15]=0.3,s[18,16]=-0.3,s[18,17]=-0.3,s[18,18]=0.2,s[18,19]=1.2,s[18,20]=0.9,s[18,21]=-0.8,s[18,22]=-0.7,s[18,23]=0.0,s[18,24]=-1.2,s[18,25]=-0.5,s[18,26]=-0.4,s[18,27]=0.2,s[18,28]=1.0,s[18,29]=1.0,s[18,30]=-1.1,s[18,31]=0.1,s[18,32]=0.6,s[18,33]=-0.7,s[18,34]=0.0,s[18,35]=-0.1,s[18,36]=1.1,s[18,37]=0.7,s[18,38]=0.7,s[18,39]=-1.1,s[18,40]=1.2,s[18,41]=-1.2,s[18,42]=0.5,s[18,43]=-0.6,s[18,44]=-0.6,s[18,45]=1.0,s[18,46]=0.0,s[18,47]=-0.2,s[18,48]=0.2,s[18,49]=0.6,s[18,50]=-0.2,s[18,51]=0.0,s[18,52]=0.4,s[18,53]=0.2,s[18,54]=0.3,s[18,55]=1.1,s[18,56]=0.7,s[18,57]=-0.7,s[18,58]=0.2,s[18,59]=0.1,s[18,60]=0.9 s[19,1]=0.6,s[19,2]=0.3,s[19,3]=-0.3,s[19,4]=0.2,s[19,5]=-0.4,s[19,6]=0.7,s[19,7]=0.7,s[19,8]=0.8,s[19,9]=0.6,s[19,10]=1.2,s[19,11]=-0.5,s[19,12]=-1.2,s[19,13]=0.7,s[19,14]=-0.9,s[19,15]=-0.8,s[19,16]=-0.4,s[19,17]=0.7,s[19,18]=0.4,s[19,19]=-0.2,s[19,20]=-0.2,s[19,21]=-0.5,s[19,22]=-0.4,s[19,23]=-0.3,s[19,24]=-0.7,s[19,25]=-0.6,s[19,26]=0.0,s[19,27]=0.1,s[19,28]=0.2,s[19,29]=0.7,s[19,30]=0.9,s[19,31]=0.4,s[19,32]=-0.1,s[19,33]=1.1,s[19,34]=-0.4,s[19,35]=0.3,s[19,36]=0.2,s[19,37]=0.6,s[19,38]=-0.3,s[19,39]=-0.5,s[19,40]=0.3,s[19,41]=0.1,s[19,42]=-0.2,s[19,43]=-0.5,s[19,44]=-0.8,s[19,45]=-0.4,s[19,46]=-0.1,s[19,47]=-0.6,s[19,48]=-0.4,s[19,49]=0.7,s[19,50]=1.1,s[19,51]=0.0,s[19,52]=-0.8,s[19,53]=0.1,s[19,54]=0.0,s[19,55]=-0.2,s[19,56]=0.7,s[19,57]=-1.0,s[19,58]=-0.8,s[19,59]=1.0,s[19,60]=-1.1 s[20,1]=0.3,s[20,2]=0.0,s[20,3]=0.7,s[20,4]=1.0,s[20,5]=-0.8,s[20,6]=0.6,s[20,7]=0.1,s[20,8]=-0.8,s[20,9]=-0.7,s[20,10]=0.7,s[20,11]=0.0,s[20,12]=0.6,s[20,13]=-0.1,s[20,14]=0.1,s[20,15]=-0.1,s[20,16]=-1.1,s[20,17]=0.5,s[20,18]=0.9,s[20,19]=-1.1,s[20,20]=-1.2,s[20,21]=0.6,s[20,22]=1.0,s[20,23]=0.9,s[20,24]=0.7,s[20,25]=-0.2,s[20,26]=-0.3,s[20,27]=1.0,s[20,28]=-0.2,s[20,29]=-0.7,s[20,30]=0.2,s[20,31]=0.2,s[20,32]=0.9,s[20,33]=0.2,s[20,34]=0.5,s[20,35]=1.1,s[20,36]=0.4,s[20,37]=-0.8,s[20,38]=-0.7,s[20,39]=1.2,s[20,40]=0.3,s[20,41]=0.5,s[20,42]=-0.9,s[20,43]=0.9,s[20,44]=0.4,s[20,45]=-0.3,s[20,46]=-1.1,s[20,47]=0.1,s[20,48]=0.9,s[20,49]=-0.1,s[20,50]=-0.9,s[20,51]=0.5,s[20,52]=0.3,s[20,53]=0.5,s[20,54]=-0.1,s[20,55]=-0.5,s[20,56]=-1.1,s[20,57]=-0.7,s[20,58]=-0.7,s[20,59]=-0.2,s[20,60]=0.2 s[21,1]=-0.2,s[21,2]=0.0,s[21,3]=0.9,s[21,4]=0.9,s[21,5]=-0.7,s[21,6]=-0.7,s[21,7]=1.2,s[21,8]=-0.2,s[21,9]=-1.0,s[21,10]=-0.7,s[21,11]=-0.4,s[21,12]=1.1,s[21,13]=1.1,s[21,14]=-1.2,s[21,15]=0.6,s[21,16]=0.3,s[21,17]=0.4,s[21,18]=-0.4,s[21,19]=-0.9,s[21,20]=1.0,s[21,21]=1.2,s[21,22]=0.3,s[21,23]=-1.2,s[21,24]=1.1,s[21,25]=0.8,s[21,26]=0.9,s[21,27]=-1.0,s[21,28]=0.6,s[21,29]=0.4,s[21,30]=-1.0,s[21,31]=0.1,s[21,32]=-0.3,s[21,33]=-0.1,s[21,34]=1.2,s[21,35]=-1.1,s[21,36]=-0.7,s[21,37]=1.0,s[21,38]=-1.1,s[21,39]=-0.5,s[21,40]=-1.2,s[21,41]=-0.9,s[21,42]=0.9,s[21,43]=0.1,s[21,44]=-0.6,s[21,45]=-1.2,s[21,46]=-0.1,s[21,47]=0.0,s[21,48]=-0.3,s[21,49]=1.0,s[21,50]=1.2,s[21,51]=-0.7,s[21,52]=0.0,s[21,53]=-0.1,s[21,54]=-0.8,s[21,55]=-0.9,s[21,56]=0.9,s[21,57]=-0.9,s[21,58]=1.2,s[21,59]=0.1,s[21,60]=-0.6 s[22,1]=-0.1,s[22,2]=-0.2,s[22,3]=-0.1,s[22,4]=-1.0,s[22,5]=0.6,s[22,6]=1.1,s[22,7]=0.1,s[22,8]=-0.5,s[22,9]=0.2,s[22,10]=0.5,s[22,11]=-0.1,s[22,12]=-1.1,s[22,13]=-0.3,s[22,14]=0.4,s[22,15]=0.5,s[22,16]=0.2,s[22,17]=-0.1,s[22,18]=1.0,s[22,19]=0.7,s[22,20]=-1.1,s[22,21]=-0.1,s[22,22]=0.9,s[22,23]=-0.7,s[22,24]=0.1,s[22,25]=-0.6,s[22,26]=-0.7,s[22,27]=-1.1,s[22,28]=-0.7,s[22,29]=-1.0,s[22,30]=-0.8,s[22,31]=0.0,s[22,32]=0.2,s[22,33]=1.2,s[22,34]=-0.8,s[22,35]=0.1,s[22,36]=-1.2,s[22,37]=0.5,s[22,38]=-0.1,s[22,39]=0.8,s[22,40]=0.3,s[22,41]=-0.6,s[22,42]=-1.2,s[22,43]=-0.1,s[22,44]=-0.2,s[22,45]=-0.8,s[22,46]=-0.2,s[22,47]=-0.7,s[22,48]=-0.1,s[22,49]=-0.6,s[22,50]=0.7,s[22,51]=-0.3,s[22,52]=0.6,s[22,53]=0.2,s[22,54]=1.1,s[22,55]=-1.2,s[22,56]=0.4,s[22,57]=0.6,s[22,58]=-0.3,s[22,59]=-0.4,s[22,60]=1.1 s[23,1]=-0.1,s[23,2]=0.0,s[23,3]=-0.8,s[23,4]=0.6,s[23,5]=-1.1,s[23,6]=-0.6,s[23,7]=-0.9,s[23,8]=-1.0,s[23,9]=1.2,s[23,10]=0.5,s[23,11]=-1.1,s[23,12]=-1.2,s[23,13]=-0.1,s[23,14]=-0.5,s[23,15]=0.0,s[23,16]=0.4,s[23,17]=0.3,s[23,18]=0.1,s[23,19]=0.9,s[23,20]=0.0,s[23,21]=-0.9,s[23,22]=-0.4,s[23,23]=1.2,s[23,24]=-0.7,s[23,25]=0.2,s[23,26]=0.4,s[23,27]=0.9,s[23,28]=-1.1,s[23,29]=0.1,s[23,30]=0.5,s[23,31]=-0.1,s[23,32]=-0.8,s[23,33]=-1.0,s[23,34]=0.8,s[23,35]=0.4,s[23,36]=1.2,s[23,37]=0.0,s[23,38]=-0.9,s[23,39]=0.5,s[23,40]=-1.0,s[23,41]=0.6,s[23,42]=1.1,s[23,43]=0.2,s[23,44]=1.0,s[23,45]=0.6,s[23,46]=-0.4,s[23,47]=0.1,s[23,48]=0.0,s[23,49]=-0.6,s[23,50]=-1.0,s[23,51]=0.4,s[23,52]=-0.2,s[23,53]=0.0,s[23,54]=-1.0,s[23,55]=-1.2,s[23,56]=-0.3,s[23,57]=0.3,s[23,58]=1.2,s[23,59]=0.3,s[23,60]=0.2 s[24,1]=-0.3,s[24,2]=0.1,s[24,3]=-0.1,s[24,4]=0.0,s[24,5]=-0.5,s[24,6]=-0.4,s[24,7]=-1.0,s[24,8]=0.0,s[24,9]=-1.0,s[24,10]=-0.9,s[24,11]=-0.6,s[24,12]=-0.3,s[24,13]=-0.8,s[24,14]=-0.3,s[24,15]=-1.0,s[24,16]=-0.1,s[24,17]=0.8,s[24,18]=-0.3,s[24,19]=0.9,s[24,20]=-0.4,s[24,21]=-0.1,s[24,22]=-0.4,s[24,23]=-0.4,s[24,24]=0.2,s[24,25]=-0.8,s[24,26]=0.0,s[24,27]=0.6,s[24,28]=0.8,s[24,29]=-0.7,s[24,30]=0.0,s[24,31]=0.3,s[24,32]=1.1,s[24,33]=-0.3,s[24,34]=-0.1,s[24,35]=-0.6,s[24,36]=-1.0,s[24,37]=-0.9,s[24,38]=-0.3,s[24,39]=-1.1,s[24,40]=-0.9,s[24,41]=0.2,s[24,42]=0.0,s[24,43]=-0.5,s[24,44]=0.5,s[24,45]=-0.5,s[24,46]=-0.5,s[24,47]=-0.3,s[24,48]=-0.4,s[24,49]=0.9,s[24,50]=1.1,s[24,51]=0.2,s[24,52]=-0.2,s[24,53]=-0.9,s[24,54]=0.2,s[24,55]=0.7,s[24,56]=-0.2,s[24,57]=0.0,s[24,58]=0.7,s[24,59]=-0.7,s[24,60]=0.1 s[25,1]=0.3,s[25,2]=0.8,s[25,3]=-1.2,s[25,4]=1.0,s[25,5]=-0.4,s[25,6]=-0.7,s[25,7]=-0.6,s[25,8]=1.1,s[25,9]=-0.3,s[25,10]=0.9,s[25,11]=-0.5,s[25,12]=-0.2,s[25,13]=-0.2,s[25,14]=-0.1,s[25,15]=-0.7,s[25,16]=0.5,s[25,17]=-0.3,s[25,18]=-0.4,s[25,19]=0.5,s[25,20]=-0.5,s[25,21]=0.3,s[25,22]=-0.3,s[25,23]=-0.9,s[25,24]=0.7,s[25,25]=0.5,s[25,26]=0.9,s[25,27]=0.5,s[25,28]=-0.2,s[25,29]=-0.6,s[25,30]=-1.0,s[25,31]=0.2,s[25,32]=0.9,s[25,33]=-0.4,s[25,34]=-0.7,s[25,35]=-0.6,s[25,36]=-1.2,s[25,37]=-0.3,s[25,38]=0.3,s[25,39]=-1.0,s[25,40]=1.0,s[25,41]=0.7,s[25,42]=0.4,s[25,43]=-0.4,s[25,44]=-0.6,s[25,45]=0.0,s[25,46]=0.0,s[25,47]=0.1,s[25,48]=0.9,s[25,49]=0.0,s[25,50]=0.1,s[25,51]=-0.3,s[25,52]=-0.4,s[25,53]=1.1,s[25,54]=-0.3,s[25,55]=-1.2,s[25,56]=-0.8,s[25,57]=0.7,s[25,58]=0.9,s[25,59]=-0.7,s[25,60]=0.7 s[26,1]=-0.1,s[26,2]=-1.0,s[26,3]=-0.9,s[26,4]=-1.1,s[26,5]=1.2,s[26,6]=-1.1,s[26,7]=-0.5,s[26,8]=-0.2,s[26,9]=0.4,s[26,10]=-0.1,s[26,11]=0.4,s[26,12]=-0.6,s[26,13]=0.9,s[26,14]=-1.2,s[26,15]=0.0,s[26,16]=-0.1,s[26,17]=0.0,s[26,18]=0.7,s[26,19]=-1.1,s[26,20]=-0.9,s[26,21]=-1.1,s[26,22]=-0.1,s[26,23]=-0.1,s[26,24]=0.7,s[26,25]=-0.6,s[26,26]=-0.7,s[26,27]=0.8,s[26,28]=0.0,s[26,29]=0.0,s[26,30]=1.1,s[26,31]=0.5,s[26,32]=-0.1,s[26,33]=0.9,s[26,34]=-0.8,s[26,35]=-1.0,s[26,36]=-0.1,s[26,37]=1.2,s[26,38]=0.4,s[26,39]=-1.1,s[26,40]=0.1,s[26,41]=0.0,s[26,42]=0.5,s[26,43]=0.7,s[26,44]=0.3,s[26,45]=-0.8,s[26,46]=0.1,s[26,47]=-0.3,s[26,48]=0.2,s[26,49]=1.2,s[26,50]=0.4,s[26,51]=0.5,s[26,52]=1.2,s[26,53]=0.8,s[26,54]=1.1,s[26,55]=0.6,s[26,56]=0.6,s[26,57]=-1.0,s[26,58]=-0.7,s[26,59]=0.0,s[26,60]=-0.7 s[27,1]=0.2,s[27,2]=-0.8,s[27,3]=0.3,s[27,4]=-0.7,s[27,5]=0.7,s[27,6]=-0.6,s[27,7]=0.0,s[27,8]=1.0,s[27,9]=-0.1,s[27,10]=1.1,s[27,11]=1.0,s[27,12]=0.9,s[27,13]=-0.4,s[27,14]=0.6,s[27,15]=-0.1,s[27,16]=-0.2,s[27,17]=-1.0,s[27,18]=0.2,s[27,19]=0.0,s[27,20]=-0.6,s[27,21]=0.9,s[27,22]=-1.1,s[27,23]=-1.2,s[27,24]=0.8,s[27,25]=-0.6,s[27,26]=0.3,s[27,27]=-0.6,s[27,28]=0.7,s[27,29]=0.2,s[27,30]=-1.1,s[27,31]=0.2,s[27,32]=-0.4,s[27,33]=0.7,s[27,34]=-0.5,s[27,35]=-0.5,s[27,36]=0.2,s[27,37]=0.2,s[27,38]=-0.5,s[27,39]=-0.3,s[27,40]=1.1,s[27,41]=0.1,s[27,42]=-0.3,s[27,43]=-1.1,s[27,44]=-0.2,s[27,45]=-0.2,s[27,46]=0.1,s[27,47]=-1.0,s[27,48]=0.8,s[27,49]=-0.5,s[27,50]=0.8,s[27,51]=0.5,s[27,52]=-0.8,s[27,53]=-0.4,s[27,54]=0.5,s[27,55]=1.0,s[27,56]=-0.1,s[27,57]=1.1,s[27,58]=-0.8,s[27,59]=-0.3,s[27,60]=0.3 s[28,1]=0.1,s[28,2]=0.7,s[28,3]=-0.9,s[28,4]=0.0,s[28,5]=0.0,s[28,6]=1.2,s[28,7]=-0.5,s[28,8]=0.8,s[28,9]=-0.4,s[28,10]=-0.6,s[28,11]=-1.1,s[28,12]=-0.1,s[28,13]=-0.7,s[28,14]=0.4,s[28,15]=0.6,s[28,16]=0.1,s[28,17]=-0.9,s[28,18]=1.1,s[28,19]=-1.0,s[28,20]=0.5,s[28,21]=0.2,s[28,22]=0.2,s[28,23]=0.3,s[28,24]=1.0,s[28,25]=-0.8,s[28,26]=-1.1,s[28,27]=0.7,s[28,28]=-1.1,s[28,29]=-0.3,s[28,30]=-0.4,s[28,31]=-0.2,s[28,32]=0.8,s[28,33]=1.2,s[28,34]=-0.7,s[28,35]=-0.2,s[28,36]=-0.3,s[28,37]=-1.0,s[28,38]=1.2,s[28,39]=0.8,s[28,40]=0.8,s[28,41]=0.7,s[28,42]=0.7,s[28,43]=-0.7,s[28,44]=0.0,s[28,45]=0.1,s[28,46]=-0.6,s[28,47]=0.4,s[28,48]=1.1,s[28,49]=-0.9,s[28,50]=-1.1,s[28,51]=-1.0,s[28,52]=0.5,s[28,53]=-1.1,s[28,54]=1.2,s[28,55]=-0.2,s[28,56]=0.1,s[28,57]=-0.7,s[28,58]=1.0,s[28,59]=0.2,s[28,60]=-0.2 s[29,1]=-0.4,s[29,2]=-0.7,s[29,3]=-0.4,s[29,4]=0.8,s[29,5]=-0.1,s[29,6]=0.6,s[29,7]=0.4,s[29,8]=-0.3,s[29,9]=0.2,s[29,10]=-0.8,s[29,11]=-0.2,s[29,12]=-0.9,s[29,13]=-1.2,s[29,14]=-0.4,s[29,15]=-0.8,s[29,16]=0.0,s[29,17]=0.0,s[29,18]=1.1,s[29,19]=0.8,s[29,20]=1.0,s[29,21]=0.6,s[29,22]=0.8,s[29,23]=0.0,s[29,24]=-1.0,s[29,25]=0.5,s[29,26]=1.2,s[29,27]=-1.2,s[29,28]=-0.8,s[29,29]=-0.6,s[29,30]=1.0,s[29,31]=-0.5,s[29,32]=0.6,s[29,33]=1.2,s[29,34]=0.1,s[29,35]=-0.8,s[29,36]=1.0,s[29,37]=0.0,s[29,38]=0.5,s[29,39]=1.2,s[29,40]=0.3,s[29,41]=-0.2,s[29,42]=0.9,s[29,43]=-0.2,s[29,44]=0.0,s[29,45]=-0.1,s[29,46]=-0.2,s[29,47]=0.1,s[29,48]=-0.2,s[29,49]=-0.6,s[29,50]=0.0,s[29,51]=-0.9,s[29,52]=-0.6,s[29,53]=0.3,s[29,54]=-0.4,s[29,55]=-1.0,s[29,56]=-1.1,s[29,57]=-1.1,s[29,58]=0.1,s[29,59]=-0.6,s[29,60]=-0.3 s[30,1]=-0.3,s[30,2]=-0.1,s[30,3]=1.0,s[30,4]=-0.8,s[30,5]=-1.2,s[30,6]=1.0,s[30,7]=-0.6,s[30,8]=0.0,s[30,9]=0.8,s[30,10]=-0.4,s[30,11]=-0.4,s[30,12]=0.9,s[30,13]=0.8,s[30,14]=-0.2,s[30,15]=0.5,s[30,16]=-0.2,s[30,17]=-0.9,s[30,18]=-0.4,s[30,19]=-0.1,s[30,20]=-0.9,s[30,21]=0.3,s[30,22]=0.7,s[30,23]=-0.6,s[30,24]=1.2,s[30,25]=0.2,s[30,26]=0.2,s[30,27]=-0.4,s[30,28]=-1.1,s[30,29]=1.0,s[30,30]=0.9,s[30,31]=0.2,s[30,32]=-0.5,s[30,33]=-0.4,s[30,34]=0.0,s[30,35]=1.0,s[30,36]=1.1,s[30,37]=0.0,s[30,38]=-0.4,s[30,39]=-0.2,s[30,40]=1.1,s[30,41]=0.3,s[30,42]=0.8,s[30,43]=-0.6,s[30,44]=-0.7,s[30,45]=0.1,s[30,46]=0.1,s[30,47]=0.7,s[30,48]=0.4,s[30,49]=0.8,s[30,50]=0.8,s[30,51]=0.5,s[30,52]=-0.9,s[30,53]=0.8,s[30,54]=0.3,s[30,55]=-1.0,s[30,56]=-0.1,s[30,57]=0.6,s[30,58]=0.8,s[30,59]=-1.0,s[30,60]=1.2 s[31,1]=0.0,s[31,2]=0.8,s[31,3]=0.2,s[31,4]=-0.2,s[31,5]=0.4,s[31,6]=-0.1,s[31,7]=0.0,s[31,8]=-1.0,s[31,9]=1.0,s[31,10]=0.2,s[31,11]=0.3,s[31,12]=-1.0,s[31,13]=0.0,s[31,14]=1.0,s[31,15]=1.2,s[31,16]=-0.2,s[31,17]=1.2,s[31,18]=1.2,s[31,19]=-0.9,s[31,20]=-0.2,s[31,21]=0.7,s[31,22]=0.2,s[31,23]=-0.1,s[31,24]=-0.7,s[31,25]=-0.9,s[31,26]=0.6,s[31,27]=-0.3,s[31,28]=1.1,s[31,29]=1.1,s[31,30]=0.9,s[31,31]=0.8,s[31,32]=0.4,s[31,33]=0.1,s[31,34]=0.8,s[31,35]=0.8,s[31,36]=0.1,s[31,37]=-1.1,s[31,38]=0.8,s[31,39]=0.5,s[31,40]=0.2,s[31,41]=-0.9,s[31,42]=0.1,s[31,43]=0.7,s[31,44]=-1.0,s[31,45]=-0.6,s[31,46]=-0.1,s[31,47]=-0.7,s[31,48]=-0.1,s[31,49]=1.1,s[31,50]=0.2,s[31,51]=0.6,s[31,52]=0.2,s[31,53]=1.1,s[31,54]=-1.1,s[31,55]=-0.4,s[31,56]=0.0,s[31,57]=0.8,s[31,58]=1.2,s[31,59]=0.2,s[31,60]=-1.0 s[32,1]=0.1,s[32,2]=1.2,s[32,3]=0.8,s[32,4]=-0.7,s[32,5]=-0.8,s[32,6]=0.1,s[32,7]=0.1,s[32,8]=0.2,s[32,9]=0.0,s[32,10]=0.9,s[32,11]=0.3,s[32,12]=-0.4,s[32,13]=1.2,s[32,14]=0.4,s[32,15]=0.6,s[32,16]=0.2,s[32,17]=0.3,s[32,18]=-0.3,s[32,19]=-1.0,s[32,20]=-0.6,s[32,21]=-0.8,s[32,22]=-0.3,s[32,23]=1.0,s[32,24]=-0.5,s[32,25]=0.1,s[32,26]=-0.8,s[32,27]=1.0,s[32,28]=-0.6,s[32,29]=-0.9,s[32,30]=-1.2,s[32,31]=-0.1,s[32,32]=-0.1,s[32,33]=0.8,s[32,34]=1.0,s[32,35]=0.2,s[32,36]=-0.1,s[32,37]=0.2,s[32,38]=-0.1,s[32,39]=-1.2,s[32,40]=1.1,s[32,41]=-0.7,s[32,42]=-0.2,s[32,43]=0.0,s[32,44]=-0.1,s[32,45]=0.8,s[32,46]=0.0,s[32,47]=-0.3,s[32,48]=-0.5,s[32,49]=-0.9,s[32,50]=0.7,s[32,51]=0.4,s[32,52]=0.1,s[32,53]=-0.4,s[32,54]=-0.1,s[32,55]=1.0,s[32,56]=0.5,s[32,57]=-0.5,s[32,58]=-0.7,s[32,59]=-0.1,s[32,60]=-0.7 s[33,1]=-0.3,s[33,2]=-0.1,s[33,3]=0.0,s[33,4]=-0.8,s[33,5]=0.6,s[33,6]=-1.0,s[33,7]=-0.7,s[33,8]=0.3,s[33,9]=-0.5,s[33,10]=-1.1,s[33,11]=0.0,s[33,12]=0.9,s[33,13]=-1.0,s[33,14]=-0.2,s[33,15]=-0.3,s[33,16]=-0.2,s[33,17]=-0.2,s[33,18]=0.6,s[33,19]=-0.1,s[33,20]=-1.2,s[33,21]=0.4,s[33,22]=-0.7,s[33,23]=0.5,s[33,24]=0.1,s[33,25]=-0.9,s[33,26]=0.2,s[33,27]=1.0,s[33,28]=-0.5,s[33,29]=-0.5,s[33,30]=-0.7,s[33,31]=-0.5,s[33,32]=0.5,s[33,33]=-0.9,s[33,34]=0.8,s[33,35]=0.8,s[33,36]=-0.7,s[33,37]=-0.9,s[33,38]=0.8,s[33,39]=-0.2,s[33,40]=-0.3,s[33,41]=-0.2,s[33,42]=0.0,s[33,43]=-0.1,s[33,44]=0.7,s[33,45]=1.0,s[33,46]=0.0,s[33,47]=0.5,s[33,48]=0.3,s[33,49]=-0.5,s[33,50]=-0.6,s[33,51]=0.9,s[33,52]=-0.1,s[33,53]=0.7,s[33,54]=-0.7,s[33,55]=-0.2,s[33,56]=-0.6,s[33,57]=-1.1,s[33,58]=-0.4,s[33,59]=-0.5,s[33,60]=0.6 s[34,1]=-0.1,s[34,2]=1.0,s[34,3]=0.3,s[34,4]=-0.5,s[34,5]=1.1,s[34,6]=-1.1,s[34,7]=1.1,s[34,8]=1.1,s[34,9]=-0.7,s[34,10]=1.0,s[34,11]=-0.4,s[34,12]=0.6,s[34,13]=-1.1,s[34,14]=0.0,s[34,15]=0.7,s[34,16]=0.1,s[34,17]=-0.1,s[34,18]=-0.9,s[34,19]=-0.4,s[34,20]=0.4,s[34,21]=-0.3,s[34,22]=-0.8,s[34,23]=1.0,s[34,24]=0.0,s[34,25]=-0.5,s[34,26]=0.7,s[34,27]=1.0,s[34,28]=-0.5,s[34,29]=-1.2,s[34,30]=0.2,s[34,31]=0.6,s[34,32]=1.1,s[34,33]=1.2,s[34,34]=-0.8,s[34,35]=-0.4,s[34,36]=0.6,s[34,37]=-0.3,s[34,38]=0.7,s[34,39]=-1.2,s[34,40]=0.5,s[34,41]=0.2,s[34,42]=0.4,s[34,43]=-1.2,s[34,44]=-1.0,s[34,45]=-0.9,s[34,46]=0.4,s[34,47]=0.3,s[34,48]=1.2,s[34,49]=0.9,s[34,50]=0.0,s[34,51]=0.5,s[34,52]=0.4,s[34,53]=-0.1,s[34,54]=-0.8,s[34,55]=0.8,s[34,56]=0.1,s[34,57]=-0.7,s[34,58]=-0.6,s[34,59]=-0.3,s[34,60]=1.1 s[35,1]=-0.7,s[35,2]=-0.7,s[35,3]=-0.2,s[35,4]=-1.1,s[35,5]=0.1,s[35,6]=-0.4,s[35,7]=1.0,s[35,8]=-1.0,s[35,9]=1.2,s[35,10]=-0.4,s[35,11]=-1.0,s[35,12]=-0.5,s[35,13]=-0.3,s[35,14]=-0.1,s[35,15]=0.9,s[35,16]=-0.1,s[35,17]=1.0,s[35,18]=0.9,s[35,19]=-1.0,s[35,20]=0.5,s[35,21]=1.1,s[35,22]=-0.4,s[35,23]=1.2,s[35,24]=-1.0,s[35,25]=-0.6,s[35,26]=-0.4,s[35,27]=-0.2,s[35,28]=-1.2,s[35,29]=-0.1,s[35,30]=-0.5,s[35,31]=0.0,s[35,32]=-1.0,s[35,33]=-0.9,s[35,34]=1.0,s[35,35]=0.3,s[35,36]=0.3,s[35,37]=-0.5,s[35,38]=0.3,s[35,39]=-0.6,s[35,40]=-0.9,s[35,41]=0.2,s[35,42]=-0.2,s[35,43]=0.4,s[35,44]=1.0,s[35,45]=0.7,s[35,46]=-0.6,s[35,47]=0.6,s[35,48]=-0.1,s[35,49]=-0.6,s[35,50]=0.5,s[35,51]=0.1,s[35,52]=0.7,s[35,53]=1.1,s[35,54]=-1.2,s[35,55]=-1.1,s[35,56]=0.8,s[35,57]=-1.1,s[35,58]=0.1,s[35,59]=-1.0,s[35,60]=0.1 s[36,1]=0.3,s[36,2]=-0.4,s[36,3]=0.5,s[36,4]=0.4,s[36,5]=0.8,s[36,6]=0.5,s[36,7]=0.4,s[36,8]=1.0,s[36,9]=0.7,s[36,10]=0.1,s[36,11]=0.9,s[36,12]=-0.9,s[36,13]=1.0,s[36,14]=-0.2,s[36,15]=-0.9,s[36,16]=-0.6,s[36,17]=-0.1,s[36,18]=-0.2,s[36,19]=-0.7,s[36,20]=-0.9,s[36,21]=-0.3,s[36,22]=-1.0,s[36,23]=-1.0,s[36,24]=0.9,s[36,25]=-0.8,s[36,26]=0.3,s[36,27]=-1.1,s[36,28]=1.0,s[36,29]=0.3,s[36,30]=0.5,s[36,31]=0.4,s[36,32]=-0.4,s[36,33]=0.2,s[36,34]=0.3,s[36,35]=-0.3,s[36,36]=0.9,s[36,37]=-0.7,s[36,38]=-1.0,s[36,39]=-0.2,s[36,40]=-0.1,s[36,41]=0.1,s[36,42]=-0.6,s[36,43]=-0.5,s[36,44]=0.2,s[36,45]=0.0,s[36,46]=0.2,s[36,47]=0.1,s[36,48]=0.5,s[36,49]=-0.3,s[36,50]=-0.3,s[36,51]=1.2,s[36,52]=1.1,s[36,53]=0.6,s[36,54]=0.3,s[36,55]=0.6,s[36,56]=0.2,s[36,57]=-0.8,s[36,58]=-0.5,s[36,59]=-0.3,s[36,60]=1.1 s[37,1]=0.2,s[37,2]=0.2,s[37,3]=-0.6,s[37,4]=0.3,s[37,5]=0.5,s[37,6]=1.1,s[37,7]=1.2,s[37,8]=-0.2,s[37,9]=-1.1,s[37,10]=-1.2,s[37,11]=0.5,s[37,12]=0.8,s[37,13]=0.5,s[37,14]=0.6,s[37,15]=-0.7,s[37,16]=-0.3,s[37,17]=1.0,s[37,18]=0.8,s[37,19]=-0.2,s[37,20]=1.0,s[37,21]=-0.3,s[37,22]=0.8,s[37,23]=-1.1,s[37,24]=-1.0,s[37,25]=0.4,s[37,26]=0.4,s[37,27]=-0.6,s[37,28]=-0.3,s[37,29]=1.0,s[37,30]=-0.8,s[37,31]=0.1,s[37,32]=-1.1,s[37,33]=0.7,s[37,34]=0.0,s[37,35]=0.5,s[37,36]=-1.1,s[37,37]=-0.4,s[37,38]=0.4,s[37,39]=-0.6,s[37,40]=0.4,s[37,41]=-0.9,s[37,42]=-0.6,s[37,43]=-0.3,s[37,44]=0.5,s[37,45]=-1.1,s[37,46]=0.2,s[37,47]=-0.8,s[37,48]=0.9,s[37,49]=1.2,s[37,50]=0.5,s[37,51]=-0.2,s[37,52]=-1.2,s[37,53]=-0.3,s[37,54]=0.4,s[37,55]=-0.3,s[37,56]=-0.1,s[37,57]=0.4,s[37,58]=0.7,s[37,59]=0.0,s[37,60]=-0.9 s[38,1]=0.4,s[38,2]=-0.4,s[38,3]=-0.3,s[38,4]=-1.1,s[38,5]=0.7,s[38,6]=0.0,s[38,7]=-0.1,s[38,8]=-0.6,s[38,9]=0.2,s[38,10]=0.3,s[38,11]=-0.8,s[38,12]=0.6,s[38,13]=-1.1,s[38,14]=0.7,s[38,15]=0.8,s[38,16]=0.1,s[38,17]=-0.3,s[38,18]=0.4,s[38,19]=1.2,s[38,20]=-0.8,s[38,21]=-0.7,s[38,22]=0.2,s[38,23]=0.3,s[38,24]=-0.7,s[38,25]=0.6,s[38,26]=-0.3,s[38,27]=0.7,s[38,28]=0.5,s[38,29]=-1.1,s[38,30]=1.0,s[38,31]=0.4,s[38,32]=1.1,s[38,33]=-0.2,s[38,34]=-1.0,s[38,35]=-0.4,s[38,36]=-0.3,s[38,37]=0.5,s[38,38]=-0.8,s[38,39]=0.0,s[38,40]=0.6,s[38,41]=-0.5,s[38,42]=0.9,s[38,43]=0.1,s[38,44]=0.5,s[38,45]=-1.2,s[38,46]=0.5,s[38,47]=0.0,s[38,48]=1.1,s[38,49]=0.7,s[38,50]=0.6,s[38,51]=0.3,s[38,52]=-0.2,s[38,53]=-1.2,s[38,54]=0.1,s[38,55]=-0.5,s[38,56]=-0.1,s[38,57]=-0.3,s[38,58]=-0.2,s[38,59]=0.3,s[38,60]=-1.2 s[39,1]=-0.7,s[39,2]=-0.6,s[39,3]=0.9,s[39,4]=-0.5,s[39,5]=-0.2,s[39,6]=0.9,s[39,7]=0.8,s[39,8]=0.4,s[39,9]=-0.8,s[39,10]=-0.8,s[39,11]=-0.6,s[39,12]=0.9,s[39,13]=-1.2,s[39,14]=0.0,s[39,15]=1.1,s[39,16]=0.2,s[39,17]=0.9,s[39,18]=1.0,s[39,19]=-0.6,s[39,20]=-0.5,s[39,21]=-0.3,s[39,22]=-1.0,s[39,23]=1.1,s[39,24]=0.4,s[39,25]=-0.7,s[39,26]=0.4,s[39,27]=-0.9,s[39,28]=0.1,s[39,29]=0.3,s[39,30]=-0.1,s[39,31]=0.1,s[39,32]=-0.6,s[39,33]=-0.1,s[39,34]=0.9,s[39,35]=1.2,s[39,36]=-0.7,s[39,37]=0.1,s[39,38]=0.5,s[39,39]=0.0,s[39,40]=-1.0,s[39,41]=1.0,s[39,42]=-0.5,s[39,43]=-1.0,s[39,44]=0.3,s[39,45]=-0.2,s[39,46]=0.6,s[39,47]=0.4,s[39,48]=0.6,s[39,49]=-0.4,s[39,50]=1.1,s[39,51]=0.8,s[39,52]=-1.2,s[39,53]=-1.2,s[39,54]=0.2,s[39,55]=-0.8,s[39,56]=-0.1,s[39,57]=-0.5,s[39,58]=-0.3,s[39,59]=0.6,s[39,60]=-0.5 s[40,1]=-0.3,s[40,2]=0.1,s[40,3]=0.0,s[40,4]=-0.5,s[40,5]=-1.0,s[40,6]=-1.0,s[40,7]=-1.0,s[40,8]=-0.4,s[40,9]=-0.8,s[40,10]=1.1,s[40,11]=-0.8,s[40,12]=0.6,s[40,13]=0.6,s[40,14]=-0.8,s[40,15]=0.7,s[40,16]=-0.3,s[40,17]=-0.2,s[40,18]=1.2,s[40,19]=-0.5,s[40,20]=-1.2,s[40,21]=1.1,s[40,22]=0.4,s[40,23]=-0.2,s[40,24]=1.0,s[40,25]=-0.8,s[40,26]=-0.6,s[40,27]=0.3,s[40,28]=-1.0,s[40,29]=-0.5,s[40,30]=0.9,s[40,31]=0.1,s[40,32]=-1.0,s[40,33]=0.9,s[40,34]=-0.8,s[40,35]=0.7,s[40,36]=1.0,s[40,37]=0.3,s[40,38]=-1.2,s[40,39]=0.2,s[40,40]=-1.1,s[40,41]=-0.3,s[40,42]=-0.7,s[40,43]=-0.9,s[40,44]=-0.1,s[40,45]=0.2,s[40,46]=0.7,s[40,47]=0.9,s[40,48]=-0.8,s[40,49]=-1.0,s[40,50]=-0.7,s[40,51]=-0.6,s[40,52]=-0.9,s[40,53]=-0.3,s[40,54]=1.1,s[40,55]=-0.7,s[40,56]=0.8,s[40,57]=-0.6,s[40,58]=-0.1,s[40,59]=-1.1,s[40,60]=0.4 s[41,1]=0.1,s[41,2]=0.5,s[41,3]=-0.3,s[41,4]=1.1,s[41,5]=-0.4,s[41,6]=-1.0,s[41,7]=-0.1,s[41,8]=0.3,s[41,9]=1.2,s[41,10]=0.9,s[41,11]=0.1,s[41,12]=-0.2,s[41,13]=-0.4,s[41,14]=0.6,s[41,15]=-0.3,s[41,16]=-1.0,s[41,17]=0.7,s[41,18]=0.2,s[41,19]=-0.4,s[41,20]=0.5,s[41,21]=0.6,s[41,22]=0.3,s[41,23]=0.7,s[41,24]=-0.1,s[41,25]=0.6,s[41,26]=0.8,s[41,27]=0.6,s[41,28]=-1.2,s[41,29]=-0.3,s[41,30]=0.3,s[41,31]=-0.3,s[41,32]=-0.6,s[41,33]=0.8,s[41,34]=0.0,s[41,35]=0.6,s[41,36]=-0.4,s[41,37]=0.1,s[41,38]=0.3,s[41,39]=-0.2,s[41,40]=0.0,s[41,41]=0.1,s[41,42]=0.7,s[41,43]=-0.6,s[41,44]=-0.3,s[41,45]=0.2,s[41,46]=-0.5,s[41,47]=0.3,s[41,48]=0.9,s[41,49]=-0.5,s[41,50]=-1.0,s[41,51]=-0.8,s[41,52]=0.2,s[41,53]=0.0,s[41,54]=-0.4,s[41,55]=0.8,s[41,56]=0.2,s[41,57]=0.9,s[41,58]=0.8,s[41,59]=0.9,s[41,60]=-0.6 s[42,1]=0.0,s[42,2]=-0.3,s[42,3]=-0.5,s[42,4]=-0.6,s[42,5]=-1.1,s[42,6]=0.6,s[42,7]=-0.6,s[42,8]=-0.1,s[42,9]=1.0,s[42,10]=-1.2,s[42,11]=0.2,s[42,12]=0.2,s[42,13]=0.1,s[42,14]=-1.2,s[42,15]=0.0,s[42,16]=-0.1,s[42,17]=0.4,s[42,18]=-1.1,s[42,19]=0.3,s[42,20]=0.9,s[42,21]=0.7,s[42,22]=-0.5,s[42,23]=-1.0,s[42,24]=0.4,s[42,25]=-0.2,s[42,26]=0.0,s[42,27]=0.4,s[42,28]=0.2,s[42,29]=-0.1,s[42,30]=0.9,s[42,31]=-0.4,s[42,32]=-0.4,s[42,33]=-0.7,s[42,34]=0.7,s[42,35]=0.5,s[42,36]=0.3,s[42,37]=-0.2,s[42,38]=0.9,s[42,39]=0.7,s[42,40]=-0.7,s[42,41]=-0.5,s[42,42]=-1.2,s[42,43]=0.9,s[42,44]=-0.9,s[42,45]=-1.2,s[42,46]=-0.1,s[42,47]=0.1,s[42,48]=-0.1,s[42,49]=1.1,s[42,50]=0.6,s[42,51]=0.2,s[42,52]=-0.5,s[42,53]=0.6,s[42,54]=-0.5,s[42,55]=-0.9,s[42,56]=0.3,s[42,57]=-1.2,s[42,58]=1.1,s[42,59]=-0.5,s[42,60]=0.1 s[43,1]=-0.1,s[43,2]=1.0,s[43,3]=-1.2,s[43,4]=0.9,s[43,5]=0.4,s[43,6]=0.3,s[43,7]=0.8,s[43,8]=-0.6,s[43,9]=0.4,s[43,10]=0.4,s[43,11]=-0.7,s[43,12]=1.0,s[43,13]=0.9,s[43,14]=-0.1,s[43,15]=1.2,s[43,16]=-0.1,s[43,17]=0.3,s[43,18]=-0.5,s[43,19]=-0.2,s[43,20]=1.2,s[43,21]=-1.0,s[43,22]=-0.5,s[43,23]=0.4,s[43,24]=-0.4,s[43,25]=-1.2,s[43,26]=-0.4,s[43,27]=0.9,s[43,28]=-1.0,s[43,29]=-1.0,s[43,30]=-0.8,s[43,31]=-0.5,s[43,32]=0.7,s[43,33]=-0.7,s[43,34]=-0.6,s[43,35]=0.0,s[43,36]=-0.9,s[43,37]=0.1,s[43,38]=1.0,s[43,39]=-0.6,s[43,40]=0.9,s[43,41]=-0.9,s[43,42]=1.0,s[43,43]=0.9,s[43,44]=0.5,s[43,45]=0.4,s[43,46]=0.6,s[43,47]=0.1,s[43,48]=-1.0,s[43,49]=-0.9,s[43,50]=-0.2,s[43,51]=-0.7,s[43,52]=-0.4,s[43,53]=-0.8,s[43,54]=0.2,s[43,55]=0.8,s[43,56]=0.0,s[43,57]=0.3,s[43,58]=0.9,s[43,59]=-0.3,s[43,60]=-0.3 s[44,1]=0.3,s[44,2]=-0.1,s[44,3]=0.2,s[44,4]=-1.1,s[44,5]=0.2,s[44,6]=-1.0,s[44,7]=0.2,s[44,8]=0.3,s[44,9]=0.2,s[44,10]=-1.2,s[44,11]=0.1,s[44,12]=-0.2,s[44,13]=-0.1,s[44,14]=0.5,s[44,15]=0.2,s[44,16]=0.1,s[44,17]=-1.2,s[44,18]=-1.1,s[44,19]=0.9,s[44,20]=0.5,s[44,21]=0.1,s[44,22]=-0.8,s[44,23]=1.2,s[44,24]=-0.3,s[44,25]=-0.3,s[44,26]=1.0,s[44,27]=0.2,s[44,28]=-1.2,s[44,29]=0.0,s[44,30]=0.9,s[44,31]=0.5,s[44,32]=-0.1,s[44,33]=1.1,s[44,34]=-1.2,s[44,35]=-1.2,s[44,36]=0.4,s[44,37]=-0.4,s[44,38]=-0.5,s[44,39]=1.0,s[44,40]=0.8,s[44,41]=0.5,s[44,42]=-0.4,s[44,43]=0.6,s[44,44]=-1.1,s[44,45]=0.5,s[44,46]=0.1,s[44,47]=0.4,s[44,48]=1.2,s[44,49]=0.8,s[44,50]=-1.1,s[44,51]=-0.9,s[44,52]=0.1,s[44,53]=0.0,s[44,54]=-0.9,s[44,55]=-1.0,s[44,56]=-0.7,s[44,57]=0.1,s[44,58]=-1.1,s[44,59]=0.7,s[44,60]=-0.6 s[45,1]=0.3,s[45,2]=-0.8,s[45,3]=0.7,s[45,4]=-0.1,s[45,5]=1.1,s[45,6]=-0.3,s[45,7]=0.6,s[45,8]=1.0,s[45,9]=1.0,s[45,10]=0.3,s[45,11]=0.4,s[45,12]=-0.5,s[45,13]=-1.1,s[45,14]=-0.1,s[45,15]=0.4,s[45,16]=0.0,s[45,17]=-0.7,s[45,18]=-1.0,s[45,19]=-0.8,s[45,20]=1.2,s[45,21]=0.1,s[45,22]=0.0,s[45,23]=-0.6,s[45,24]=-1.0,s[45,25]=0.8,s[45,26]=0.6,s[45,27]=0.1,s[45,28]=-0.3,s[45,29]=0.5,s[45,30]=0.3,s[45,31]=-0.1,s[45,32]=0.6,s[45,33]=0.3,s[45,34]=-0.4,s[45,35]=-0.4,s[45,36]=-0.3,s[45,37]=-0.8,s[45,38]=0.4,s[45,39]=1.0,s[45,40]=-0.6,s[45,41]=-0.1,s[45,42]=0.1,s[45,43]=1.0,s[45,44]=-0.1,s[45,45]=-0.7,s[45,46]=0.6,s[45,47]=-1.2,s[45,48]=-0.3,s[45,49]=0.1,s[45,50]=-0.4,s[45,51]=-0.4,s[45,52]=1.0,s[45,53]=-0.4,s[45,54]=1.1,s[45,55]=0.4,s[45,56]=-0.1,s[45,57]=-1.1,s[45,58]=-0.5,s[45,59]=0.6,s[45,60]=-0.6 s[46,1]=-0.3,s[46,2]=0.0,s[46,3]=1.1,s[46,4]=-0.1,s[46,5]=-1.2,s[46,6]=1.2,s[46,7]=0.5,s[46,8]=-1.0,s[46,9]=-1.0,s[46,10]=-0.1,s[46,11]=-0.4,s[46,12]=-0.3,s[46,13]=0.0,s[46,14]=-0.3,s[46,15]=0.7,s[46,16]=-0.1,s[46,17]=-0.2,s[46,18]=-0.8,s[46,19]=-0.8,s[46,20]=-0.5,s[46,21]=-0.6,s[46,22]=-0.1,s[46,23]=0.7,s[46,24]=-0.4,s[46,25]=-0.7,s[46,26]=-0.3,s[46,27]=-0.1,s[46,28]=0.1,s[46,29]=-0.7,s[46,30]=-0.5,s[46,31]=0.6,s[46,32]=0.7,s[46,33]=-0.7,s[46,34]=-0.7,s[46,35]=1.2,s[46,36]=1.1,s[46,37]=0.6,s[46,38]=-0.7,s[46,39]=-1.1,s[46,40]=-0.8,s[46,41]=0.1,s[46,42]=-0.4,s[46,43]=-0.9,s[46,44]=0.5,s[46,45]=0.2,s[46,46]=0.0,s[46,47]=-1.2,s[46,48]=-0.8,s[46,49]=-0.9,s[46,50]=-0.5,s[46,51]=1.2,s[46,52]=1.2,s[46,53]=-0.4,s[46,54]=-0.5,s[46,55]=-1.0,s[46,56]=-0.6,s[46,57]=1.2,s[46,58]=0.9,s[46,59]=-0.1,s[46,60]=-0.9 s[47,1]=-0.3,s[47,2]=-1.0,s[47,3]=0.1,s[47,4]=-0.2,s[47,5]=-0.6,s[47,6]=0.0,s[47,7]=1.0,s[47,8]=0.1,s[47,9]=-0.3,s[47,10]=-0.7,s[47,11]=0.1,s[47,12]=0.1,s[47,13]=0.8,s[47,14]=0.4,s[47,15]=1.1,s[47,16]=0.0,s[47,17]=-0.4,s[47,18]=0.1,s[47,19]=0.7,s[47,20]=-0.3,s[47,21]=-1.0,s[47,22]=1.1,s[47,23]=-0.1,s[47,24]=-1.0,s[47,25]=0.4,s[47,26]=-0.5,s[47,27]=-0.9,s[47,28]=-0.3,s[47,29]=0.3,s[47,30]=0.5,s[47,31]=-1.0,s[47,32]=0.9,s[47,33]=0.9,s[47,34]=1.1,s[47,35]=1.0,s[47,36]=-0.9,s[47,37]=-0.9,s[47,38]=0.6,s[47,39]=0.6,s[47,40]=-0.8,s[47,41]=0.3,s[47,42]=1.1,s[47,43]=-0.9,s[47,44]=-0.2,s[47,45]=0.3,s[47,46]=-0.2,s[47,47]=0.3,s[47,48]=0.6,s[47,49]=0.4,s[47,50]=-0.6,s[47,51]=0.3,s[47,52]=0.4,s[47,53]=-0.6,s[47,54]=-0.5,s[47,55]=0.8,s[47,56]=0.2,s[47,57]=-0.2,s[47,58]=0.0,s[47,59]=0.0,s[47,60]=-0.4 s[48,1]=0.1,s[48,2]=-0.4,s[48,3]=-0.8,s[48,4]=0.6,s[48,5]=0.7,s[48,6]=1.2,s[48,7]=-0.4,s[48,8]=-0.7,s[48,9]=-0.1,s[48,10]=-0.6,s[48,11]=0.9,s[48,12]=-1.2,s[48,13]=-0.6,s[48,14]=0.2,s[48,15]=-0.9,s[48,16]=0.2,s[48,17]=-0.2,s[48,18]=0.0,s[48,19]=-0.1,s[48,20]=-1.1,s[48,21]=-1.1,s[48,22]=0.4,s[48,23]=-0.9,s[48,24]=-0.2,s[48,25]=0.5,s[48,26]=-0.6,s[48,27]=-1.1,s[48,28]=-0.5,s[48,29]=-0.4,s[48,30]=-1.0 s[48,31]=0.2,s[48,32]=0.0,s[48,33]=-0.2,s[48,34]=-0.6,s[48,35]=0.6,s[48,36]=0.2,s[48,37]=0.7,s[48,38]=0.0,s[48,39]=0.1,s[48,40]=-0.3,s[48,41]=-0.3,s[48,42]=-1.0,s[48,43]=-0.4,s[48,44]=0.3,s[48,45]=-0.1,s[48,46]=-0.3,s[48,47]=-0.7,s[48,48]=0.6,s[48,49]=1.1,s[48,50]=-1.2,s[48,51]=-0.7,s[48,52]=-1.2,s[48,53]=-0.6,s[48,54]=0.2,s[48,55]=0.2,s[48,56]=-0.7,s[48,57]=-0.3,s[48,58]=0.2,s[48,59]=-1.0,s[48,60]=0.2 s[49,1]=-0.4,s[49,2]=0.3,s[49,3]=0.0,s[49,4]=-0.7,s[49,5]=0.5,s[49,6]=-0.9,s[49,7]=0.2,s[49,8]=0.6,s[49,9]=1.0,s[49,10]=-1.0,s[49,11]=-0.2,s[49,12]=-0.2,s[49,13]=0.0,s[49,14]=0.5,s[49,15]=1.0,s[49,16]=0.1,s[49,17]=-0.3,s[49,18]=-0.4,s[49,19]=-0.8,s[49,20]=0.3,s[49,21]=0.5,s[49,22]=0.2,s[49,23]=0.0,s[49,24]=-0.9,s[49,25]=1.2,s[49,26]=-0.3,s[49,27]=-1.2,s[49,28]=0.9,s[49,29]=0.2,s[49,30]=-1.2 s[49,31]=-0.2,s[49,32]=1.2,s[49,33]=0.5,s[49,34]=-0.8,s[49,35]=1.0,s[49,36]=0.5,s[49,37]=0.1,s[49,38]=0.6,s[49,39]=0.4,s[49,40]=0.2,s[49,41]=0.4,s[49,42]=0.0,s[49,43]=1.1,s[49,44]=1.2,s[49,45]=-1.2,s[49,46]=0.1,s[49,47]=0.7,s[49,48]=0.9,s[49,49]=1.0,s[49,50]=-0.1,s[49,51]=-0.2,s[49,52]=-0.7,s[49,53]=-0.9,s[49,54]=-1.0,s[49,55]=0.9,s[49,56]=-0.3,s[49,57]=0.8,s[49,58]=0.9,s[49,59]=0.3,s[49,60]=0.8 s[50,1]=0.1,s[50,2]=-1.1,s[50,3]=-0.3,s[50,4]=-0.9,s[50,5]=-0.5,s[50,6]=-0.3,s[50,7]=0.5,s[50,8]=0.3,s[50,9]=-0.5,s[50,10]=-1.1,s[50,11]=-0.8,s[50,12]=-0.9,s[50,13]=0.5,s[50,14]=0.8,s[50,15]=-0.2,s[50,16]=0.1,s[50,17]=-0.7,s[50,18]=0.0,s[50,19]=1.1,s[50,20]=0.2,s[50,21]=-1.0,s[50,22]=0.9,s[50,23]=-0.8,s[50,24]=-0.2,s[50,25]=1.0,s[50,26]=-0.9,s[50,27]=-0.8,s[50,28]=0.1,s[50,29]=-0.2,s[50,30]=-0.4 s[50,31]=-0.2,s[50,32]=-0.2,s[50,33]=0.8,s[50,34]=-0.9,s[50,35]=0.3,s[50,36]=-1.0,s[50,37]=-0.1,s[50,38]=0.1,s[50,39]=0.4,s[50,40]=0.7,s[50,41]=-0.8,s[50,42]=-1.0,s[50,43]=-0.1,s[50,44]=1.0,s[50,45]=1.2,s[50,46]=-0.3,s[50,47]=-0.6,s[50,48]=0.2,s[50,49]=-0.1,s[50,50]=-1.2,s[50,51]=0.2,s[50,52]=-1.0,s[50,53]=-0.7,s[50,54]=-0.6,s[50,55]=-0.4,s[50,56]=0.5,s[50,57]=-0.7,s[50,58]=0.2,s[50,59]=0.7,s[50,60]=0.8 s[51,1]=-0.6,s[51,2]=0.4,s[51,3]=-0.1,s[51,4]=0.3,s[51,5]=1.2,s[51,6]=-0.1,s[51,7]=-0.4,s[51,8]=-0.4,s[51,9]=0.5,s[51,10]=0.8,s[51,11]=0.0,s[51,12]=-0.4,s[51,13]=-1.2,s[51,14]=-0.1,s[51,15]=-0.9,s[51,16]=-0.4,s[51,17]=-0.1,s[51,18]=-0.7,s[51,19]=-0.8,s[51,20]=-1.1,s[51,21]=-0.1,s[51,22]=-1.2,s[51,23]=0.9,s[51,24]=0.3,s[51,25]=1.0,s[51,26]=0.0,s[51,27]=1.1,s[51,28]=-0.6,s[51,29]=-0.3,s[51,30]=0.4 s[51,31]=-0.8,s[51,32]=-0.2,s[51,33]=0.7,s[51,34]=0.0,s[51,35]=-0.4,s[51,36]=0.7,s[51,37]=0.8,s[51,38]=-1.2,s[51,39]=1.0,s[51,40]=-0.9,s[51,41]=-0.1,s[51,42]=0.3,s[51,43]=-0.4,s[51,44]=0.8,s[51,45]=-0.9,s[51,46]=1.1,s[51,47]=-0.2,s[51,48]=0.3,s[51,49]=0.6,s[51,50]=0.1,s[51,51]=1.1,s[51,52]=-0.4,s[51,53]=-0.8,s[51,54]=0.0,s[51,55]=0.7,s[51,56]=1.0,s[51,57]=-0.8,s[51,58]=-1.2,s[51,59]=-0.4,s[51,60]=0.8 s[52,1]=0.1,s[52,2]=-0.5,s[52,3]=0.2,s[52,4]=-0.1,s[52,5]=0.3,s[52,6]=-0.8,s[52,7]=0.4,s[52,8]=-1.1,s[52,9]=0.1,s[52,10]=0.1,s[52,11]=0.1,s[52,12]=-0.6,s[52,13]=-1.1,s[52,14]=0.9,s[52,15]=0.4,s[52,16]=-0.1,s[52,17]=0.5,s[52,18]=1.0,s[52,19]=-1.1,s[52,20]=0.4,s[52,21]=-0.3,s[52,22]=1.2,s[52,23]=1.1,s[52,24]=-0.3,s[52,25]=0.7,s[52,26]=-0.3,s[52,27]=-0.4,s[52,28]=-1.0,s[52,29]=0.2,s[52,30]=0.9 s[52,31]=-0.2,s[52,32]=0.3,s[52,33]=0.3,s[52,34]=0.0,s[52,35]=-0.9,s[52,36]=1.2,s[52,37]=-0.4,s[52,38]=-0.2,s[52,39]=0.7,s[52,40]=-1.2,s[52,41]=-0.4,s[52,42]=-0.1,s[52,43]=0.8,s[52,44]=0.9,s[52,45]=1.2,s[52,46]=-0.2,s[52,47]=-0.5,s[52,48]=-0.2,s[52,49]=0.9,s[52,50]=0.3,s[52,51]=-0.5,s[52,52]=0.7,s[52,53]=-0.1,s[52,54]=-0.4,s[52,55]=-0.9,s[52,56]=-0.7,s[52,57]=-0.6,s[52,58]=0.5,s[52,59]=0.5,s[52,60]=0.1 s[53,1]=0.5,s[53,2]=0.6,s[53,3]=-0.2,s[53,4]=0.6,s[53,5]=0.1,s[53,6]=1.1,s[53,7]=0.7,s[53,8]=0.7,s[53,9]=-1.0,s[53,10]=0.9,s[53,11]=-0.6,s[53,12]=-0.5,s[53,13]=0.0,s[53,14]=0.4,s[53,15]=-0.8,s[53,16]=-0.1,s[53,17]=1.0,s[53,18]=-0.3,s[53,19]=1.0,s[53,20]=-0.1,s[53,21]=0.2,s[53,22]=-0.4,s[53,23]=0.5,s[53,24]=0.1,s[53,25]=1.1,s[53,26]=-0.8,s[53,27]=0.3,s[53,28]=0.7,s[53,29]=-0.4,s[53,30]=0.6 s[53,31]=0.3,s[53,32]=0.0,s[53,33]=0.9,s[53,34]=-0.3,s[53,35]=-0.6,s[53,36]=-0.3,s[53,37]=0.1,s[53,38]=-0.3,s[53,39]=0.4,s[53,40]=0.4,s[53,41]=0.9,s[53,42]=-0.6,s[53,43]=1.2,s[53,44]=1.2,s[53,45]=0.3,s[53,46]=0.0,s[53,47]=-0.6,s[53,48]=0.7,s[53,49]=0.2,s[53,50]=0.9,s[53,51]=-0.4,s[53,52]=0.3,s[53,53]=1.2,s[53,54]=0.8,s[53,55]=0.2,s[53,56]=-0.4,s[53,57]=0.7,s[53,58]=-0.6,s[53,59]=-0.8,s[53,60]=0.6 s[54,1]=0.4,s[54,2]=0.7,s[54,3]=0.5,s[54,4]=-1.2,s[54,5]=0.1,s[54,6]=0.9,s[54,7]=-1.2,s[54,8]=1.1,s[54,9]=-1.1,s[54,10]=-1.2,s[54,11]=1.1,s[54,12]=0.8,s[54,13]=-0.1,s[54,14]=-0.4,s[54,15]=-0.4,s[54,16]=0.5,s[54,17]=-0.8,s[54,18]=-0.1,s[54,19]=1.2,s[54,20]=0.3,s[54,21]=-0.6,s[54,22]=-0.2,s[54,23]=-0.9,s[54,24]=0.3,s[54,25]=0.5,s[54,26]=0.0,s[54,27]=1.1,s[54,28]=-1.2,s[54,29]=-0.5,s[54,30]=-0.2 s[54,31]=-0.8,s[54,32]=1.2,s[54,33]=0.3,s[54,34]=-0.1,s[54,35]=-0.6,s[54,36]=0.6,s[54,37]=-0.4,s[54,38]=0.4,s[54,39]=-0.5,s[54,40]=0.8,s[54,41]=-0.8,s[54,42]=-0.9,s[54,43]=-0.8,s[54,44]=-0.8,s[54,45]=-0.3,s[54,46]=-0.3,s[54,47]=-0.7,s[54,48]=-0.4,s[54,49]=1.2,s[54,50]=0.5,s[54,51]=0.5,s[54,52]=-0.4,s[54,53]=1.0,s[54,54]=-0.5,s[54,55]=-1.0,s[54,56]=0.6,s[54,57]=0.9,s[54,58]=-0.5,s[54,59]=1.0,s[54,60]=1.1 s[55,1]=-0.3,s[55,2]=0.4,s[55,3]=-0.7,s[55,4]=0.3,s[55,5]=0.7,s[55,6]=0.9,s[55,7]=-0.1,s[55,8]=1.0,s[55,9]=0.5,s[55,10]=-1.0,s[55,11]=0.6,s[55,12]=0.6,s[55,13]=-0.3,s[55,14]=0.2,s[55,15]=1.1,s[55,16]=-0.4,s[55,17]=-0.1,s[55,18]=-0.8,s[55,19]=0.6,s[55,20]=-0.9,s[55,21]=-0.5,s[55,22]=0.6,s[55,23]=0.5,s[55,24]=-0.4,s[55,25]=0.4,s[55,26]=-1.0,s[55,27]=-1.0,s[55,28]=1.0,s[55,29]=1.1,s[55,30]=0.2 s[55,31]=-0.3,s[55,32]=0.6,s[55,33]=-1.1,s[55,34]=0.4,s[55,35]=0.5,s[55,36]=-1.1,s[55,37]=-0.8,s[55,38]=-1.2,s[55,39]=1.2,s[55,40]=-0.8,s[55,41]=0.7,s[55,42]=-0.2,s[55,43]=0.7,s[55,44]=0.0,s[55,45]=0.4,s[55,46]=0.0,s[55,47]=0.0,s[55,48]=-0.3,s[55,49]=-0.1,s[55,50]=-0.4,s[55,51]=0.7,s[55,52]=-0.2,s[55,53]=-0.1,s[55,54]=-1.0,s[55,55]=0.1,s[55,56]=0.2,s[55,57]=-0.2,s[55,58]=-0.5,s[55,59]=-1.2,s[55,60]=-0.5 s[56,1]=-0.3,s[56,2]=-0.1,s[56,3]=-0.8,s[56,4]=0.2,s[56,5]=-0.4,s[56,6]=0.6,s[56,7]=-0.5,s[56,8]=-0.1,s[56,9]=-0.1,s[56,10]=1.0,s[56,11]=-0.1,s[56,12]=-0.9,s[56,13]=-0.5,s[56,14]=-0.2,s[56,15]=0.0,s[56,16]=-0.2,s[56,17]=0.6,s[56,18]=0.9,s[56,19]=-1.2,s[56,20]=-0.9,s[56,21]=0.4,s[56,22]=-0.7,s[56,23]=0.2,s[56,24]=-0.2,s[56,25]=-1.1,s[56,26]=0.2,s[56,27]=1.2,s[56,28]=-1.1,s[56,29]=0.2,s[56,30]=0.5 s[56,31]=-0.1,s[56,32]=1.0,s[56,33]=1.1,s[56,34]=-0.8,s[56,35]=0.3,s[56,36]=0.8,s[56,37]=-1.0,s[56,38]=0.2,s[56,39]=0.8,s[56,40]=1.1,s[56,41]=-0.1,s[56,42]=-0.2,s[56,43]=1.2,s[56,44]=0.4,s[56,45]=1.1,s[56,46]=-0.1,s[56,47]=-0.1,s[56,48]=1.2,s[56,49]=0.8,s[56,50]=0.8,s[56,51]=-1.2,s[56,52]=0.9,s[56,53]=-0.6,s[56,54]=1.2,s[56,55]=0.7,s[56,56]=-0.1,s[56,57]=1.1,s[56,58]=0.1,s[56,59]=-0.8,s[56,60]=1.1 s[57,1]=0.2,s[57,2]=-0.1,s[57,3]=0.7,s[57,4]=0.9,s[57,5]=-0.7,s[57,6]=-0.5,s[57,7]=-0.1,s[57,8]=-0.9,s[57,9]=0.3,s[57,10]=-0.6,s[57,11]=-0.3,s[57,12]=-1.1,s[57,13]=0.7,s[57,14]=0.0,s[57,15]=-0.3,s[57,16]=-0.2,s[57,17]=0.5,s[57,18]=0.0,s[57,19]=-1.0,s[57,20]=-0.1,s[57,21]=-0.3,s[57,22]=1.1,s[57,23]=0.0,s[57,24]=0.5,s[57,25]=0.4,s[57,26]=0.3,s[57,27]=0.6,s[57,28]=1.2,s[57,29]=0.3,s[57,30]=0.0 s[57,31]=-0.6,s[57,32]=0.8,s[57,33]=0.4,s[57,34]=0.6,s[57,35]=0.6,s[57,36]=0.0,s[57,37]=0.6,s[57,38]=0.3,s[57,39]=-0.2,s[57,40]=-0.1,s[57,41]=-1.2,s[57,42]=-0.5,s[57,43]=-0.8,s[57,44]=0.6,s[57,45]=1.0,s[57,46]=-0.7,s[57,47]=-0.7,s[57,48]=-0.4,s[57,49]=0.0,s[57,50]=0.0,s[57,51]=0.3,s[57,52]=0.0,s[57,53]=-0.8,s[57,54]=0.3,s[57,55]=-0.7,s[57,56]=0.7,s[57,57]=0.5,s[57,58]=0.8,s[57,59]=0.3,s[57,60]=0.6 s[58,1]=-0.3,s[58,2]=0.5,s[58,3]=0.4,s[58,4]=0.5,s[58,5]=-0.9,s[58,6]=-0.7,s[58,7]=1.1,s[58,8]=1.0,s[58,9]=-0.2,s[58,10]=-0.8,s[58,11]=0.5,s[58,12]=1.0,s[58,13]=1.2,s[58,14]=0.1,s[58,15]=1.0,s[58,16]=-0.1,s[58,17]=-0.4,s[58,18]=0.5,s[58,19]=0.7,s[58,20]=0.1,s[58,21]=-0.4,s[58,22]=0.1,s[58,23]=1.2,s[58,24]=0.6,s[58,25]=-0.1,s[58,26]=1.1,s[58,27]=-0.1,s[58,28]=0.8,s[58,29]=-0.8,s[58,30]=-0.5 s[58,31]=-0.4,s[58,32]=0.4,s[58,33]=0.6,s[58,34]=-0.3,s[58,35]=-0.1,s[58,36]=0.0,s[58,37]=-0.2,s[58,38]=-0.2,s[58,39]=0.8,s[58,40]=0.5,s[58,41]=-0.4,s[58,42]=-0.1,s[58,43]=-0.8,s[58,44]=-0.2,s[58,45]=0.2,s[58,46]=-0.3,s[58,47]=-0.4,s[58,48]=0.0,s[58,49]=-1.0,s[58,50]=-1.0,s[58,51]=0.8,s[58,52]=-0.8,s[58,53]=-0.5,s[58,54]=-0.1,s[58,55]=-0.9,s[58,56]=-0.4,s[58,57]=0.6,s[58,58]=0.1,s[58,59]=-0.3,s[58,60]=-0.1 s[59,1]=0.3,s[59,2]=-1.1,s[59,3]=-0.3,s[59,4]=-0.4,s[59,5]=-0.4,s[59,6]=0.3,s[59,7]=-0.5,s[59,8]=-0.1,s[59,9]=0.5,s[59,10]=0.7,s[59,11]=1.0,s[59,12]=-0.3,s[59,13]=-1.1,s[59,14]=0.8,s[59,15]=0.0,s[59,16]=0.3,s[59,17]=-0.2,s[59,18]=-0.9,s[59,19]=-0.3,s[59,20]=-1.1,s[59,21]=-0.3,s[59,22]=0.9,s[59,23]=-0.3,s[59,24]=-0.3,s[59,25]=-1.2,s[59,26]=-0.3,s[59,27]=-0.1,s[59,28]=1.0,s[59,29]=0.0,s[59,30]=-1.1 s[59,31]=0.5,s[59,32]=-1.1,s[59,33]=-1.1,s[59,34]=0.8,s[59,35]=-0.1,s[59,36]=-0.6,s[59,37]=0.0,s[59,38]=0.7,s[59,39]=0.7,s[59,40]=0.3,s[59,41]=0.3,s[59,42]=-0.4,s[59,43]=0.0,s[59,44]=-0.2,s[59,45]=1.0,s[59,46]=0.1,s[59,47]=-0.2,s[59,48]=0.3,s[59,49]=0.4,s[59,50]=1.1,s[59,51]=-1.2,s[59,52]=-1.2,s[59,53]=1.2,s[59,54]=-1.1,s[59,55]=-0.5,s[59,56]=0.8,s[59,57]=-0.7,s[59,58]=-0.8,s[59,59]=-0.1,s[59,60]=1.1 s[60,1]=0.1,s[60,2]=0.1,s[60,3]=0.4,s[60,4]=0.9,s[60,5]=-0.2,s[60,6]=0.7,s[60,7]=-0.2,s[60,8]=0.8,s[60,9]=0.6,s[60,10]=-1.1,s[60,11]=-0.7,s[60,12]=1.0,s[60,13]=-0.4,s[60,14]=0.4,s[60,15]=-0.3,s[60,16]=0.6,s[60,17]=-1.1,s[60,18]=-0.5,s[60,19]=-0.9,s[60,20]=0.3,s[60,21]=0.9,s[60,22]=-0.7,s[60,23]=0.3,s[60,24]=0.8,s[60,25]=-1.1,s[60,26]=-0.9,s[60,27]=-0.2,s[60,28]=-0.8,s[60,29]=1.1,s[60,30]=-0.5 s[60,31]=-0.1,s[60,32]=0.2,s[60,33]=0.3,s[60,34]=-0.4,s[60,35]=0.5,s[60,36]=1.1,s[60,37]=0.7,s[60,38]=0.4,s[60,39]=-1.2,s[60,40]=0.5,s[60,41]=0.3,s[60,42]=1.1,s[60,43]=0.4,s[60,44]=-1.0,s[60,45]=1.1,s[60,46]=0.4,s[60,47]=0.0,s[60,48]=-0.2,s[60,49]=0.6,s[60,50]=-0.3,s[60,51]=-0.3,s[60,52]=-0.2,s[60,53]=0.6,s[60,54]=0.1,s[60,55]=0.0,s[60,56]=-0.2,s[60,57]=-0.9,s[60,58]=0.2,s[60,59]=-0.5,s[60,60]=-0.5 s[61,1]=0.0,s[61,2]=-0.9,s[61,3]=-0.2,s[61,4]=-1.2,s[61,5]=-1.1,s[61,6]=-0.1,s[61,7]=0.6,s[61,8]=-0.3,s[61,9]=0.2,s[61,10]=0.5,s[61,11]=0.3,s[61,12]=-1.2,s[61,13]=0.0,s[61,14]=-1.1,s[61,15]=-0.4,s[61,16]=-0.1,s[61,17]=-0.2,s[61,18]=0.3,s[61,19]=0.1,s[61,20]=-1.0,s[61,21]=0.1,s[61,22]=-0.3,s[61,23]=-0.8,s[61,24]=0.3,s[61,25]=-1.0,s[61,26]=0.8,s[61,27]=0.3,s[61,28]=-0.4,s[61,29]=0.0,s[61,30]=-0.8 s[61,31]=-0.1,s[61,32]=1.0,s[61,33]=-0.2,s[61,34]=0.7,s[61,35]=-0.7,s[61,36]=-0.3,s[61,37]=-0.8,s[61,38]=0.9,s[61,39]=0.7,s[61,40]=0.3,s[61,41]=0.6,s[61,42]=1.1,s[61,43]=1.0,s[61,44]=1.1,s[61,45]=0.2,s[61,46]=0.2,s[61,47]=-0.2,s[61,48]=0.4,s[61,49]=1.0,s[61,50]=0.7,s[61,51]=0.7,s[61,52]=0.3,s[61,53]=0.6,s[61,54]=0.0,s[61,55]=0.2,s[61,56]=0.2,s[61,57]=-0.1,s[61,58]=-1.1,s[61,59]=-0.9,s[61,60]=0.3 s[62,1]=0.1,s[62,2]=1.2,s[62,3]=-0.9,s[62,4]=-0.7,s[62,5]=-0.9,s[62,6]=0.4,s[62,7]=0.3,s[62,8]=-0.9,s[62,9]=0.3,s[62,10]=0.7,s[62,11]=-1.0,s[62,12]=1.0,s[62,13]=0.0,s[62,14]=0.0,s[62,15]=-0.1,s[62,16]=0.8,s[62,17]=0.0,s[62,18]=0.6,s[62,19]=-1.1,s[62,20]=-0.2,s[62,21]=0.1,s[62,22]=-0.8,s[62,23]=1.0,s[62,24]=-0.4,s[62,25]=0.7,s[62,26]=0.9,s[62,27]=0.2,s[62,28]=0.5,s[62,29]=-0.6,s[62,30]=0.6 s[62,31]=-0.2,s[62,32]=0.0,s[62,33]=0.5,s[62,34]=0.2,s[62,35]=0.1,s[62,36]=1.1,s[62,37]=-0.2,s[62,38]=0.5,s[62,39]=0.6,s[62,40]=-0.2,s[62,41]=-0.4,s[62,42]=-1.0,s[62,43]=-1.2,s[62,44]=0.7,s[62,45]=0.7,s[62,46]=-0.1,s[62,47]=0.5,s[62,48]=-0.9,s[62,49]=-0.4,s[62,50]=-0.4,s[62,51]=-0.9,s[62,52]=-0.4,s[62,53]=-0.2,s[62,54]=-0.7,s[62,55]=-0.7,s[62,56]=-0.1,s[62,57]=1.1,s[62,58]=-0.3,s[62,59]=-0.5,s[62,60]=0.2 s[63,1]=0.0,s[63,2]=0.4,s[63,3]=0.0,s[63,4]=-0.4,s[63,5]=0.3,s[63,6]=0.1,s[63,7]=0.5,s[63,8]=-0.2,s[63,9]=0.8,s[63,10]=1.1,s[63,11]=-0.6,s[63,12]=-0.6,s[63,13]=0.0,s[63,14]=-0.1,s[63,15]=-0.4,s[63,16]=0.1,s[63,17]=0.0,s[63,18]=-1.2,s[63,19]=-0.7,s[63,20]=-1.1,s[63,21]=1.0,s[63,22]=0.0,s[63,23]=-0.8,s[63,24]=-0.7,s[63,25]=-1.2,s[63,26]=-0.4,s[63,27]=1.1,s[63,28]=0.9,s[63,29]=0.5,s[63,30]=0.2 s[63,31]=-0.1,s[63,32]=-0.5,s[63,33]=-0.8,s[63,34]=-0.1,s[63,35]=-0.8,s[63,36]=-0.5,s[63,37]=-0.6,s[63,38]=0.8,s[63,39]=1.2,s[63,40]=-1.1,s[63,41]=-0.3,s[63,42]=1.0,s[63,43]=1.2,s[63,44]=0.4,s[63,45]=1.0,s[63,46]=0.0,s[63,47]=0.2,s[63,48]=1.2,s[63,49]=-0.6,s[63,50]=-0.2,s[63,51]=-1.0,s[63,52]=-1.1,s[63,53]=-0.2,s[63,54]=1.2,s[63,55]=0.3,s[63,56]=-0.9,s[63,57]=-0.9,s[63,58]=0.4,s[63,59]=-0.4,s[63,60]=1.0 s[64,1]=0.3,s[64,2]=-1.2,s[64,3]=1.0,s[64,4]=1.1,s[64,5]=0.4,s[64,6]=-0.7,s[64,7]=-1.2,s[64,8]=0.9,s[64,9]=1.2,s[64,10]=0.5,s[64,11]=-1.2,s[64,12]=0.1,s[64,13]=-0.7,s[64,14]=0.3,s[64,15]=-0.8,s[64,16]=0.3,s[64,17]=0.3,s[64,18]=-0.1,s[64,19]=-0.3,s[64,20]=-0.4,s[64,21]=-0.7,s[64,22]=0.0,s[64,23]=-0.2,s[64,24]=-0.3,s[64,25]=1.0,s[64,26]=0.8,s[64,27]=1.0,s[64,28]=1.0,s[64,29]=-0.6,s[64,30]=-0.3 s[64,31]=0.2,s[64,32]=0.4,s[64,33]=-0.5,s[64,34]=-0.3,s[64,35]=-0.9,s[64,36]=0.8,s[64,37]=-0.6,s[64,38]=-0.2,s[64,39]=0.9,s[64,40]=0.3,s[64,41]=0.7,s[64,42]=0.0,s[64,43]=1.1,s[64,44]=-0.9,s[64,45]=1.1,s[64,46]=0.3,s[64,47]=-0.8,s[64,48]=-1.1,s[64,49]=0.7,s[64,50]=-0.4,s[64,51]=-0.9,s[64,52]=-0.3,s[64,53]=-0.8,s[64,54]=0.4,s[64,55]=-0.4,s[64,56]=-0.9,s[64,57]=-1.0,s[64,58]=-0.1,s[64,59]=0.3,s[64,60]=0.2 s[65,1]=0.3,s[65,2]=-0.1,s[65,3]=-0.4,s[65,4]=1.2,s[65,5]=-0.6,s[65,6]=-0.7,s[65,7]=0.1,s[65,8]=0.2,s[65,9]=-0.8,s[65,10]=-0.6,s[65,11]=-0.2,s[65,12]=-0.8,s[65,13]=-0.6,s[65,14]=-0.7,s[65,15]=1.1,s[65,16]=0.0,s[65,17]=1.2,s[65,18]=-0.7,s[65,19]=0.8,s[65,20]=-0.3,s[65,21]=-0.6,s[65,22]=-0.5,s[65,23]=0.9,s[65,24]=1.2,s[65,25]=-1.1,s[65,26]=1.2,s[65,27]=0.5,s[65,28]=0.0,s[65,29]=0.7,s[65,30]=1.1 s[65,31]=0.0,s[65,32]=-0.6,s[65,33]=-1.0,s[65,34]=1.1,s[65,35]=-1.0,s[65,36]=-0.6,s[65,37]=-1.1,s[65,38]=0.4,s[65,39]=-0.8,s[65,40]=-0.9,s[65,41]=0.7,s[65,42]=0.5,s[65,43]=1.1,s[65,44]=1.2,s[65,45]=0.5,s[65,46]=0.3,s[65,47]=0.8,s[65,48]=-0.7,s[65,49]=-0.2,s[65,50]=-1.0,s[65,51]=1.0,s[65,52]=-0.1,s[65,53]=-0.3,s[65,54]=0.9,s[65,55]=1.1,s[65,56]=1.1,s[65,57]=-0.4,s[65,58]=0.5,s[65,59]=0.4,s[65,60]=-1.2 s[66,1]=0.0,s[66,2]=0.1,s[66,3]=0.6,s[66,4]=-0.2,s[66,5]=-0.5,s[66,6]=0.9,s[66,7]=0.5,s[66,8]=-0.3,s[66,9]=-0.6,s[66,10]=-0.9,s[66,11]=-0.2,s[66,12]=-1.1,s[66,13]=0.9,s[66,14]=0.2,s[66,15]=0.4,s[66,16]=0.6,s[66,17]=0.1,s[66,18]=-1.2,s[66,19]=0.6,s[66,20]=0.3,s[66,21]=0.2,s[66,22]=-0.3,s[66,23]=-0.1,s[66,24]=-0.5,s[66,25]=0.3,s[66,26]=-0.6,s[66,27]=-0.2,s[66,28]=-0.3,s[66,29]=-0.4,s[66,30]=-0.9 s[66,31]=0.0,s[66,32]=1.0,s[66,33]=0.0,s[66,34]=-1.0,s[66,35]=0.7,s[66,36]=-1.0,s[66,37]=0.7,s[66,38]=-0.7,s[66,39]=-0.6,s[66,40]=1.2,s[66,41]=0.6,s[66,42]=-1.1,s[66,43]=0.6,s[66,44]=-0.8,s[66,45]=-1.2,s[66,46]=-0.4,s[66,47]=0.9,s[66,48]=0.9,s[66,49]=0.5,s[66,50]=1.0,s[66,51]=0.9,s[66,52]=0.3,s[66,53]=-0.6,s[66,54]=0.6,s[66,55]=-0.2,s[66,56]=-0.6,s[66,57]=0.1,s[66,58]=-0.9,s[66,59]=-0.2,s[66,60]=1.0 s[67,1]=-0.3,s[67,2]=-0.7,s[67,3]=-0.4,s[67,4]=0.6,s[67,5]=0.9,s[67,6]=0.6,s[67,7]=0.5,s[67,8]=-0.4,s[67,9]=0.9,s[67,10]=-0.2,s[67,11]=0.5,s[67,12]=-0.7,s[67,13]=0.2,s[67,14]=1.1,s[67,15]=-1.0,s[67,16]=0.2,s[67,17]=0.2,s[67,18]=0.6,s[67,19]=-0.2,s[67,20]=-1.1,s[67,21]=-0.9,s[67,22]=0.7,s[67,23]=0.4,s[67,24]=0.1,s[67,25]=-0.9,s[67,26]=0.1,s[67,27]=-0.4,s[67,28]=-0.7,s[67,29]=-1.0,s[67,30]=0.8 s[67,31]=0.1,s[67,32]=0.0,s[67,33]=-0.7,s[67,34]=-0.1,s[67,35]=-0.5,s[67,36]=-0.4,s[67,37]=-0.2,s[67,38]=0.4,s[67,39]=0.0,s[67,40]=0.4,s[67,41]=0.8,s[67,42]=-0.1,s[67,43]=-1.0,s[67,44]=-0.7,s[67,45]=1.2,s[67,46]=0.3,s[67,47]=0.8,s[67,48]=-1.0,s[67,49]=-0.2,s[67,50]=-1.0,s[67,51]=0.0,s[67,52]=0.7,s[67,53]=-0.3,s[67,54]=0.7,s[67,55]=1.2,s[67,56]=-0.4,s[67,57]=1.0,s[67,58]=0.8,s[67,59]=-1.2,s[67,60]=0.7 s[68,1]=0.1,s[68,2]=1.2,s[68,3]=1.2,s[68,4]=0.2,s[68,5]=0.6,s[68,6]=-1.0,s[68,7]=-1.0,s[68,8]=-0.4,s[68,9]=-1.2,s[68,10]=-0.4,s[68,11]=0.5,s[68,12]=-0.3,s[68,13]=0.3,s[68,14]=-0.1,s[68,15]=0.6,s[68,16]=0.3,s[68,17]=0.6,s[68,18]=-1.2,s[68,19]=-0.5,s[68,20]=-1.1,s[68,21]=-0.6,s[68,22]=0.8,s[68,23]=-0.6,s[68,24]=0.4,s[68,25]=0.4,s[68,26]=0.1,s[68,27]=0.6,s[68,28]=-0.1,s[68,29]=-0.9,s[68,30]=1.1 s[68,31]=0.4,s[68,32]=-0.7,s[68,33]=-0.7,s[68,34]=-0.9,s[68,35]=0.5,s[68,36]=1.0,s[68,37]=-0.4,s[68,38]=0.1,s[68,39]=0.6,s[68,40]=0.9,s[68,41]=-0.7,s[68,42]=0.6,s[68,43]=1.2,s[68,44]=-0.8,s[68,45]=-0.9,s[68,46]=0.4,s[68,47]=0.6,s[68,48]=-0.4,s[68,49]=-0.1,s[68,50]=-0.9,s[68,51]=-0.7,s[68,52]=-1.2,s[68,53]=1.2,s[68,54]=0.3,s[68,55]=0.5,s[68,56]=0.5,s[68,57]=-1.0,s[68,58]=-0.4,s[68,59]=0.1,s[68,60]=0.3 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float ppz = @ppz float ppw = @ppw float pxx = 0 float pyy = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x pyy = y float pzz = ppz x = s[@sel,1] + s[@sel,2]*x + s[@sel,3]*x*x + s[@sel,4]*x*y + s[@sel,5]*x*ppz + s[@sel,6]*x*ppw + s[@sel,7]*y + s[@sel,8]*y*y + \ s[@sel,9]*y*ppz + s[@sel,10]*y*ppw + s[@sel,11]*ppz + s[@sel,12]*ppz*ppz + s[@sel,13]*ppz*ppw + s[@sel,14]*ppw + s[@sel,15]*ppw*ppw y = s[@sel,16] + s[@sel,17]*pxx + s[@sel,18]*pxx*pxx + s[@sel,19]*pxx*y + s[@sel,20]*pxx*ppz + s[@sel,21]*pxx*ppw + s[@sel,22]*y + s[@sel,23]*y*y + \ s[@sel,24]*y*ppz + s[@sel,25]*y*ppw + s[@sel,26]*ppz + s[@sel,27]*ppz*ppz + s[@sel,28]*ppz*ppw + s[@sel,29]*ppw + s[@sel,30]*ppw*ppw ppz = s[@sel,31] + s[@sel,32]*pxx + s[@sel,33]*pxx*pxx + s[@sel,34]*pxx*pyy + s[@sel,35]*pxx*ppz + s[@sel,36]*pxx*ppw + s[@sel,37]*pyy + s[@sel,38]*pyy*pyy + \ s[@sel,39]*pyy*ppz + s[@sel,40]*pyy*ppw + s[@sel,41]*ppz + s[@sel,42]*ppz*ppz + s[@sel,43]*ppz*ppw + s[@sel,44]*ppw + s[@sel,45]*ppw*ppw ppw = s[@sel,46] + s[@sel,47]*pxx + s[@sel,48]*pxx*pxx + s[@sel,49]*pxx*pyy + s[@sel,50]*pxx*pzz + s[@sel,51]*pxx*ppw + s[@sel,52]*pyy + s[@sel,53]*pyy*pyy + \ s[@sel,54]*pyy*pzz + s[@sel,55]*pyy*ppw + s[@sel,56]*pzz + s[@sel,57]*pzz*pzz + s[@sel,58]*pzz*ppw + s[@sel,59]*ppw + s[@sel,60]*ppw*ppw att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y) + ppz*@pw + ppw*@p4) float d = @distscale*|pz-(x + sgn*flip(y) + ppz*@pw + ppw*@p4)| return d endfunc private: float s[69,61] default: title = "Sprott4D" heading text="Sprott 4D Quadratic attractors" endheading heading text=" x -> Quadratic in x, y, z and w" endheading heading text=" y -> Quadratic in x, y, z and w" endheading heading text=" z -> Quadratic in x, y, z and w" endheading heading text=" w -> Quadratic in x, y, z and w" endheading int param v_trapshapesprott4d caption = "Version (Trap Shape Sprott4D)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesprott4D < 100 endparam param sel caption = "Sprott selector" default = 0 enum = "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" \ "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" \ "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" \ "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" \ "41" "42" "43" "44" "45" "46" "47" "48" "49" "50" \ "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" \ "61" "62" "63" "64" "65" "66" "67" "68" hint = "Each Sprott selector uses a different strange attractor." endparam heading text = "'Initialize Height' sets the starting z value for the attractor." endheading float param ppz caption = "Initialize Height" default = 0.0 endparam heading text = "'Initialize 4th dim' sets the starting w value for the attractor." endheading float param ppw caption = "Initialize 4th dim" default = 0.0 endparam heading text = "'Height weight' determines the weight of the final z value which is added \ to the trap distance." endheading complex param pw caption = "Height weight" default = (0.5,0) endparam heading text = "'4D weight' determines the weight of the final w value which is added \ to the trap distance." endheading complex param p4 caption = "4D weight" default = (0,0) endparam float param distscale caption = "Distance scale" default = 2 endparam float param s caption = "Attractor scale" default = 1 endparam int param max_att_iterations caption = "Attractor iterations" default = 20 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeSprott4D_ODE(common.ulb:TrapShape) { ; This shape uses a Sprott strange attractor.
;

; The Sprott attractors were developed by Julien C. Sprott, and are ; based upon polynomials and linear differential equations of polynomials. public: import "common.ulb" ; Constructor func REB_TrapShapeSprott4D_ODE(Generic pparent) TrapShape.TrapShape(pparent) s[0,1]=0.0,s[0,2]=-0.6,s[0,3]=0.0,s[0,4]=-0.8,s[0,5]=-0.8,s[0,6]=-0.6,s[0,7]=0.3,s[0,8]=0.1,s[0,9]=0.5,s[0,10]=-0.4,s[0,11]=0.0,s[0,12]=0.4,s[0,13]=0.7,s[0,14]=0.4,s[0,15]=1.2,s[0,16]=-0.6,s[0,17]=0.4,s[0,18]=-0.2,s[0,19]=-1.2,s[0,20]=0.2,s[0,21]=-1.0,s[0,22]=-0.6,s[0,23]=-0.9,s[0,24]=0.7,s[0,25]=-0.6,s[0,26]=1.2,s[0,27]=0.8,s[0,28]=-0.3,s[0,29]=0.3,s[0,30]=0.3 s[0,31]=-1.2,s[0,32]=0.6,s[0,33]=0.3,s[0,34]=0.6,s[0,35]=-0.5,s[0,36]=0.4,s[0,37]=-0.2,s[0,38]=-0.4,s[0,39]=-0.6,s[0,40]=-0.3,s[0,41]=-0.7,s[0,42]=0.0,s[0,43]=1.0,s[0,44]=0.8,s[0,45]=1.1,s[0,46]=0.7,s[0,47]=0.3,s[0,48]=-0.3,s[0,49]=-1.2,s[0,50]=-0.6,s[0,51]=-1.1,s[0,52]=-0.3,s[0,53]=-0.2,s[0,54]=-0.7,s[0,55]=-1.0,s[0,56]=1.2,s[0,57]=-1.2,s[0,58]=-0.7,s[0,59]=0.2,s[0,60]=-0.2 s[1,1]=0.7,s[1,2]=0.1,s[1,3]=0.1,s[1,4]=1.2,s[1,5]=-1.0,s[1,6]=0.4,s[1,7]=0.7,s[1,8]=-0.9,s[1,9]=-0.3,s[1,10]=-0.9,s[1,11]=-0.5,s[1,12]=-0.5,s[1,13]=-1.0,s[1,14]=0.0,s[1,15]=-0.4,s[1,16]=-0.2,s[1,17]=-0.5,s[1,18]=0.1,s[1,19]=-1.0,s[1,20]=0.3,s[1,21]=-0.4,s[1,22]=1.1,s[1,23]=1.1,s[1,24]=0.0,s[1,25]=-1.1,s[1,26]=-0.7,s[1,27]=0.0,s[1,28]=0.5,s[1,29]=0.7,s[1,30]=0.7,s[1,31]=-1.0,s[1,32]=0.7,s[1,33]=0.2,s[1,34]=-0.7,s[1,35]=-1.1,s[1,36]=0.7,s[1,37]=-0.7,s[1,38]=0.0,s[1,39]=-0.5,s[1,40]=0.2,s[1,41]=-0.1,s[1,42]=-0.6,s[1,43]=0.2,s[1,44]=-0.4,s[1,45]=-0.8,s[1,46]=0.8,s[1,47]=0.5,s[1,48]=-1.2,s[1,49]=-0.4,s[1,50]=-1.1,s[1,51]=-1.1,s[1,52]=-0.5,s[1,53]=0.2,s[1,54]=-0.8,s[1,55]=0.3,s[1,56]=0.2,s[1,57]=-0.5,s[1,58]=0.0,s[1,59]=-0.9,s[1,60]=-1.0 s[2,1]=0.0,s[2,2]=-0.9,s[2,3]=1.2,s[2,4]=0.3,s[2,5]=0.6,s[2,6]=0.6,s[2,7]=-0.7,s[2,8]=-0.1,s[2,9]=-0.1,s[2,10]=-0.9,s[2,11]=0.8,s[2,12]=0.5,s[2,13]=0.7,s[2,14]=0.8,s[2,15]=-1.2,s[2,16]=-1.0,s[2,17]=-0.2,s[2,18]=-1.1,s[2,19]=0.5,s[2,20]=-0.9,s[2,21]=0.6,s[2,22]=-0.1,s[2,23]=0.6,s[2,24]=0.2,s[2,25]=-0.3,s[2,26]=-0.5,s[2,27]=1.1,s[2,28]=-0.3,s[2,29]=-0.7,s[2,30]=-0.4,s[2,31]=-0.6,s[2,32]=0.9,s[2,33]=0.0,s[2,34]=-0.6,s[2,35]=1.2,s[2,36]=-0.4,s[2,37]=0.9,s[2,38]=0.7,s[2,39]=-0.2,s[2,40]=-0.1,s[2,41]=-0.8,s[2,42]=-0.8,s[2,43]=-1.2,s[2,44]=1.2,s[2,45]=0.2,s[2,46]=-0.7,s[2,47]=-0.9,s[2,48]=-0.4,s[2,49]=0.1,s[2,50]=0.7,s[2,51]=0.2,s[2,52]=1.1,s[2,53]=-0.1,s[2,54]=-1.2,s[2,55]=-0.5,s[2,56]=0.0,s[2,57]=1.0,s[2,58]=1.2,s[2,59]=-0.2,s[2,60]=-1.1 s[3,1]=0.0,s[3,2]=-0.7,s[3,3]=0.0,s[3,4]=-0.8,s[3,5]=-0.8,s[3,6]=-0.6,s[3,7]=0.3,s[3,8]=0.1,s[3,9]=0.5,s[3,10]=-0.4,s[3,11]=0.0,s[3,12]=0.4,s[3,13]=0.7,s[3,14]=0.4,s[3,15]=1.2,s[3,16]=-0.6,s[3,17]=0.4,s[3,18]=-0.2,s[3,19]=-1.2,s[3,20]=0.2,s[3,21]=-1.0,s[3,22]=-0.6,s[3,23]=-0.9,s[3,24]=0.7,s[3,25]=-0.6,s[3,26]=1.2,s[3,27]=0.8,s[3,28]=-0.3,s[3,29]=0.3,s[3,30]=0.3,s[3,31]=-1.2,s[3,32]=0.6,s[3,33]=0.3,s[3,34]=0.6,s[3,35]=-0.5,s[3,36]=0.4,s[3,37]=-0.2,s[3,38]=-0.4,s[3,39]=-0.6,s[3,40]=-0.3,s[3,41]=-0.7,s[3,42]=0.0,s[3,43]=1.0,s[3,44]=0.8,s[3,45]=1.1,s[3,46]=0.7,s[3,47]=0.3,s[3,48]=-0.3,s[3,49]=-1.2,s[3,50]=-0.6,s[3,51]=-1.1,s[3,52]=-0.3,s[3,53]=-0.2,s[3,54]=-0.7,s[3,55]=-1.0,s[3,56]=1.2,s[3,57]=-1.2,s[3,58]=-0.7,s[3,59]=0.2,s[3,60]=-0.2 s[4,1]=-0.7,s[4,2]=-1.1,s[4,3]=1.2,s[4,4]=-0.2,s[4,5]=-1.1,s[4,6]=0.8,s[4,7]=-1.1,s[4,8]=0.8,s[4,9]=0.3,s[4,10]=-0.9,s[4,11]=-0.5,s[4,12]=0.5,s[4,13]=-0.2,s[4,14]=-0.7,s[4,15]=0.3,s[4,16]=1.2,s[4,17]=-0.8,s[4,18]=0.0,s[4,19]=-1.0,s[4,20]=-1.0,s[4,21]=-1.0,s[4,22]=0.8,s[4,23]=-0.4,s[4,24]=0.6,s[4,25]=-1.1,s[4,26]=0.7,s[4,27]=-0.5,s[4,28]=-0.4,s[4,29]=-1.2,s[4,30]=0.7,s[4,31]=-0.9,s[4,32]=0.5,s[4,33]=0.9,s[4,34]=-0.6,s[4,35]=-1.1,s[4,36]=-0.5,s[4,37]=0.0,s[4,38]=-1.0,s[4,39]=0.1,s[4,40]=1.0,s[4,41]=-1.0,s[4,42]=-0.3,s[4,43]=-0.8,s[4,44]=1.2,s[4,45]=-0.3,s[4,46]=0.8,s[4,47]=0.8,s[4,48]=-1.2,s[4,49]=-0.3,s[4,50]=0.7,s[4,51]=1.1,s[4,52]=0.8,s[4,53]=0.1,s[4,54]=0.8,s[4,55]=0.3,s[4,56]=1.2,s[4,57]=1.0,s[4,58]=0.2,s[4,59]=0.6,s[4,60]=-0.6 s[5,1]=-0.2,s[5,2]=0.0,s[5,3]=-1.0,s[5,4]=1.0,s[5,5]=-0.3,s[5,6]=-0.7,s[5,7]=-1.2,s[5,8]=-0.6,s[5,9]=0.4,s[5,10]=0.5,s[5,11]=0.9,s[5,12]=1.1,s[5,13]=0.8,s[5,14]=1.2,s[5,15]=0.1,s[5,16]=1.1,s[5,17]=-0.5,s[5,18]=-0.4,s[5,19]=-0.4,s[5,20]=0.4,s[5,21]=-0.9,s[5,22]=-0.2,s[5,23]=0.0,s[5,24]=-0.9,s[5,25]=-0.8,s[5,26]=1.2,s[5,27]=-1.2,s[5,28]=0.2,s[5,29]=0.4,s[5,30]=-0.1,s[5,31]=0.3,s[5,32]=-0.6,s[5,33]=-0.1,s[5,34]=-1.1,s[5,35]=-0.5,s[5,36]=-1.0,s[5,37]=0.7,s[5,38]=0.0,s[5,39]=-1.0,s[5,40]=0.0,s[5,41]=0.3,s[5,42]=0.3,s[5,43]=1.0,s[5,44]=0.1,s[5,45]=1.0,s[5,46]=1.2,s[5,47]=-0.1,s[5,48]=-0.4,s[5,49]=-0.5,s[5,50]=0.1,s[5,51]=-0.4,s[5,52]=0.4,s[5,53]=-0.6,s[5,54]=-1.1,s[5,55]=-0.1,s[5,56]=0.0,s[5,57]=0.2,s[5,58]=0.0,s[5,59]=-0.1,s[5,60]=-0.9 s[6,1]=-0.3,s[6,2]=0.6,s[6,3]=0.0,s[6,4]=-0.7,s[6,5]=0.6,s[6,6]=1.2,s[6,7]=-0.1,s[6,8]=0.7,s[6,9]=-0.9,s[6,10]=-1.1,s[6,11]=1.2,s[6,12]=1.1,s[6,13]=-1.1,s[6,14]=-0.1,s[6,15]=0.3,s[6,16]=-0.1,s[6,17]=-0.9,s[6,18]=-0.4,s[6,19]=0.3,s[6,20]=0.1,s[6,21]=-1.2,s[6,22]=-0.6,s[6,23]=-0.3,s[6,24]=0.2,s[6,25]=-0.2,s[6,26]=-0.2,s[6,27]=0.3,s[6,28]=1.1,s[6,29]=-1.1,s[6,30]=-1.0,s[6,31]=-1.0,s[6,32]=0.3,s[6,33]=-0.3,s[6,34]=0.6,s[6,35]=-1.2,s[6,36]=0.1,s[6,37]=-0.2,s[6,38]=0.5,s[6,39]=1.2,s[6,40]=0.9,s[6,41]=-0.5,s[6,42]=1.1,s[6,43]=-0.3,s[6,44]=0.9,s[6,45]=-0.3,s[6,46]=1.0,s[6,47]=-0.5,s[6,48]=-0.2,s[6,49]=0.2,s[6,50]=0.9,s[6,51]=1.1,s[6,52]=0.5,s[6,53]=-1.0,s[6,54]=-0.5,s[6,55]=0.9,s[6,56]=-0.6,s[6,57]=-1.1,s[6,58]=-0.2,s[6,59]=-0.3,s[6,60]=0.5 s[7,1]=-0.8,s[7,2]=0.7,s[7,3]=-0.5,s[7,4]=-1.1,s[7,5]=-0.7,s[7,6]=0.7,s[7,7]=-1.1,s[7,8]=-0.3,s[7,9]=0.6,s[7,10]=-0.1,s[7,11]=-0.8,s[7,12]=0.6,s[7,13]=1.2,s[7,14]=-1.1,s[7,15]=0.6,s[7,16]=-0.1,s[7,17]=-0.3,s[7,18]=0.5,s[7,19]=0.1,s[7,20]=0.9,s[7,21]=0.8,s[7,22]=-0.6,s[7,23]=0.8,s[7,24]=1.2,s[7,25]=0.3,s[7,26]=-0.5,s[7,27]=0.7,s[7,28]=0.1,s[7,29]=1.2,s[7,30]=-1.1,s[7,31]=0.9,s[7,32]=-0.9,s[7,33]=0.6,s[7,34]=-0.4,s[7,35]=0.2,s[7,36]=-0.7,s[7,37]=-0.8,s[7,38]=-0.6,s[7,39]=-0.7,s[7,40]=-0.5,s[7,41]=0.8,s[7,42]=-1.2,s[7,43]=1.0,s[7,44]=-1.2,s[7,45]=0.1,s[7,46]=-0.4,s[7,47]=0.1,s[7,48]=-0.6,s[7,49]=-0.6,s[7,50]=0.2,s[7,51]=-0.4,s[7,52]=0.5,s[7,53]=-0.2,s[7,54]=-0.5,s[7,55]=0.9,s[7,56]=-0.1,s[7,57]=-1.1,s[7,58]=0.4,s[7,59]=-1.0,s[7,60]=-0.3 s[8,1]=1.1,s[8,2]=-1.0,s[8,3]=0.7,s[8,4]=0.9,s[8,5]=1.1,s[8,6]=-0.1,s[8,7]=0.3,s[8,8]=0.4,s[8,9]=-1.1,s[8,10]=-1.0,s[8,11]=-0.9,s[8,12]=-1.1,s[8,13]=-0.4,s[8,14]=-1.1,s[8,15]=-0.2,s[8,16]=-1.2,s[8,17]=-0.2,s[8,18]=0.1,s[8,19]=0.7,s[8,20]=0.7,s[8,21]=0.5,s[8,22]=-0.3,s[8,23]=-1.0,s[8,24]=0.1,s[8,25]=-0.7,s[8,26]=0.8,s[8,27]=-1.2,s[8,28]=-0.7,s[8,29]=0.5,s[8,30]=0.9,s[8,31]=-0.6,s[8,32]=-0.8,s[8,33]=-0.5,s[8,34]=0.3,s[8,35]=0.2,s[8,36]=0.8,s[8,37]=-0.6,s[8,38]=1.0,s[8,39]=-0.8,s[8,40]=-1.2,s[8,41]=0.5,s[8,42]=-0.2,s[8,43]=-1.1,s[8,44]=-0.4,s[8,45]=0.4,s[8,46]=0.9,s[8,47]=0.6,s[8,48]=0.6,s[8,49]=0.1,s[8,50]=1.0,s[8,51]=0.6,s[8,52]=-0.8,s[8,53]=0.6,s[8,54]=0.2,s[8,55]=0.7,s[8,56]=1.1,s[8,57]=0.8,s[8,58]=0.2,s[8,59]=-0.6,s[8,60]=-0.5 s[9,1]=0.8,s[9,2]=-0.1,s[9,3]=-0.2,s[9,4]=-0.4,s[9,5]=1.2,s[9,6]=-0.6,s[9,7]=-0.2,s[9,8]=0.7,s[9,9]=-0.9,s[9,10]=0.0,s[9,11]=-0.2,s[9,12]=-1.0,s[9,13]=0.9,s[9,14]=-1.1,s[9,15]=0.5,s[9,16]=0.0,s[9,17]=1.0,s[9,18]=-0.9,s[9,19]=-0.2,s[9,20]=-1.0,s[9,21]=1.0,s[9,22]=0.0,s[9,23]=0.8,s[9,24]=1.2,s[9,25]=1.2,s[9,26]=0.7,s[9,27]=0.0,s[9,28]=-0.5,s[9,29]=0.7,s[9,30]=-0.7,s[9,31]=0.1,s[9,32]=-0.9,s[9,33]=-0.9,s[9,34]=0.6,s[9,35]=-0.5,s[9,36]=0.0,s[9,37]=0.9,s[9,38]=-0.2,s[9,39]=0.6,s[9,40]=-1.1,s[9,41]=0.0,s[9,42]=1.2,s[9,43]=0.6,s[9,44]=-0.3,s[9,45]=-1.1,s[9,46]=-1.0,s[9,47]=-0.5,s[9,48]=-1.0,s[9,49]=0.5,s[9,50]=0.7,s[9,51]=-0.5,s[9,52]=-1.1,s[9,53]=0.7,s[9,54]=-0.8,s[9,55]=-0.7,s[9,56]=0.9,s[9,57]=1.1,s[9,58]=-0.6,s[9,59]=1.1,s[9,60]=1.2 s[10,1]=0.1,s[10,2]=0.3,s[10,3]=-1.0,s[10,4]=-0.3,s[10,5]=-0.7,s[10,6]=0.8,s[10,7]=0.5,s[10,8]=-0.5,s[10,9]=0.5,s[10,10]=-1.1,s[10,11]=-0.7,s[10,12]=0.9,s[10,13]=0.1,s[10,14]=-0.8,s[10,15]=0.0,s[10,16]=-0.6,s[10,17]=-0.8,s[10,18]=1.2,s[10,19]=-1.2,s[10,20]=0.9,s[10,21]=1.1,s[10,22]=-1.1,s[10,23]=-0.3,s[10,24]=0.8,s[10,25]=0.9,s[10,26]=1.2,s[10,27]=1.0,s[10,28]=0.6,s[10,29]=0.5,s[10,30]=-0.9,s[10,31]=-1.0,s[10,32]=1.2,s[10,33]=-0.2,s[10,34]=-0.3,s[10,35]=-1.2,s[10,36]=0.7,s[10,37]=-0.3,s[10,38]=-0.2,s[10,39]=-0.8,s[10,40]=-1.1,s[10,41]=-0.4,s[10,42]=1.2,s[10,43]=1.1,s[10,44]=0.3,s[10,45]=-1.1,s[10,46]=1.0,s[10,47]=-1.0,s[10,48]=-0.3,s[10,49]=0.3,s[10,50]=-0.7,s[10,51]=-0.9,s[10,52]=0.2,s[10,53]=0.2,s[10,54]=0.1,s[10,55]=-0.4,s[10,56]=0.6,s[10,57]=-1.1,s[10,58]=0.6,s[10,59]=-0.1,s[10,60]=-0.9 s[11,1]=0.0,s[11,2]=0.8,s[11,3]=-0.3,s[11,4]=-0.5,s[11,5]=-0.4,s[11,6]=0.3,s[11,7]=0.8,s[11,8]=-0.3,s[11,9]=-0.5,s[11,10]=-0.6,s[11,11]=0.6,s[11,12]=1.1,s[11,13]=-0.6,s[11,14]=-0.1,s[11,15]=0.0,s[11,16]=-0.1,s[11,17]=0.5,s[11,18]=0.0,s[11,19]=0.8,s[11,20]=0.7,s[11,21]=0.4,s[11,22]=-0.9,s[11,23]=-0.1,s[11,24]=0.3,s[11,25]=-0.6,s[11,26]=0.7,s[11,27]=-0.7,s[11,28]=1.1,s[11,29]=0.3,s[11,30]=-0.9,s[11,31]=0.6,s[11,32]=-0.9,s[11,33]=0.7,s[11,34]=-0.5,s[11,35]=0.7,s[11,36]=1.1,s[11,37]=-1.2,s[11,38]=1.2,s[11,39]=-0.9,s[11,40]=-1.0,s[11,41]=-1.2,s[11,42]=1.0,s[11,43]=-0.6,s[11,44]=0.2,s[11,45]=-0.6,s[11,46]=1.2,s[11,47]=0.3,s[11,48]=-0.3,s[11,49]=-0.6,s[11,50]=0.8,s[11,51]=-0.4,s[11,52]=0.7,s[11,53]=-0.4,s[11,54]=0.0,s[11,55]=0.2,s[11,56]=-0.1,s[11,57]=0.1,s[11,58]=0.3,s[11,59]=-0.6,s[11,60]=-0.7 s[12,1]=-0.7,s[12,2]=-1.1,s[12,3]=-0.1,s[12,4]=-0.8,s[12,5]=1.2,s[12,6]=-0.6,s[12,7]=0.6,s[12,8]=-0.7,s[12,9]=0.5,s[12,10]=1.2,s[12,11]=0.1,s[12,12]=0.5,s[12,13]=0.9,s[12,14]=1.1,s[12,15]=-1.0,s[12,16]=0.8,s[12,17]=0.4,s[12,18]=-1.0,s[12,19]=-0.4,s[12,20]=0.0,s[12,21]=-0.2,s[12,22]=0.3,s[12,23]=0.0,s[12,24]=-1.1,s[12,25]=-0.1,s[12,26]=-0.7,s[12,27]=-1.2,s[12,28]=0.1,s[12,29]=0.9,s[12,30]=1.0,s[12,31]=-0.6,s[12,32]=-1.0,s[12,33]=0.7,s[12,34]=-1.0,s[12,35]=0.3,s[12,36]=-1.1,s[12,37]=-1.1,s[12,38]=1.0,s[12,39]=0.1,s[12,40]=0.8,s[12,41]=0.4,s[12,42]=-0.4,s[12,43]=-0.3,s[12,44]=-0.1,s[12,45]=0.2,s[12,46]=-0.3,s[12,47]=-0.4,s[12,48]=0.5,s[12,49]=-1.0,s[12,50]=-0.9,s[12,51]=1.1,s[12,52]=1.2,s[12,53]=0.5,s[12,54]=0.0,s[12,55]=-0.1,s[12,56]=-0.9,s[12,57]=0.4,s[12,58]=1.0,s[12,59]=-0.4,s[12,60]=-1.2 s[13,1]=0.7,s[13,2]=1.1,s[13,3]=-0.1,s[13,4]=-0.3,s[13,5]=0.6,s[13,6]=0.8,s[13,7]=0.3,s[13,8]=-0.3,s[13,9]=-1.2,s[13,10]=0.7,s[13,11]=-0.2,s[13,12]=1.0,s[13,13]=0.4,s[13,14]=0.2,s[13,15]=-0.3,s[13,16]=0.6,s[13,17]=0.9,s[13,18]=0.3,s[13,19]=-1.0,s[13,20]=0.8,s[13,21]=-0.6,s[13,22]=-0.8,s[13,23]=-0.7,s[13,24]=-0.3,s[13,25]=-0.1,s[13,26]=-0.4,s[13,27]=0.1,s[13,28]=1.1,s[13,29]=0.6,s[13,30]=0.9,s[13,31]=-0.7,s[13,32]=0.7,s[13,33]=0.0,s[13,34]=0.6,s[13,35]=0.8,s[13,36]=-0.9,s[13,37]=0.8,s[13,38]=0.7,s[13,39]=-0.6,s[13,40]=0.9,s[13,41]=-1.1,s[13,42]=-0.7,s[13,43]=0.5,s[13,44]=0.0,s[13,45]=0.8,s[13,46]=1.0,s[13,47]=0.3,s[13,48]=-0.9,s[13,49]=-0.7,s[13,50]=-0.1,s[13,51]=0.4,s[13,52]=0.2,s[13,53]=-0.9,s[13,54]=-1.2,s[13,55]=-0.4,s[13,56]=0.3,s[13,57]=-0.8,s[13,58]=-0.5,s[13,59]=-0.5,s[13,60]=1.1 s[14,1]=-0.2,s[14,2]=1.1,s[14,3]=-1.1,s[14,4]=1.2,s[14,5]=1.2,s[14,6]=1.0,s[14,7]=0.2,s[14,8]=1.0,s[14,9]=-0.3,s[14,10]=0.6,s[14,11]=0.5,s[14,12]=0.8,s[14,13]=-0.6,s[14,14]=-0.6,s[14,15]=-0.3,s[14,16]=-1.0,s[14,17]=-0.6,s[14,18]=0.8,s[14,19]=0.6,s[14,20]=0.5,s[14,21]=1.0,s[14,22]=-0.3,s[14,23]=1.1,s[14,24]=-0.7,s[14,25]=-0.7,s[14,26]=1.0,s[14,27]=-0.8,s[14,28]=0.5,s[14,29]=0.5,s[14,30]=1.2,s[14,31]=0.1,s[14,32]=-0.3,s[14,33]=-1.2,s[14,34]=-0.4,s[14,35]=0.7,s[14,36]=0.3,s[14,37]=0.3,s[14,38]=0.9,s[14,39]=-0.9,s[14,40]=0.8,s[14,41]=0.9,s[14,42]=0.0,s[14,43]=0.8,s[14,44]=-0.3,s[14,45]=-0.4,s[14,46]=-1.2,s[14,47]=1.1,s[14,48]=1.0,s[14,49]=1.0,s[14,50]=-1.2,s[14,51]=-1.2,s[14,52]=0.8,s[14,53]=-0.3,s[14,54]=0.5,s[14,55]=-0.5,s[14,56]=0.9,s[14,57]=0.0,s[14,58]=0.6,s[14,59]=-1.0,s[14,60]=-0.1 s[15,1]=0.3,s[15,2]=0.1,s[15,3]=0.2,s[15,4]=0.7,s[15,5]=0.6,s[15,6]=-0.6,s[15,7]=-0.1,s[15,8]=-0.7,s[15,9]=0.3,s[15,10]=-0.5,s[15,11]=0.3,s[15,12]=-0.2,s[15,13]=0.0,s[15,14]=0.6,s[15,15]=-0.3,s[15,16]=-0.1,s[15,17]=0.4,s[15,18]=0.1,s[15,19]=0.7,s[15,20]=-1.0,s[15,21]=0.9,s[15,22]=0.4,s[15,23]=-0.5,s[15,24]=1.1,s[15,25]=1.1,s[15,26]=-0.6,s[15,27]=0.6,s[15,28]=0.6,s[15,29]=-0.3,s[15,30]=-0.9,s[15,31]=0.8,s[15,32]=0.1,s[15,33]=0.0,s[15,34]=0.4,s[15,35]=1.2,s[15,36]=1.0,s[15,37]=1.2,s[15,38]=-1.1,s[15,39]=-0.3,s[15,40]=-0.3,s[15,41]=-0.3,s[15,42]=0.2,s[15,43]=0.6,s[15,44]=-0.8,s[15,45]=0.3,s[15,46]=1.2,s[15,47]=0.8,s[15,48]=0.6,s[15,49]=1.0,s[15,50]=0.0,s[15,51]=0.0,s[15,52]=1.1,s[15,53]=-1.0,s[15,54]=1.1,s[15,55]=0.6,s[15,56]=0.1,s[15,57]=-1.2,s[15,58]=1.2,s[15,59]=-0.9,s[15,60]=0.3 s[16,1]=-0.5,s[16,2]=0.5,s[16,3]=0.8,s[16,4]=0.4,s[16,5]=0.1,s[16,6]=-0.3,s[16,7]=-0.3,s[16,8]=0.9,s[16,9]=-0.9,s[16,10]=-0.6,s[16,11]=1.2,s[16,12]=-0.9,s[16,13]=-0.3,s[16,14]=0.4,s[16,15]=0.2,s[16,16]=-0.3,s[16,17]=-0.1,s[16,18]=0.7,s[16,19]=1.2,s[16,20]=0.3,s[16,21]=-0.5,s[16,22]=-0.2,s[16,23]=0.7,s[16,24]=-0.8,s[16,25]=0.9,s[16,26]=0.9,s[16,27]=0.2,s[16,28]=-0.4,s[16,29]=1.2,s[16,30]=0.5,s[16,31]=-0.3,s[16,32]=-0.2,s[16,33]=0.5,s[16,34]=-0.2,s[16,35]=-0.6,s[16,36]=0.9,s[16,37]=-0.5,s[16,38]=1.2,s[16,39]=0.7,s[16,40]=0.9,s[16,41]=0.4,s[16,42]=-0.9,s[16,43]=0.4,s[16,44]=0.6,s[16,45]=-0.6,s[16,46]=0.9,s[16,47]=-0.4,s[16,48]=-0.6,s[16,49]=-0.5,s[16,50]=-0.6,s[16,51]=-0.1,s[16,52]=-0.8,s[16,53]=-1.2,s[16,54]=-0.8,s[16,55]=1.2,s[16,56]=0.1,s[16,57]=-0.8,s[16,58]=0.8,s[16,59]=-1.1,s[16,60]=0.4 s[17,1]=0.5,s[17,2]=0.0,s[17,3]=-1.2,s[17,4]=0.7,s[17,5]=0.3,s[17,6]=0.8,s[17,7]=0.5,s[17,8]=1.1,s[17,9]=-0.5,s[17,10]=-1.0,s[17,11]=-1.2,s[17,12]=-0.3,s[17,13]=0.0,s[17,14]=1.2,s[17,15]=0.5,s[17,16]=1.2,s[17,17]=-0.6,s[17,18]=0.7,s[17,19]=0.2,s[17,20]=0.7,s[17,21]=1.2,s[17,22]=-0.3,s[17,23]=-0.8,s[17,24]=0.7,s[17,25]=-1.0,s[17,26]=0.6,s[17,27]=0.3,s[17,28]=-0.5,s[17,29]=1.2,s[17,30]=-0.7,s[17,31]=1.0,s[17,32]=0.0,s[17,33]=-0.7,s[17,34]=0.7,s[17,35]=0.3,s[17,36]=-0.5,s[17,37]=-0.3,s[17,38]=-0.7,s[17,39]=0.0,s[17,40]=-0.6,s[17,41]=0.7,s[17,42]=0.9,s[17,43]=-1.2,s[17,44]=0.3,s[17,45]=0.2,s[17,46]=-0.1,s[17,47]=-1.1,s[17,48]=-1.1,s[17,49]=1.0,s[17,50]=-0.5,s[17,51]=-0.3,s[17,52]=0.3,s[17,53]=-0.5,s[17,54]=0.7,s[17,55]=-1.2,s[17,56]=0.9,s[17,57]=1.1,s[17,58]=0.9,s[17,59]=1.0,s[17,60]=0.4 s[18,1]=-1.0,s[18,2]=-0.3,s[18,3]=1.2,s[18,4]=-0.9,s[18,5]=-0.6,s[18,6]=1.0,s[18,7]=0.5,s[18,8]=-1.2,s[18,9]=-1.0,s[18,10]=-0.9,s[18,11]=0.8,s[18,12]=-1.1,s[18,13]=0.2,s[18,14]=-0.6,s[18,15]=-0.2,s[18,16]=-0.7,s[18,17]=0.6,s[18,18]=0.4,s[18,19]=0.6,s[18,20]=0.3,s[18,21]=-0.4,s[18,22]=-0.1,s[18,23]=0.5,s[18,24]=0.1,s[18,25]=-0.3,s[18,26]=-0.7,s[18,27]=-0.4,s[18,28]=-0.2,s[18,29]=0.5,s[18,30]=0.7,s[18,31]=-0.9,s[18,32]=0.2,s[18,33]=0.4,s[18,34]=0.0,s[18,35]=-0.4,s[18,36]=0.2,s[18,37]=-0.4,s[18,38]=0.0,s[18,39]=1.2,s[18,40]=-1.2,s[18,41]=-1.1,s[18,42]=-0.1,s[18,43]=-1.1,s[18,44]=0.6,s[18,45]=1.1,s[18,46]=0.3,s[18,47]=1.0,s[18,48]=-1.1,s[18,49]=-0.8,s[18,50]=-0.8,s[18,51]=0.2,s[18,52]=0.2,s[18,53]=-1.2,s[18,54]=-1.0,s[18,55]=-1.1,s[18,56]=-0.5,s[18,57]=0.8,s[18,58]=-1.2,s[18,59]=-1.1,s[18,60]=0.0 s[19,1]=-0.2,s[19,2]=-1.0,s[19,3]=0.9,s[19,4]=0.3,s[19,5]=-0.6,s[19,6]=1.2,s[19,7]=0.1,s[19,8]=-1.2,s[19,9]=0.9,s[19,10]=0.1,s[19,11]=0.6,s[19,12]=-1.1,s[19,13]=-1.0,s[19,14]=0.1,s[19,15]=0.6,s[19,16]=0.6,s[19,17]=-1.1,s[19,18]=-0.5,s[19,19]=1.2,s[19,20]=-0.2,s[19,21]=0.5,s[19,22]=-0.8,s[19,23]=0.5,s[19,24]=-0.7,s[19,25]=-1.1,s[19,26]=0.9,s[19,27]=-0.3,s[19,28]=0.4,s[19,29]=0.0,s[19,30]=-1.0,s[19,31]=1.0,s[19,32]=-1.1,s[19,33]=-0.9,s[19,34]=0.7,s[19,35]=0.8,s[19,36]=-0.4,s[19,37]=-0.5,s[19,38]=0.3,s[19,39]=0.2,s[19,40]=-0.8,s[19,41]=-0.6,s[19,42]=0.4,s[19,43]=0.5,s[19,44]=-0.4,s[19,45]=-0.9,s[19,46]=-0.9,s[19,47]=-0.5,s[19,48]=1.0,s[19,49]=0.9,s[19,50]=-0.8,s[19,51]=-0.6,s[19,52]=-1.2,s[19,53]=-0.2,s[19,54]=-0.6,s[19,55]=-0.6,s[19,56]=-0.1,s[19,57]=-1.2,s[19,58]=1.0,s[19,59]=-1.0,s[19,60]=-0.2 s[20,1]=0.9,s[20,2]=0.5,s[20,3]=-0.6,s[20,4]=0.8,s[20,5]=-0.4,s[20,6]=0.9,s[20,7]=-1.0,s[20,8]=0.0,s[20,9]=-0.1,s[20,10]=0.5,s[20,11]=0.8,s[20,12]=-0.6,s[20,13]=0.8,s[20,14]=-0.8,s[20,15]=0.2,s[20,16]=-0.2,s[20,17]=-1.0,s[20,18]=0.0,s[20,19]=-1.2,s[20,20]=0.8,s[20,21]=0.8,s[20,22]=1.2,s[20,23]=-0.9,s[20,24]=1.1,s[20,25]=1.0,s[20,26]=-0.4,s[20,27]=0.9,s[20,28]=0.8,s[20,29]=-1.2,s[20,30]=-0.2,s[20,31]=-0.6,s[20,32]=1.2,s[20,33]=-0.5,s[20,34]=-0.3,s[20,35]=-1.0,s[20,36]=-0.1,s[20,37]=-0.7,s[20,38]=-0.1,s[20,39]=0.8,s[20,40]=0.1,s[20,41]=-0.1,s[20,42]=1.0,s[20,43]=1.2,s[20,44]=0.6,s[20,45]=-0.8,s[20,46]=-1.1,s[20,47]=0.2,s[20,48]=-0.1,s[20,49]=-1.2,s[20,50]=-1.2,s[20,51]=-0.8,s[20,52]=-1.2,s[20,53]=-1.1,s[20,54]=1.0,s[20,55]=0.9,s[20,56]=0.3,s[20,57]=-0.6,s[20,58]=-0.4,s[20,59]=-1.1,s[20,60]=-0.9 s[21,1]=-0.1,s[21,2]=-0.6,s[21,3]=-0.7,s[21,4]=0.3,s[21,5]=0.3,s[21,6]=-0.7,s[21,7]=-0.7,s[21,8]=-0.6,s[21,9]=1.2,s[21,10]=-0.1,s[21,11]=0.1,s[21,12]=0.5,s[21,13]=-0.3,s[21,14]=1.2,s[21,15]=1.1,s[21,16]=0.7,s[21,17]=-0.8,s[21,18]=-1.1,s[21,19]=0.0,s[21,20]=-0.6,s[21,21]=-1.2,s[21,22]=-0.8,s[21,23]=0.7,s[21,24]=0.9,s[21,25]=0.5,s[21,26]=-0.9,s[21,27]=-0.6,s[21,28]=0.1,s[21,29]=0.5,s[21,30]=-0.9,s[21,31]=0.0,s[21,32]=0.5,s[21,33]=-1.2,s[21,34]=1.0,s[21,35]=-0.4,s[21,36]=0.1,s[21,37]=1.1,s[21,38]=-0.1,s[21,39]=-0.3,s[21,40]=-0.9,s[21,41]=-0.6,s[21,42]=-0.2,s[21,43]=0.7,s[21,44]=-1.0,s[21,45]=-0.1,s[21,46]=-1.2,s[21,47]=-0.1,s[21,48]=1.2,s[21,49]=-1.0,s[21,50]=-0.7,s[21,51]=-0.1,s[21,52]=-0.7,s[21,53]=1.2,s[21,54]=-1.2,s[21,55]=-0.1,s[21,56]=-1.1,s[21,57]=-0.4,s[21,58]=1.2,s[21,59]=-0.4,s[21,60]=-0.3 s[22,1]=1.2,s[22,2]=0.5,s[22,3]=-0.7,s[22,4]=0.4,s[22,5]=-1.0,s[22,6]=0.7,s[22,7]=-0.3,s[22,8]=1.1,s[22,9]=-0.6,s[22,10]=-0.5,s[22,11]=1.2,s[22,12]=-1.1,s[22,13]=-0.8,s[22,14]=0.3,s[22,15]=0.5,s[22,16]=0.8,s[22,17]=-1.2,s[22,18]=-0.4,s[22,19]=0.1,s[22,20]=-0.4,s[22,21]=-1.2,s[22,22]=0.6,s[22,23]=0.8,s[22,24]=0.9,s[22,25]=0.1,s[22,26]=-0.2,s[22,27]=-0.1,s[22,28]=0.5,s[22,29]=0.5,s[22,30]=0.9,s[22,31]=0.8,s[22,32]=0.0,s[22,33]=0.3,s[22,34]=1.0,s[22,35]=-0.6,s[22,36]=-0.3,s[22,37]=0.0,s[22,38]=0.9,s[22,39]=1.1,s[22,40]=0.8,s[22,41]=0.6,s[22,42]=-0.8,s[22,43]=0.1,s[22,44]=-0.9,s[22,45]=0.9,s[22,46]=0.5,s[22,47]=-1.0,s[22,48]=-0.4,s[22,49]=0.7,s[22,50]=0.6,s[22,51]=0.4,s[22,52]=1.1,s[22,53]=-1.2,s[22,54]=-0.9,s[22,55]=1.2,s[22,56]=-0.8,s[22,57]=0.8,s[22,58]=-1.0,s[22,59]=0.0,s[22,60]=0.9 s[23,1]=-1.1,s[23,2]=-0.5,s[23,3]=-0.9,s[23,4]=0.8,s[23,5]=-0.3,s[23,6]=-0.2,s[23,7]=1.2,s[23,8]=0.2,s[23,9]=-1.0,s[23,10]=0.1,s[23,11]=0.2,s[23,12]=0.8,s[23,13]=-1.0,s[23,14]=-1.1,s[23,15]=0.6,s[23,16]=0.7,s[23,17]=-0.3,s[23,18]=-0.6,s[23,19]=0.8,s[23,20]=0.1,s[23,21]=0.2,s[23,22]=-0.3,s[23,23]=-0.8,s[23,24]=-0.9,s[23,25]=-0.9,s[23,26]=0.9,s[23,27]=-1.1,s[23,28]=1.1,s[23,29]=-0.6,s[23,30]=0.6,s[23,31]=-0.2,s[23,32]=-0.4,s[23,33]=0.6,s[23,34]=-0.5,s[23,35]=-0.4,s[23,36]=-0.4,s[23,37]=-0.3,s[23,38]=0.8,s[23,39]=0.9,s[23,40]=0.9,s[23,41]=-0.1,s[23,42]=-0.7,s[23,43]=0.6,s[23,44]=0.9,s[23,45]=-0.6,s[23,46]=1.1,s[23,47]=-0.5,s[23,48]=0.9,s[23,49]=-1.0,s[23,50]=1.1,s[23,51]=0.8,s[23,52]=1.2,s[23,53]=1.2,s[23,54]=0.0,s[23,55]=-0.7,s[23,56]=-0.9,s[23,57]=-0.2,s[23,58]=-0.7,s[23,59]=-0.6,s[23,60]=-0.3 s[24,1]=1.1,s[24,2]=0.4,s[24,3]=-0.4,s[24,4]=-1.0,s[24,5]=0.3,s[24,6]=0.4,s[24,7]=0.5,s[24,8]=-0.6,s[24,9]=0.9,s[24,10]=-0.5,s[24,11]=-0.8,s[24,12]=-0.7,s[24,13]=0.5,s[24,14]=0.3,s[24,15]=-1.2,s[24,16]=0.8,s[24,17]=-0.4,s[24,18]=-0.9,s[24,19]=-0.4,s[24,20]=-0.9,s[24,21]=1.1,s[24,22]=-0.6,s[24,23]=0.2,s[24,24]=-0.7,s[24,25]=-1.1,s[24,26]=-0.5,s[24,27]=1.1,s[24,28]=-1.1,s[24,29]=0.6,s[24,30]=0.2,s[24,31]=1.2,s[24,32]=-0.5,s[24,33]=1.2,s[24,34]=0.7,s[24,35]=0.9,s[24,36]=1.0,s[24,37]=0.3,s[24,38]=-1.0,s[24,39]=-0.5,s[24,40]=-0.9,s[24,41]=-0.5,s[24,42]=0.4,s[24,43]=-1.1,s[24,44]=0.7,s[24,45]=0.2,s[24,46]=-0.5,s[24,47]=0.5,s[24,48]=-0.8,s[24,49]=0.4,s[24,50]=-0.2,s[24,51]=1.1,s[24,52]=0.9,s[24,53]=1.0,s[24,54]=0.2,s[24,55]=-0.8,s[24,56]=0.9,s[24,57]=0.2,s[24,58]=-1.2,s[24,59]=0.3,s[24,60]=0.6 s[25,1]=-0.2,s[25,2]=0.9,s[25,3]=-0.5,s[25,4]=-0.8,s[25,5]=-0.5,s[25,6]=0.3,s[25,7]=0.2,s[25,8]=0.7,s[25,9]=0.7,s[25,10]=0.2,s[25,11]=-0.3,s[25,12]=-0.4,s[25,13]=-0.9,s[25,14]=-1.2,s[25,15]=0.9,s[25,16]=0.5,s[25,17]=0.5,s[25,18]=0.1,s[25,19]=-0.1,s[25,20]=0.6,s[25,21]=-0.4,s[25,22]=0.0,s[25,23]=0.0,s[25,24]=0.6,s[25,25]=0.0,s[25,26]=-1.1,s[25,27]=-0.7,s[25,28]=-1.2,s[25,29]=0.8,s[25,30]=0.9,s[25,31]=-0.3,s[25,32]=1.0,s[25,33]=1.0,s[25,34]=0.2,s[25,35]=0.1,s[25,36]=0.3,s[25,37]=-0.8,s[25,38]=-0.9,s[25,39]=0.3,s[25,40]=1.1,s[25,41]=-0.1,s[25,42]=0.1,s[25,43]=-0.1,s[25,44]=-0.5,s[25,45]=-0.7,s[25,46]=-1.2,s[25,47]=-0.1,s[25,48]=0.9,s[25,49]=-0.6,s[25,50]=0.5,s[25,51]=-0.9,s[25,52]=1.1,s[25,53]=-0.2,s[25,54]=-0.3,s[25,55]=-0.7,s[25,56]=0.1,s[25,57]=0.2,s[25,58]=1.0,s[25,59]=1.2,s[25,60]=0.9 s[26,1]=-1.2,s[26,2]=0.2,s[26,3]=-0.4,s[26,4]=1.0,s[26,5]=0.8,s[26,6]=0.0,s[26,7]=1.1,s[26,8]=-0.4,s[26,9]=1.1,s[26,10]=0.5,s[26,11]=0.7,s[26,12]=0.3,s[26,13]=0.8,s[26,14]=-0.7,s[26,15]=1.2,s[26,16]=-0.8,s[26,17]=-1.0,s[26,18]=-0.9,s[26,19]=0.6,s[26,20]=-0.9,s[26,21]=-0.6,s[26,22]=-0.7,s[26,23]=-0.4,s[26,24]=0.7,s[26,25]=0.6,s[26,26]=-1.1,s[26,27]=0.4,s[26,28]=0.7,s[26,29]=1.1,s[26,30]=-0.4,s[26,31]=-0.4,s[26,32]=0.8,s[26,33]=-0.6,s[26,34]=-0.7,s[26,35]=-0.2,s[26,36]=-1.1,s[26,37]=0.6,s[26,38]=0.2,s[26,39]=0.3,s[26,40]=-0.9,s[26,41]=0.7,s[26,42]=0.3,s[26,43]=1.0,s[26,44]=-0.6,s[26,45]=0.4,s[26,46]=0.2,s[26,47]=-0.6,s[26,48]=-0.9,s[26,49]=-0.4,s[26,50]=0.4,s[26,51]=0.5,s[26,52]=0.8,s[26,53]=0.1,s[26,54]=-0.1,s[26,55]=0.9,s[26,56]=-1.1,s[26,57]=-0.7,s[26,58]=-0.1,s[26,59]=-0.9,s[26,60]=0.0 s[27,1]=0.7,s[27,2]=-0.8,s[27,3]=0.3,s[27,4]=-0.5,s[27,5]=-0.1,s[27,6]=-0.2,s[27,7]=-0.9,s[27,8]=0.6,s[27,9]=-0.8,s[27,10]=-0.6,s[27,11]=-1.1,s[27,12]=1.0,s[27,13]=-0.4,s[27,14]=-0.6,s[27,15]=0.6,s[27,16]=-1.0,s[27,17]=0.1,s[27,18]=1.2,s[27,19]=0.6,s[27,20]=0.7,s[27,21]=-1.2,s[27,22]=-1.0,s[27,23]=-0.6,s[27,24]=0.9,s[27,25]=0.8,s[27,26]=-0.6,s[27,27]=-1.2,s[27,28]=0.0,s[27,29]=0.0,s[27,30]=0.3,s[27,31]=-0.2,s[27,32]=0.7,s[27,33]=0.0,s[27,34]=0.5,s[27,35]=0.5,s[27,36]=1.2,s[27,37]=-0.3,s[27,38]=-1.1,s[27,39]=-0.7,s[27,40]=0.2,s[27,41]=-0.5,s[27,42]=0.0,s[27,43]=-0.7,s[27,44]=-0.7,s[27,45]=1.1,s[27,46]=0.5,s[27,47]=0.6,s[27,48]=-1.0,s[27,49]=1.1,s[27,50]=-0.4,s[27,51]=0.2,s[27,52]=-0.7,s[27,53]=1.1,s[27,54]=-0.3,s[27,55]=-0.7,s[27,56]=-0.4,s[27,57]=0.7,s[27,58]=-0.8,s[27,59]=-1.2,s[27,60]=-0.9 s[28,1]=0.5,s[28,2]=-0.8,s[28,3]=-0.1,s[28,4]=-0.3,s[28,5]=0.1,s[28,6]=0.6,s[28,7]=0.2,s[28,8]=0.7,s[28,9]=-1.0,s[28,10]=0.8,s[28,11]=-1.1,s[28,12]=-1.0,s[28,13]=0.9,s[28,14]=0.1,s[28,15]=1.2,s[28,16]=-1.2,s[28,17]=1.2,s[28,18]=-0.9,s[28,19]=-1.0,s[28,20]=0.5,s[28,21]=-1.2,s[28,22]=-0.4,s[28,23]=-0.9,s[28,24]=0.4,s[28,25]=-0.5,s[28,26]=-1.1,s[28,27]=0.4,s[28,28]=0.9,s[28,29]=-1.0,s[28,30]=0.1,s[28,31]=0.3,s[28,32]=-0.4,s[28,33]=0.1,s[28,34]=0.2,s[28,35]=-1.1,s[28,36]=-0.1,s[28,37]=-0.9,s[28,38]=-0.4,s[28,39]=-1.0,s[28,40]=-0.9,s[28,41]=-0.3,s[28,42]=0.5,s[28,43]=0.4,s[28,44]=-1.0,s[28,45]=-0.8,s[28,46]=0.0,s[28,47]=0.9,s[28,48]=-0.2,s[28,49]=0.8,s[28,50]=0.0,s[28,51]=0.4,s[28,52]=0.3,s[28,53]=-0.6,s[28,54]=-0.7,s[28,55]=-0.7,s[28,56]=0.3,s[28,57]=0.7,s[28,58]=-0.1,s[28,59]=-0.8,s[28,60]=1.0 s[29,1]=1.1,s[29,2]=0.0,s[29,3]=-0.8,s[29,4]=0.7,s[29,5]=0.8,s[29,6]=1.2,s[29,7]=0.8,s[29,8]=0.8,s[29,9]=-0.7,s[29,10]=0.9,s[29,11]=0.3,s[29,12]=0.9,s[29,13]=1.0,s[29,14]=0.7,s[29,15]=-0.3,s[29,16]=-0.7,s[29,17]=0.7,s[29,18]=-0.9,s[29,19]=0.0,s[29,20]=-1.1,s[29,21]=0.0,s[29,22]=0.0,s[29,23]=0.8,s[29,24]=-1.2,s[29,25]=0.0,s[29,26]=-0.8,s[29,27]=0.3,s[29,28]=1.1,s[29,29]=-0.7,s[29,30]=0.8,s[29,31]=0.3,s[29,32]=-0.9,s[29,33]=-0.6,s[29,34]=-0.7,s[29,35]=0.7,s[29,36]=-0.9,s[29,37]=-0.9,s[29,38]=0.3,s[29,39]=1.0,s[29,40]=-1.0,s[29,41]=1.2,s[29,42]=0.1,s[29,43]=0.3,s[29,44]=0.3,s[29,45]=-0.4,s[29,46]=1.0,s[29,47]=-0.2,s[29,48]=-1.1,s[29,49]=0.1,s[29,50]=0.4,s[29,51]=-0.8,s[29,52]=-0.1,s[29,53]=-0.9,s[29,54]=-0.7,s[29,55]=0.1,s[29,56]=-0.3,s[29,57]=-0.9,s[29,58]=-0.9,s[29,59]=-0.6,s[29,60]=-0.4 s[30,1]=0.8,s[30,2]=0.6,s[30,3]=-0.2,s[30,4]=-1.2,s[30,5]=-0.7,s[30,6]=0.9,s[30,7]=0.6,s[30,8]=-1.2,s[30,9]=-0.1,s[30,10]=0.3,s[30,11]=-0.8,s[30,12]=0.0,s[30,13]=1.0,s[30,14]=0.8,s[30,15]=-1.0,s[30,16]=-0.3,s[30,17]=0.9,s[30,18]=0.6,s[30,19]=-0.2,s[30,20]=1.1,s[30,21]=-1.2,s[30,22]=0.0,s[30,23]=0.5,s[30,24]=0.5,s[30,25]=0.1,s[30,26]=0.8,s[30,27]=0.0,s[30,28]=0.0,s[30,29]=-0.4,s[30,30]=-0.9,s[30,31]=-1.1,s[30,32]=0.5,s[30,33]=-0.4,s[30,34]=0.6,s[30,35]=-0.2,s[30,36]=0.4,s[30,37]=0.4,s[30,38]=-0.9,s[30,39]=0.8,s[30,40]=-0.8,s[30,41]=-1.1,s[30,42]=1.2,s[30,43]=0.5,s[30,44]=0.2,s[30,45]=-0.7,s[30,46]=-1.0,s[30,47]=1.0,s[30,48]=0.3,s[30,49]=1.0,s[30,50]=1.2,s[30,51]=-0.3,s[30,52]=0.7,s[30,53]=-1.2,s[30,54]=-1.0,s[30,55]=0.9,s[30,56]=-0.2,s[30,57]=-0.9,s[30,58]=0.6,s[30,59]=-1.0,s[30,60]=-0.2 s[31,1]=-0.3,s[31,2]=-0.7,s[31,3]=1.1,s[31,4]=0.1,s[31,5]=0.2,s[31,6]=1.1,s[31,7]=0.6,s[31,8]=-1.1,s[31,9]=0.6,s[31,10]=0.7,s[31,11]=-0.4,s[31,12]=-0.9,s[31,13]=0.2,s[31,14]=-1.2,s[31,15]=-1.0,s[31,16]=0.8,s[31,17]=-0.2,s[31,18]=-1.2,s[31,19]=0.8,s[31,20]=0.9,s[31,21]=-1.1,s[31,22]=-0.5,s[31,23]=1.2,s[31,24]=-1.0,s[31,25]=0.2,s[31,26]=-0.7,s[31,27]=-0.7,s[31,28]=0.4,s[31,29]=0.0,s[31,30]=-0.6,s[31,31]=-0.8,s[31,32]=-0.4,s[31,33]=-0.3,s[31,34]=0.0,s[31,35]=0.4,s[31,36]=-1.1,s[31,37]=0.0,s[31,38]=0.7,s[31,39]=0.5,s[31,40]=0.7,s[31,41]=-0.5,s[31,42]=1.2,s[31,43]=0.3,s[31,44]=0.2,s[31,45]=-1.2,s[31,46]=-0.6,s[31,47]=0.3,s[31,48]=0.7,s[31,49]=0.2,s[31,50]=-0.6,s[31,51]=0.5,s[31,52]=-0.9,s[31,53]=-0.8,s[31,54]=-1.1,s[31,55]=-0.1,s[31,56]=-0.5,s[31,57]=0.7,s[31,58]=0.8,s[31,59]=1.0,s[31,60]=-1.1 s[32,1]=0.6,s[32,2]=0.0,s[32,3]=-1.1,s[32,4]=0.9,s[32,5]=0.7,s[32,6]=-0.7,s[32,7]=-1.2,s[32,8]=0.9,s[32,9]=-0.5,s[32,10]=-0.6,s[32,11]=-0.4,s[32,12]=1.0,s[32,13]=0.8,s[32,14]=0.8,s[32,15]=-1.0,s[32,16]=1.2,s[32,17]=0.2,s[32,18]=0.9,s[32,19]=0.6,s[32,20]=1.2,s[32,21]=-0.9,s[32,22]=0.8,s[32,23]=-0.1,s[32,24]=-0.9,s[32,25]=-0.9,s[32,26]=-1.0,s[32,27]=-1.1,s[32,28]=0.4,s[32,29]=0.2,s[32,30]=0.0,s[32,31]=-0.9,s[32,32]=0.2,s[32,33]=-0.5,s[32,34]=-0.6,s[32,35]=-0.7,s[32,36]=0.1,s[32,37]=-0.3,s[32,38]=0.4,s[32,39]=-0.8,s[32,40]=0.0,s[32,41]=-0.3,s[32,42]=0.1,s[32,43]=-0.2,s[32,44]=-0.5,s[32,45]=0.0,s[32,46]=0.6,s[32,47]=-0.7,s[32,48]=1.2,s[32,49]=1.0,s[32,50]=-0.7,s[32,51]=-0.7,s[32,52]=-1.2,s[32,53]=-0.3,s[32,54]=1.0,s[32,55]=-1.1,s[32,56]=-0.4,s[32,57]=0.5,s[32,58]=1.2,s[32,59]=0.7,s[32,60]=0.5 s[33,1]=-0.8,s[33,2]=-1.0,s[33,3]=0.8,s[33,4]=0.9,s[33,5]=0.1,s[33,6]=-0.1,s[33,7]=0.5,s[33,8]=-0.2,s[33,9]=-0.5,s[33,10]=-1.1,s[33,11]=-0.1,s[33,12]=1.1,s[33,13]=0.7,s[33,14]=-0.9,s[33,15]=-0.5,s[33,16]=-0.6,s[33,17]=0.1,s[33,18]=0.6,s[33,19]=-0.1,s[33,20]=-0.8,s[33,21]=1.0,s[33,22]=-1.2,s[33,23]=-0.1,s[33,24]=-0.1,s[33,25]=0.1,s[33,26]=-0.9,s[33,27]=1.1,s[33,28]=-1.0,s[33,29]=-0.5,s[33,30]=-0.9,s[33,31]=1.1,s[33,32]=-0.1,s[33,33]=-1.0,s[33,34]=0.4,s[33,35]=0.0,s[33,36]=0.0,s[33,37]=-0.5,s[33,38]=-1.2,s[33,39]=0.8,s[33,40]=-1.2,s[33,41]=0.0,s[33,42]=0.0,s[33,43]=0.7,s[33,44]=-0.9,s[33,45]=0.0,s[33,46]=-1.1,s[33,47]=0.3,s[33,48]=0.6,s[33,49]=-0.2,s[33,50]=-0.7,s[33,51]=0.3,s[33,52]=-0.2,s[33,53]=-0.2,s[33,54]=-0.2,s[33,55]=0.4,s[33,56]=0.7,s[33,57]=-1.1,s[33,58]=1.1,s[33,59]=1.0,s[33,60]=0.3 s[34,1]=-0.7,s[34,2]=-0.8,s[34,3]=-0.4,s[34,4]=-0.1,s[34,5]=1.2,s[34,6]=-0.4,s[34,7]=0.5,s[34,8]=0.1,s[34,9]=0.5,s[34,10]=0.3,s[34,11]=-1.0,s[34,12]=1.0,s[34,13]=0.5,s[34,14]=0.6,s[34,15]=0.9,s[34,16]=-0.6,s[34,17]=1.1,s[34,18]=0.1,s[34,19]=0.0,s[34,20]=-0.6,s[34,21]=-0.8,s[34,22]=-0.1,s[34,23]=0.1,s[34,24]=-0.1,s[34,25]=0.1,s[34,26]=-1.2,s[34,27]=-1.2,s[34,28]=-0.4,s[34,29]=0.6,s[34,30]=0.7,s[34,31]=-0.8,s[34,32]=-0.6,s[34,33]=0.6,s[34,34]=-0.1,s[34,35]=-1.2,s[34,36]=-1.2,s[34,37]=0.8,s[34,38]=0.7,s[34,39]=1.0,s[34,40]=0.8,s[34,41]=0.0,s[34,42]=0.0,s[34,43]=0.5,s[34,44]=0.4,s[34,45]=-0.5,s[34,46]=-0.8,s[34,47]=0.2,s[34,48]=0.6,s[34,49]=-0.7,s[34,50]=0.8,s[34,51]=-0.9,s[34,52]=-1.1,s[34,53]=1.0,s[34,54]=0.3,s[34,55]=-0.8,s[34,56]=1.1,s[34,57]=0.5,s[34,58]=0.0,s[34,59]=-0.4,s[34,60]=-0.2 s[35,1]=-0.9,s[35,2]=-1.0,s[35,3]=0.9,s[35,4]=0.1,s[35,5]=-0.1,s[35,6]=0.3,s[35,7]=-0.9,s[35,8]=-1.1,s[35,9]=0.5,s[35,10]=0.7,s[35,11]=-0.9,s[35,12]=-0.5,s[35,13]=-0.4,s[35,14]=0.1,s[35,15]=-0.9,s[35,16]=0.0,s[35,17]=-0.1,s[35,18]=0.2,s[35,19]=-0.1,s[35,20]=-0.1,s[35,21]=1.2,s[35,22]=1.0,s[35,23]=0.1,s[35,24]=0.9,s[35,25]=-0.3,s[35,26]=-0.5,s[35,27]=1.2,s[35,28]=0.5,s[35,29]=-0.8,s[35,30]=0.2,s[35,31]=-0.2,s[35,32]=0.7,s[35,33]=-0.6,s[35,34]=-0.4,s[35,35]=1.1,s[35,36]=-0.8,s[35,37]=0.6,s[35,38]=-0.2,s[35,39]=0.1,s[35,40]=0.8,s[35,41]=-0.5,s[35,42]=-0.7,s[35,43]=0.5,s[35,44]=-0.3,s[35,45]=0.9,s[35,46]=-0.3,s[35,47]=0.1,s[35,48]=-0.6,s[35,49]=-0.9,s[35,50]=0.9,s[35,51]=1.2,s[35,52]=1.2,s[35,53]=-0.1,s[35,54]=-1.2,s[35,55]=-0.9,s[35,56]=-1.2,s[35,57]=-0.2,s[35,58]=-0.7,s[35,59]=1.1,s[35,60]=-1.0 s[36,1]=-0.6,s[36,2]=0.2,s[36,3]=0.8,s[36,4]=0.3,s[36,5]=-0.7,s[36,6]=0.5,s[36,7]=0.2,s[36,8]=-1.0,s[36,9]=-0.4,s[36,10]=-0.6,s[36,11]=-0.2,s[36,12]=0.6,s[36,13]=1.1,s[36,14]=-0.9,s[36,15]=0.2,s[36,16]=0.1,s[36,17]=0.0,s[36,18]=-0.6,s[36,19]=0.4,s[36,20]=-0.2,s[36,21]=-0.7,s[36,22]=-0.7,s[36,23]=0.6,s[36,24]=0.0,s[36,25]=-0.2,s[36,26]=1.2,s[36,27]=-0.8,s[36,28]=-0.8,s[36,29]=-0.6,s[36,30]=0.4,s[36,31]=0.7,s[36,32]=-0.9,s[36,33]=1.1,s[36,34]=0.4,s[36,35]=0.3,s[36,36]=-0.1,s[36,37]=-0.9,s[36,38]=-0.5,s[36,39]=1.1,s[36,40]=0.1,s[36,41]=0.8,s[36,42]=0.4,s[36,43]=0.2,s[36,44]=1.0,s[36,45]=-0.7,s[36,46]=0.7,s[36,47]=0.6,s[36,48]=1.0,s[36,49]=0.9,s[36,50]=0.2,s[36,51]=0.0,s[36,52]=-0.2,s[36,53]=-1.0,s[36,54]=-1.0,s[36,55]=-0.7,s[36,56]=-0.3,s[36,57]=-0.6,s[36,58]=-1.2,s[36,59]=0.8,s[36,60]=1.0 s[37,1]=-1.2,s[37,2]=-0.7,s[37,3]=0.2,s[37,4]=-1.2,s[37,5]=0.7,s[37,6]=0.7,s[37,7]=0.1,s[37,8]=-0.4,s[37,9]=0.1,s[37,10]=0.6,s[37,11]=0.2,s[37,12]=0.9,s[37,13]=0.8,s[37,14]=-1.2,s[37,15]=1.1,s[37,16]=0.2,s[37,17]=-0.2,s[37,18]=-1.1,s[37,19]=-1.2,s[37,20]=-0.1,s[37,21]=0.4,s[37,22]=0.7,s[37,23]=-0.2,s[37,24]=-0.3,s[37,25]=0.1,s[37,26]=1.2,s[37,27]=0.5,s[37,28]=-0.1,s[37,29]=0.1,s[37,30]=0.7,s[37,31]=1.2,s[37,32]=-1.1,s[37,33]=0.5,s[37,34]=-1.0,s[37,35]=0.5,s[37,36]=0.0,s[37,37]=-0.8,s[37,38]=0.2,s[37,39]=0.1,s[37,40]=0.1,s[37,41]=-1.0,s[37,42]=-1.0,s[37,43]=-1.0,s[37,44]=0.6,s[37,45]=1.1,s[37,46]=-0.8,s[37,47]=1.2,s[37,48]=0.8,s[37,49]=0.0,s[37,50]=0.8,s[37,51]=-1.0,s[37,52]=-0.3,s[37,53]=-0.4,s[37,54]=0.7,s[37,55]=0.0,s[37,56]=-0.7,s[37,57]=0.3,s[37,58]=0.1,s[37,59]=-0.8,s[37,60]=0.2 s[38,1]=-0.8,s[38,2]=1.0,s[38,3]=-0.2,s[38,4]=0.9,s[38,5]=-0.9,s[38,6]=1.0,s[38,7]=-0.2,s[38,8]=0.9,s[38,9]=-0.3,s[38,10]=-1.1,s[38,11]=0.7,s[38,12]=-0.8,s[38,13]=0.9,s[38,14]=0.8,s[38,15]=-0.8,s[38,16]=-0.4,s[38,17]=0.6,s[38,18]=-0.1,s[38,19]=-0.1,s[38,20]=0.4,s[38,21]=0.7,s[38,22]=-1.2,s[38,23]=-0.7,s[38,24]=0.0,s[38,25]=-0.9,s[38,26]=-0.9,s[38,27]=-0.9,s[38,28]=0.8,s[38,29]=1.0,s[38,30]=1.2,s[38,31]=0.7,s[38,32]=-1.2,s[38,33]=0.8,s[38,34]=-0.7,s[38,35]=-0.6,s[38,36]=-0.2,s[38,37]=0.0,s[38,38]=-0.9,s[38,39]=1.1,s[38,40]=0.2,s[38,41]=-0.7,s[38,42]=-0.9,s[38,43]=1.2,s[38,44]=-1.2,s[38,45]=-0.5,s[38,46]=0.6,s[38,47]=0.1,s[38,48]=1.0,s[38,49]=-0.2,s[38,50]=0.3,s[38,51]=0.7,s[38,52]=-0.7,s[38,53]=0.6,s[38,54]=-0.5,s[38,55]=1.1,s[38,56]=0.7,s[38,57]=-1.0,s[38,58]=1.2,s[38,59]=-1.2,s[38,60]=-0.6 s[39,1]=-0.3,s[39,2]=-0.9,s[39,3]=-0.8,s[39,4]=1.2,s[39,5]=-0.6,s[39,6]=-0.6,s[39,7]=0.4,s[39,8]=0.3,s[39,9]=-0.5,s[39,10]=-0.7,s[39,11]=0.2,s[39,12]=-1.1,s[39,13]=1.2,s[39,14]=0.3,s[39,15]=-1.0,s[39,16]=-0.9,s[39,17]=0.8,s[39,18]=-1.2,s[39,19]=-1.0,s[39,20]=-0.8,s[39,21]=0.9,s[39,22]=-0.2,s[39,23]=0.3,s[39,24]=0.4,s[39,25]=0.4,s[39,26]=-0.7,s[39,27]=-1.2,s[39,28]=1.2,s[39,29]=-0.1,s[39,30]=0.4,s[39,31]=0.3,s[39,32]=0.4,s[39,33]=0.2,s[39,34]=-0.4,s[39,35]=-0.9,s[39,36]=-0.7,s[39,37]=-1.0,s[39,38]=-0.4,s[39,39]=0.0,s[39,40]=1.1,s[39,41]=1.2,s[39,42]=0.3,s[39,43]=-0.6,s[39,44]=-0.6,s[39,45]=0.0,s[39,46]=-1.2,s[39,47]=-0.7,s[39,48]=0.2,s[39,49]=0.4,s[39,50]=-0.9,s[39,51]=-0.3,s[39,52]=0.9,s[39,53]=0.2,s[39,54]=0.1,s[39,55]=1.0,s[39,56]=-0.7,s[39,57]=-0.2,s[39,58]=-0.4,s[39,59]=0.8,s[39,60]=0.0 s[40,1]=1.0,s[40,2]=0.9,s[40,3]=-1.2,s[40,4]=0.8,s[40,5]=-0.2,s[40,6]=-0.2,s[40,7]=-0.9,s[40,8]=-0.9,s[40,9]=-0.3,s[40,10]=-0.9,s[40,11]=-1.0,s[40,12]=1.0,s[40,13]=0.3,s[40,14]=0.6,s[40,15]=0.4,s[40,16]=-0.7,s[40,17]=-0.3,s[40,18]=-0.9,s[40,19]=1.2,s[40,20]=1.0,s[40,21]=0.2,s[40,22]=0.0,s[40,23]=1.0,s[40,24]=-0.7,s[40,25]=-0.8,s[40,26]=-1.2,s[40,27]=-0.2,s[40,28]=0.8,s[40,29]=-0.9,s[40,30]=0.8,s[40,31]=0.3,s[40,32]=0.0,s[40,33]=0.2,s[40,34]=-0.1,s[40,35]=-1.1,s[40,36]=0.6,s[40,37]=-1.0,s[40,38]=-0.3,s[40,39]=1.2,s[40,40]=-1.2,s[40,41]=-1.0,s[40,42]=0.9,s[40,43]=0.0,s[40,44]=1.2,s[40,45]=0.9,s[40,46]=-0.3,s[40,47]=0.5,s[40,48]=-1.0,s[40,49]=-0.5,s[40,50]=-1.0,s[40,51]=1.0,s[40,52]=0.8,s[40,53]=1.0,s[40,54]=-0.7,s[40,55]=-0.5,s[40,56]=0.0,s[40,57]=-1.1,s[40,58]=0.8,s[40,59]=-1.0,s[40,60]=0.8 s[41,1]=0.1,s[41,2]=0.5,s[41,3]=-0.3,s[41,4]=-1.1,s[41,5]=-1.2,s[41,6]=0.7,s[41,7]=-1.2,s[41,8]=0.6,s[41,9]=-1.1,s[41,10]=0.3,s[41,11]=0.2,s[41,12]=-1.0,s[41,13]=-1.2,s[41,14]=-0.7,s[41,15]=0.9,s[41,16]=0.9,s[41,17]=0.4,s[41,18]=0.2,s[41,19]=-0.8,s[41,20]=0.1,s[41,21]=1.1,s[41,22]=0.6,s[41,23]=-0.4,s[41,24]=-0.4,s[41,25]=1.0,s[41,26]=0.5,s[41,27]=-0.8,s[41,28]=0.7,s[41,29]=-0.7,s[41,30]=1.1,s[41,31]=-0.8,s[41,32]=0.7,s[41,33]=-0.2,s[41,34]=-0.1,s[41,35]=-0.8,s[41,36]=-0.6,s[41,37]=0.3,s[41,38]=-0.2,s[41,39]=-0.7,s[41,40]=-1.1,s[41,41]=-1.2,s[41,42]=0.1,s[41,43]=-0.3,s[41,44]=0.7,s[41,45]=0.9,s[41,46]=-0.3,s[41,47]=-0.6,s[41,48]=0.1,s[41,49]=-0.2,s[41,50]=-1.2,s[41,51]=-1.2,s[41,52]=0.7,s[41,53]=-1.1,s[41,54]=1.0,s[41,55]=0.2,s[41,56]=-0.9,s[41,57]=0.8,s[41,58]=-0.3,s[41,59]=-0.4,s[41,60]=0.0 s[42,1]=-1.2,s[42,2]=0.5,s[42,3]=-0.6,s[42,4]=0.3,s[42,5]=0.1,s[42,6]=-1.1,s[42,7]=0.6,s[42,8]=-0.3,s[42,9]=0.7,s[42,10]=-0.6,s[42,11]=1.1,s[42,12]=-0.4,s[42,13]=0.2,s[42,14]=0.1,s[42,15]=0.3,s[42,16]=1.0,s[42,17]=0.0,s[42,18]=-1.0,s[42,19]=1.2,s[42,20]=-0.6,s[42,21]=-0.3,s[42,22]=-1.1,s[42,23]=-0.1,s[42,24]=0.2,s[42,25]=0.1,s[42,26]=-0.2,s[42,27]=0.9,s[42,28]=-0.7,s[42,29]=0.6,s[42,30]=-1.1,s[42,31]=-1.2,s[42,32]=0.6,s[42,33]=0.2,s[42,34]=0.2,s[42,35]=0.5,s[42,36]=0.1,s[42,37]=-0.3,s[42,38]=-0.1,s[42,39]=-0.8,s[42,40]=0.0,s[42,41]=-1.2,s[42,42]=0.5,s[42,43]=-0.6,s[42,44]=0.2,s[42,45]=-0.9,s[42,46]=-0.7,s[42,47]=-0.5,s[42,48]=0.5,s[42,49]=1.2,s[42,50]=-0.7,s[42,51]=1.0,s[42,52]=-0.4,s[42,53]=-0.9,s[42,54]=0.7,s[42,55]=0.0,s[42,56]=1.2,s[42,57]=1.2,s[42,58]=1.2,s[42,59]=-0.7,s[42,60]=0.6 s[43,1]=0.7,s[43,2]=0.1,s[43,3]=0.3,s[43,4]=1.1,s[43,5]=-0.3,s[43,6]=0.9,s[43,7]=0.9,s[43,8]=0.5,s[43,9]=-0.2,s[43,10]=0.1,s[43,11]=-1.2,s[43,12]=1.0,s[43,13]=-0.3,s[43,14]=-0.3,s[43,15]=-0.8,s[43,16]=-1.0,s[43,17]=0.4,s[43,18]=0.2,s[43,19]=-0.5,s[43,20]=-0.1,s[43,21]=1.0,s[43,22]=0.9,s[43,23]=0.6,s[43,24]=-1.1,s[43,25]=0.5,s[43,26]=0.5,s[43,27]=0.1,s[43,28]=0.7,s[43,29]=0.5,s[43,30]=-1.2,s[43,31]=0.8,s[43,32]=0.6,s[43,33]=-0.2,s[43,34]=-1.2,s[43,35]=0.3,s[43,36]=-0.9,s[43,37]=1.1,s[43,38]=0.2,s[43,39]=0.4,s[43,40]=-0.2,s[43,41]=-0.4,s[43,42]=-0.7,s[43,43]=0.5,s[43,44]=-0.7,s[43,45]=-0.1,s[43,46]=1.2,s[43,47]=-0.7,s[43,48]=-1.2,s[43,49]=-0.2,s[43,50]=-1.0,s[43,51]=0.5,s[43,52]=0.5,s[43,53]=1.1,s[43,54]=-0.4,s[43,55]=1.0,s[43,56]=0.4,s[43,57]=-1.2,s[43,58]=-0.7,s[43,59]=0.8,s[43,60]=-0.8 s[44,1]=0.8,s[44,2]=0.8,s[44,3]=-0.6,s[44,4]=-0.8,s[44,5]=0.0,s[44,6]=0.0,s[44,7]=-0.6,s[44,8]=0.4,s[44,9]=0.7,s[44,10]=-0.6,s[44,11]=1.1,s[44,12]=0.3,s[44,13]=0.6,s[44,14]=0.4,s[44,15]=-1.0,s[44,16]=0.6,s[44,17]=-0.6,s[44,18]=-0.4,s[44,19]=-0.7,s[44,20]=0.5,s[44,21]=-0.4,s[44,22]=-1.1,s[44,23]=0.5,s[44,24]=-0.4,s[44,25]=-0.5,s[44,26]=0.7,s[44,27]=-0.2,s[44,28]=0.2,s[44,29]=0.4,s[44,30]=-0.9,s[44,31]=0.5,s[44,32]=-1.2,s[44,33]=-0.1,s[44,34]=-0.6,s[44,35]=1.0,s[44,36]=-0.2,s[44,37]=-1.0,s[44,38]=0.6,s[44,39]=0.2,s[44,40]=1.1,s[44,41]=0.6,s[44,42]=-1.1,s[44,43]=-0.7,s[44,44]=0.4,s[44,45]=0.7,s[44,46]=-0.4,s[44,47]=0.3,s[44,48]=-1.2,s[44,49]=-0.6,s[44,50]=-0.1,s[44,51]=0.7,s[44,52]=-0.4,s[44,53]=0.1,s[44,54]=0.9,s[44,55]=1.1,s[44,56]=0.3,s[44,57]=1.0,s[44,58]=0.0,s[44,59]=0.2,s[44,60]=0.2 s[45,1]=-0.5,s[45,2]=0.2,s[45,3]=1.0,s[45,4]=-0.6,s[45,5]=1.0,s[45,6]=1.2,s[45,7]=0.7,s[45,8]=-0.1,s[45,9]=-0.7,s[45,10]=-0.6,s[45,11]=-0.1,s[45,12]=-0.8,s[45,13]=-0.9,s[45,14]=1.1,s[45,15]=-1.1,s[45,16]=-0.1,s[45,17]=0.0,s[45,18]=0.3,s[45,19]=0.9,s[45,20]=1.2,s[45,21]=-0.5,s[45,22]=-0.7,s[45,23]=-0.9,s[45,24]=-0.6,s[45,25]=0.2,s[45,26]=1.2,s[45,27]=0.7,s[45,28]=0.9,s[45,29]=-0.1,s[45,30]=-0.1,s[45,31]=1.2,s[45,32]=0.3,s[45,33]=-0.3,s[45,34]=-0.5,s[45,35]=-0.1,s[45,36]=0.0,s[45,37]=-0.7,s[45,38]=0.0,s[45,39]=-0.1,s[45,40]=-1.2,s[45,41]=-1.0,s[45,42]=0.1,s[45,43]=-0.3,s[45,44]=1.1,s[45,45]=-1.2,s[45,46]=0.4,s[45,47]=0.9,s[45,48]=-1.1,s[45,49]=0.6,s[45,50]=-0.6,s[45,51]=0.5,s[45,52]=0.0,s[45,53]=1.1,s[45,54]=-0.9,s[45,55]=0.1,s[45,56]=0.6,s[45,57]=-1.1,s[45,58]=0.4,s[45,59]=0.2,s[45,60]=0.8 s[46,1]=-0.7,s[46,2]=0.0,s[46,3]=0.6,s[46,4]=0.3,s[46,5]=-0.3,s[46,6]=-1.0,s[46,7]=1.2,s[46,8]=-0.9,s[46,9]=-0.9,s[46,10]=-0.5,s[46,11]=-0.4,s[46,12]=-0.1,s[46,13]=-0.9,s[46,14]=-0.7,s[46,15]=-0.9,s[46,16]=0.9,s[46,17]=0.4,s[46,18]=-0.1,s[46,19]=1.1,s[46,20]=1.1,s[46,21]=-0.3,s[46,22]=0.0,s[46,23]=-0.3,s[46,24]=-0.6,s[46,25]=0.0,s[46,26]=-0.2,s[46,27]=-0.5,s[46,28]=0.4,s[46,29]=0.6,s[46,30]=-1.1,s[46,31]=-0.3,s[46,32]=-0.8,s[46,33]=0.4,s[46,34]=0.5,s[46,35]=0.1,s[46,36]=1.1,s[46,37]=1.2,s[46,38]=-0.9,s[46,39]=0.2,s[46,40]=1.2,s[46,41]=-1.2,s[46,42]=0.5,s[46,43]=1.0,s[46,44]=-0.7,s[46,45]=-1.2,s[46,46]=0.9,s[46,47]=1.2,s[46,48]=0.7,s[46,49]=0.0,s[46,50]=-0.6,s[46,51]=0.6,s[46,52]=-0.7,s[46,53]=1.1,s[46,54]=0.2,s[46,55]=-0.3,s[46,56]=-1.2,s[46,57]=-1.1,s[46,58]=0.9,s[46,59]=0.7,s[46,60]=0.7 s[47,1]=-0.3,s[47,2]=-0.7,s[47,3]=-0.7,s[47,4]=0.5,s[47,5]=-1.1,s[47,6]=-0.5,s[47,7]=0.0,s[47,8]=1.0,s[47,9]=0.6,s[47,10]=1.1,s[47,11]=0.5,s[47,12]=0.0,s[47,13]=-0.7,s[47,14]=-0.3,s[47,15]=1.0,s[47,16]=-1.1,s[47,17]=0.3,s[47,18]=-0.2,s[47,19]=1.1,s[47,20]=-1.0,s[47,21]=1.2,s[47,22]=-0.5,s[47,23]=-0.7,s[47,24]=-1.0,s[47,25]=-0.4,s[47,26]=1.2,s[47,27]=1.1,s[47,28]=0.6,s[47,29]=-0.1,s[47,30]=1.1,s[47,31]=0.5,s[47,32]=-1.1,s[47,33]=-0.4,s[47,34]=1.2,s[47,35]=-0.9,s[47,36]=0.7,s[47,37]=0.1,s[47,38]=0.9,s[47,39]=-0.7,s[47,40]=-0.4,s[47,41]=-1.1,s[47,42]=0.7,s[47,43]=-0.1,s[47,44]=-0.8,s[47,45]=-0.1,s[47,46]=0.0,s[47,47]=-0.2,s[47,48]=-0.2,s[47,49]=0.1,s[47,50]=-0.2,s[47,51]=0.3,s[47,52]=0.6,s[47,53]=-0.8,s[47,54]=-0.1,s[47,55]=0.4,s[47,56]=1.0,s[47,57]=-0.7,s[47,58]=0.5,s[47,59]=-0.9,s[47,60]=0.7 s[48,1]=0.1,s[48,2]=-0.6,s[48,3]=1.2,s[48,4]=-0.8,s[48,5]=0.2,s[48,6]=-0.8,s[48,7]=-1.0,s[48,8]=0.8,s[48,9]=0.4,s[48,10]=-0.2,s[48,11]=1.0,s[48,12]=-0.4,s[48,13]=0.3,s[48,14]=-0.1,s[48,15]=0.0,s[48,16]=-0.3,s[48,17]=0.5,s[48,18]=-0.9,s[48,19]=0.7,s[48,20]=0.8,s[48,21]=0.5,s[48,22]=0.3,s[48,23]=0.3,s[48,24]=0.4,s[48,25]=0.2,s[48,26]=-0.1,s[48,27]=1.2,s[48,28]=-0.5,s[48,29]=-0.2,s[48,30]=-0.9,s[48,31]=-1.1,s[48,32]=-1.1,s[48,33]=0.8,s[48,34]=-1.1,s[48,35]=1.1,s[48,36]=-0.2,s[48,37]=-0.7,s[48,38]=-0.4,s[48,39]=-0.7,s[48,40]=0.0,s[48,41]=-1.1,s[48,42]=0.4,s[48,43]=-0.8,s[48,44]=-0.6,s[48,45]=-0.8,s[48,46]=-1.1,s[48,47]=-0.7,s[48,48]=-1.1,s[48,49]=0.9,s[48,50]=-0.6,s[48,51]=0.3,s[48,52]=0.8,s[48,53]=-0.5,s[48,54]=-1.0,s[48,55]=0.3,s[48,56]=-0.1,s[48,57]=0.7,s[48,58]=-0.1,s[48,59]=0.1,s[48,60]=0.4 s[49,1]=-1.0,s[49,2]=0.2,s[49,3]=0.4,s[49,4]=-0.6,s[49,5]=0.2,s[49,6]=-0.7,s[49,7]=-0.8,s[49,8]=0.4,s[49,9]=0.9,s[49,10]=0.5,s[49,11]=0.4,s[49,12]=0.6,s[49,13]=0.1,s[49,14]=-0.6,s[49,15]=-0.8,s[49,16]=-0.6,s[49,17]=0.1,s[49,18]=0.2,s[49,19]=-0.8,s[49,20]=-1.1,s[49,21]=0.4,s[49,22]=0.1,s[49,23]=-0.6,s[49,24]=-0.8,s[49,25]=-1.2,s[49,26]=0.7,s[49,27]=0.4,s[49,28]=0.3,s[49,29]=0.7,s[49,30]=0.7,s[49,31]=0.5,s[49,32]=0.7,s[49,33]=0.0,s[49,34]=1.2,s[49,35]=0.8,s[49,36]=0.8,s[49,37]=-0.9,s[49,38]=-1.0,s[49,39]=0.8,s[49,40]=-0.7,s[49,41]=0.0,s[49,42]=-1.2,s[49,43]=-1.2,s[49,44]=0.2,s[49,45]=0.7,s[49,46]=-0.2,s[49,47]=-1.1,s[49,48]=0.5,s[49,49]=0.9,s[49,50]=-1.1,s[49,51]=-1.1,s[49,52]=-1.2,s[49,53]=-0.7,s[49,54]=1.0,s[49,55]=-0.3,s[49,56]=-0.2,s[49,57]=1.2,s[49,58]=0.1,s[49,59]=-0.3,s[49,60]=-1.2 s[50,1]=-1.0,s[50,2]=-0.1,s[50,3]=0.8,s[50,4]=-0.1,s[50,5]=0.2,s[50,6]=1.0,s[50,7]=1.0,s[50,8]=0.1,s[50,9]=0.4,s[50,10]=0.6,s[50,11]=0.2,s[50,12]=0.5,s[50,13]=-1.1,s[50,14]=0.9,s[50,15]=0.9,s[50,16]=-1.0,s[50,17]=0.3,s[50,18]=-0.4,s[50,19]=0.9,s[50,20]=1.0,s[50,21]=0.3,s[50,22]=0.5,s[50,23]=0.6,s[50,24]=-0.5,s[50,25]=1.1,s[50,26]=0.9,s[50,27]=-0.2,s[50,28]=-0.3,s[50,29]=0.3,s[50,30]=-1.1,s[50,31]=1.1,s[50,32]=-0.4,s[50,33]=0.9,s[50,34]=-0.2,s[50,35]=1.1,s[50,36]=0.9,s[50,37]=-0.9,s[50,38]=0.5,s[50,39]=0.6,s[50,40]=1.0,s[50,41]=-0.3,s[50,42]=-0.7,s[50,43]=-0.2,s[50,44]=-0.1,s[50,45]=0.3,s[50,46]=0.7,s[50,47]=0.4,s[50,48]=-0.5,s[50,49]=0.0,s[50,50]=1.2,s[50,51]=-0.5,s[50,52]=-1.1,s[50,53]=-1.2,s[50,54]=-0.5,s[50,55]=1.0,s[50,56]=0.1,s[50,57]=0.9,s[50,58]=0.5,s[50,59]=0.4,s[50,60]=-0.7 s[51,1]=-1.1,s[51,2]=0.9,s[51,3]=0.9,s[51,4]=0.6,s[51,5]=-1.2,s[51,6]=-1.1,s[51,7]=0.1,s[51,8]=1.2,s[51,9]=-0.1,s[51,10]=0.9,s[51,11]=-0.4,s[51,12]=-0.2,s[51,13]=0.1,s[51,14]=-0.6,s[51,15]=-0.2,s[51,16]=-0.5,s[51,17]=1.2,s[51,18]=0.0,s[51,19]=0.9,s[51,20]=0.8,s[51,21]=0.7,s[51,22]=0.8,s[51,23]=0.3,s[51,24]=0.4,s[51,25]=0.1,s[51,26]=0.6,s[51,27]=0.4,s[51,28]=-0.3,s[51,29]=0.1,s[51,30]=-0.6,s[51,31]=0.9,s[51,32]=0.4,s[51,33]=0.3,s[51,34]=0.3,s[51,35]=-0.5,s[51,36]=-0.1,s[51,37]=0.2,s[51,38]=-0.3,s[51,39]=-1.1,s[51,40]=-0.5,s[51,41]=0.3,s[51,42]=-0.9,s[51,43]=-0.7,s[51,44]=0.8,s[51,45]=-0.7,s[51,46]=0.9,s[51,47]=0.3,s[51,48]=0.9,s[51,49]=-0.9,s[51,50]=0.2,s[51,51]=0.5,s[51,52]=-1.2,s[51,53]=-0.7,s[51,54]=0.3,s[51,55]=0.3,s[51,56]=-0.9,s[51,57]=-1.2,s[51,58]=-0.6,s[51,59]=-0.8,s[51,60]=0.6 s[52,1]=0.2,s[52,2]=-0.9,s[52,3]=0.9,s[52,4]=-1.0,s[52,5]=0.3,s[52,6]=-0.4,s[52,7]=1.0,s[52,8]=1.2,s[52,9]=-0.4,s[52,10]=-0.5,s[52,11]=0.0,s[52,12]=-0.4,s[52,13]=-0.1,s[52,14]=0.4,s[52,15]=1.0,s[52,16]=-0.5,s[52,17]=-0.8,s[52,18]=0.8,s[52,19]=-0.3,s[52,20]=0.9,s[52,21]=0.8,s[52,22]=-0.8,s[52,23]=-0.9,s[52,24]=1.1,s[52,25]=0.3,s[52,26]=-0.2,s[52,27]=0.0,s[52,28]=-0.3,s[52,29]=0.9,s[52,30]=-0.4,s[52,31]=-0.8,s[52,32]=-0.6,s[52,33]=1.1,s[52,34]=-0.3,s[52,35]=-0.7,s[52,36]=1.1,s[52,37]=0.8,s[52,38]=-0.5,s[52,39]=0.3,s[52,40]=1.2,s[52,41]=1.1,s[52,42]=0.8,s[52,43]=0.8,s[52,44]=0.3,s[52,45]=-0.4,s[52,46]=-1.2,s[52,47]=0.1,s[52,48]=-0.8,s[52,49]=-0.1,s[52,50]=0.7,s[52,51]=-0.3,s[52,52]=-0.7,s[52,53]=1.1,s[52,54]=1.1,s[52,55]=1.2,s[52,56]=-0.3,s[52,57]=0.2,s[52,58]=0.1,s[52,59]=0.7,s[52,60]=-0.3 s[53,1]=-0.1,s[53,2]=0.3,s[53,3]=0.0,s[53,4]=0.1,s[53,5]=0.1,s[53,6]=0.5,s[53,7]=1.1,s[53,8]=0.2,s[53,9]=-1.1,s[53,10]=-0.8,s[53,11]=0.0,s[53,12]=0.4,s[53,13]=-1.0,s[53,14]=-0.7,s[53,15]=0.7,s[53,16]=0.3,s[53,17]=-0.1,s[53,18]=-0.3,s[53,19]=0.5,s[53,20]=0.3,s[53,21]=1.1,s[53,22]=1.1,s[53,23]=0.0,s[53,24]=-0.4,s[53,25]=0.5,s[53,26]=1.2,s[53,27]=0.4,s[53,28]=-0.7,s[53,29]=-0.8,s[53,30]=-0.8,s[53,31]=-0.4,s[53,32]=-0.9,s[53,33]=0.2,s[53,34]=-1.2,s[53,35]=0.8,s[53,36]=0.0,s[53,37]=1.1,s[53,38]=0.5,s[53,39]=-0.3,s[53,40]=1.0,s[53,41]=-1.1,s[53,42]=0.5,s[53,43]=0.4,s[53,44]=0.6,s[53,45]=-0.1,s[53,46]=-1.0,s[53,47]=-1.1,s[53,48]=-0.9,s[53,49]=-0.5,s[53,50]=0.8,s[53,51]=-0.5,s[53,52]=1.1,s[53,53]=0.0,s[53,54]=1.1,s[53,55]=0.9,s[53,56]=-1.1,s[53,57]=1.1,s[53,58]=-0.8,s[53,59]=-0.8,s[53,60]=1.0 s[54,1]=-1.1,s[54,2]=0.1,s[54,3]=0.8,s[54,4]=0.5,s[54,5]=-0.4,s[54,6]=1.0,s[54,7]=0.1,s[54,8]=-0.5,s[54,9]=1.1,s[54,10]=1.1,s[54,11]=0.5,s[54,12]=0.2,s[54,13]=-1.1,s[54,14]=-0.9,s[54,15]=-0.2,s[54,16]=0.4,s[54,17]=1.1,s[54,18]=0.5,s[54,19]=0.0,s[54,20]=0.9,s[54,21]=-0.5,s[54,22]=-1.2,s[54,23]=-0.5,s[54,24]=-0.2,s[54,25]=-0.6,s[54,26]=-1.1,s[54,27]=0.5,s[54,28]=0.2,s[54,29]=-0.6,s[54,30]=0.8,s[54,31]=-1.2,s[54,32]=-0.9,s[54,33]=-0.1,s[54,34]=-1.2,s[54,35]=-0.8,s[54,36]=0.0,s[54,37]=1.1,s[54,38]=1.0,s[54,39]=-1.1,s[54,40]=0.3,s[54,41]=0.4,s[54,42]=-1.1,s[54,43]=1.2,s[54,44]=-1.0,s[54,45]=-0.7,s[54,46]=0.6,s[54,47]=0.1,s[54,48]=-0.4,s[54,49]=1.0,s[54,50]=1.2,s[54,51]=0.6,s[54,52]=0.7,s[54,53]=0.7,s[54,54]=0.3,s[54,55]=-0.4,s[54,56]=0.2,s[54,57]=-0.5,s[54,58]=0.9,s[54,59]=-0.4,s[54,60]=-0.1 s[55,1]=0.6,s[55,2]=-0.6,s[55,3]=-0.4,s[55,4]=1.0,s[55,5]=1.2,s[55,6]=0.4,s[55,7]=0.2,s[55,8]=0.9,s[55,9]=-0.1,s[55,10]=0.3,s[55,11]=1.2,s[55,12]=0.6,s[55,13]=0.0,s[55,14]=-1.1,s[55,15]=0.2,s[55,16]=0.8,s[55,17]=0.0,s[55,18]=-1.1,s[55,19]=-0.4,s[55,20]=-1.1,s[55,21]=-0.6,s[55,22]=-0.1,s[55,23]=-0.3,s[55,24]=0.5,s[55,25]=0.7,s[55,26]=1.2,s[55,27]=0.3,s[55,28]=0.3,s[55,29]=0.5,s[55,30]=0.7,s[55,31]=-0.1,s[55,32]=0.0,s[55,33]=-1.1,s[55,34]=0.1,s[55,35]=0.3,s[55,36]=-0.2,s[55,37]=0.7,s[55,38]=0.1,s[55,39]=-0.1,s[55,40]=0.9,s[55,41]=0.1,s[55,42]=0.8,s[55,43]=-0.4,s[55,44]=0.6,s[55,45]=0.0,s[55,46]=1.0,s[55,47]=-0.2,s[55,48]=0.8,s[55,49]=0.7,s[55,50]=0.3,s[55,51]=0.6,s[55,52]=0.1,s[55,53]=-1.2,s[55,54]=-1.0,s[55,55]=-0.8,s[55,56]=0.5,s[55,57]=0.3,s[55,58]=0.4,s[55,59]=-0.4,s[55,60]=-0.8 s[56,1]=-0.1,s[56,2]=0.0,s[56,3]=0.2,s[56,4]=0.9,s[56,5]=-0.5,s[56,6]=-0.4,s[56,7]=0.3,s[56,8]=0.6,s[56,9]=-0.7,s[56,10]=-0.5,s[56,11]=-1.2,s[56,12]=-0.9,s[56,13]=0.5,s[56,14]=0.0,s[56,15]=0.6,s[56,16]=0.5,s[56,17]=0.3,s[56,18]=-0.4,s[56,19]=-0.4,s[56,20]=-1.2,s[56,21]=1.2,s[56,22]=-1.1,s[56,23]=0.2,s[56,24]=0.1,s[56,25]=0.2,s[56,26]=-0.3,s[56,27]=0.6,s[56,28]=-0.2,s[56,29]=0.5,s[56,30]=0.3,s[56,31]=0.6,s[56,32]=0.7,s[56,33]=-0.2,s[56,34]=1.2,s[56,35]=1.2,s[56,36]=-1.1,s[56,37]=-0.1,s[56,38]=-1.2,s[56,39]=-0.9,s[56,40]=1.1,s[56,41]=1.2,s[56,42]=0.7,s[56,43]=-0.9,s[56,44]=0.1,s[56,45]=0.8,s[56,46]=1.2,s[56,47]=0.9,s[56,48]=-0.6,s[56,49]=0.3,s[56,50]=0.5,s[56,51]=0.3,s[56,52]=1.2,s[56,53]=0.9,s[56,54]=0.8,s[56,55]=-0.8,s[56,56]=-0.3,s[56,57]=1.2,s[56,58]=0.3,s[56,59]=-0.9,s[56,60]=-0.8 s[57,1]=0.4,s[57,2]=1.1,s[57,3]=-0.5,s[57,4]=-1.1,s[57,5]=-0.4,s[57,6]=0.7,s[57,7]=0.4,s[57,8]=0.7,s[57,9]=1.1,s[57,10]=-0.4,s[57,11]=-0.9,s[57,12]=-0.7,s[57,13]=-0.2,s[57,14]=-0.4,s[57,15]=-0.5,s[57,16]=0.9,s[57,17]=0.1,s[57,18]=0.9,s[57,19]=-0.3,s[57,20]=-1.0,s[57,21]=0.9,s[57,22]=-1.1,s[57,23]=-0.5,s[57,24]=-0.1,s[57,25]=-0.2,s[57,26]=0.2,s[57,27]=-0.7,s[57,28]=0.0,s[57,29]=-1.1,s[57,30]=-0.3,s[57,31]=0.7,s[57,32]=0.8,s[57,33]=0.4,s[57,34]=1.0,s[57,35]=1.2,s[57,36]=-0.4,s[57,37]=-0.9,s[57,38]=-0.7,s[57,39]=-0.9,s[57,40]=0.4,s[57,41]=-0.8,s[57,42]=1.0,s[57,43]=0.5,s[57,44]=-0.3,s[57,45]=0.4,s[57,46]=0.0,s[57,47]=-0.8,s[57,48]=-1.0,s[57,49]=0.2,s[57,50]=-0.6,s[57,51]=0.4,s[57,52]=0.9,s[57,53]=0.0,s[57,54]=0.1,s[57,55]=-0.9,s[57,56]=0.5,s[57,57]=-0.4,s[57,58]=0.7,s[57,59]=0.1,s[57,60]=1.1 s[58,1]=0.1,s[58,2]=-0.9,s[58,3]=-0.7,s[58,4]=0.8,s[58,5]=1.0,s[58,6]=0.6,s[58,7]=0.0,s[58,8]=1.1,s[58,9]=-1.1,s[58,10]=-0.9,s[58,11]=-0.6,s[58,12]=0.4,s[58,13]=1.0,s[58,14]=-0.5,s[58,15]=-0.6,s[58,16]=0.0,s[58,17]=-0.3,s[58,18]=-0.4,s[58,19]=-0.4,s[58,20]=-0.1,s[58,21]=0.1,s[58,22]=-0.6,s[58,23]=-0.6,s[58,24]=-0.4,s[58,25]=0.1,s[58,26]=0.0,s[58,27]=1.2,s[58,28]=0.3,s[58,29]=0.9,s[58,30]=-1.2,s[58,31]=-0.7,s[58,32]=0.9,s[58,33]=-0.8,s[58,34]=-1.1,s[58,35]=1.1,s[58,36]=-0.3,s[58,37]=-0.5,s[58,38]=0.0,s[58,39]=1.0,s[58,40]=-1.1,s[58,41]=0.2,s[58,42]=-0.5,s[58,43]=0.7,s[58,44]=-0.8,s[58,45]=0.0,s[58,46]=-0.9,s[58,47]=0.7,s[58,48]=-0.3,s[58,49]=-0.9,s[58,50]=-0.6,s[58,51]=-0.5,s[58,52]=-0.4,s[58,53]=0.2,s[58,54]=1.0,s[58,55]=0.2,s[58,56]=1.1,s[58,57]=-1.2,s[58,58]=-0.8,s[58,59]=-0.2,s[58,60]=1.1 s[59,1]=-0.6,s[59,2]=-1.0,s[59,3]=0.8,s[59,4]=-1.1,s[59,5]=-0.5,s[59,6]=-0.2,s[59,7]=-0.5,s[59,8]=-0.7,s[59,9]=0.9,s[59,10]=-0.8,s[59,11]=-0.7,s[59,12]=1.1,s[59,13]=-1.0,s[59,14]=0.5,s[59,15]=0.3,s[59,16]=0.7,s[59,17]=-1.1,s[59,18]=0.9,s[59,19]=0.8,s[59,20]=0.2,s[59,21]=-1.1,s[59,22]=1.0,s[59,23]=0.0,s[59,24]=1.0,s[59,25]=0.2,s[59,26]=1.0,s[59,27]=1.1,s[59,28]=-0.4,s[59,29]=0.8,s[59,30]=0.3,s[59,31]=-0.8,s[59,32]=-0.7,s[59,33]=0.0,s[59,34]=1.1,s[59,35]=-1.1,s[59,36]=0.4,s[59,37]=-0.9,s[59,38]=-0.4,s[59,39]=-1.1,s[59,40]=0.3,s[59,41]=0.0,s[59,42]=0.0,s[59,43]=-0.5,s[59,44]=0.6,s[59,45]=0.9,s[59,46]=-1.1,s[59,47]=-0.6,s[59,48]=0.5,s[59,49]=0.1,s[59,50]=1.2,s[59,51]=-0.2,s[59,52]=-0.9,s[59,53]=-0.5,s[59,54]=-0.3,s[59,55]=-0.3,s[59,56]=-1.1,s[59,57]=-0.5,s[59,58]=-0.9,s[59,59]=1.2,s[59,60]=1.1 s[60,1]=-0.3,s[60,2]=0.3,s[60,3]=0.1,s[60,4]=0.7,s[60,5]=1.2,s[60,6]=-0.4,s[60,7]=0.2,s[60,8]=1.1,s[60,9]=-0.4,s[60,10]=-1.2,s[60,11]=0.0,s[60,12]=1.2,s[60,13]=0.8,s[60,14]=-0.9,s[60,15]=-0.9,s[60,16]=-0.8,s[60,17]=0.2,s[60,18]=-0.8,s[60,19]=0.6,s[60,20]=-0.7,s[60,21]=-1.1,s[60,22]=-0.9,s[60,23]=0.2,s[60,24]=1.1,s[60,25]=0.3,s[60,26]=-1.1,s[60,27]=0.6,s[60,28]=-0.4,s[60,29]=0.1,s[60,30]=0.0,s[60,31]=-0.7,s[60,32]=-0.2,s[60,33]=1.1,s[60,34]=0.9,s[60,35]=-0.2,s[60,36]=-0.6,s[60,37]=0.9,s[60,38]=-0.2,s[60,39]=-0.7,s[60,40]=0.1,s[60,41]=-0.9,s[60,42]=0.6,s[60,43]=0.4,s[60,44]=-1.1,s[60,45]=1.0,s[60,46]=-0.5,s[60,47]=0.7,s[60,48]=0.0,s[60,49]=0.6,s[60,50]=-0.2,s[60,51]=0.7,s[60,52]=0.0,s[60,53]=1.2,s[60,54]=-1.1,s[60,55]=0.9,s[60,56]=0.3,s[60,57]=1.2,s[60,58]=-1.1,s[60,59]=-0.1,s[60,60]=-0.4 s[61,1]=0.2,s[61,2]=-0.7,s[61,3]=0.4,s[61,4]=-1.0,s[61,5]=0.0,s[61,6]=-0.9,s[61,7]=1.2,s[61,8]=0.6,s[61,9]=-0.3,s[61,10]=-0.8,s[61,11]=1.2,s[61,12]=0.2,s[61,13]=-0.9,s[61,14]=-0.5,s[61,15]=0.9,s[61,16]=0.8,s[61,17]=-1.1,s[61,18]=-0.8,s[61,19]=0.6,s[61,20]=0.9,s[61,21]=-0.6,s[61,22]=-1.0,s[61,23]=0.6,s[61,24]=0.3,s[61,25]=0.6,s[61,26]=0.2,s[61,27]=-0.9,s[61,28]=1.0,s[61,29]=-0.7,s[61,30]=0.7,s[61,31]=0.3,s[61,32]=-1.2,s[61,33]=0.2,s[61,34]=0.1,s[61,35]=1.0,s[61,36]=-0.3,s[61,37]=1.2,s[61,38]=-0.7,s[61,39]=1.0,s[61,40]=0.3,s[61,41]=-1.2,s[61,42]=-0.9,s[61,43]=0.2,s[61,44]=0.7,s[61,45]=1.2,s[61,46]=0.0,s[61,47]=0.8,s[61,48]=-1.1,s[61,49]=0.8,s[61,50]=-1.1,s[61,51]=-0.7,s[61,52]=0.6,s[61,53]=0.8,s[61,54]=-0.6,s[61,55]=0.0,s[61,56]=0.3,s[61,57]=-0.8,s[61,58]=0.3,s[61,59]=-0.9,s[61,60]=0.5 s[62,1]=-0.7,s[62,2]=1.2,s[62,3]=0.6,s[62,4]=0.9,s[62,5]=-1.0,s[62,6]=0.4,s[62,7]=-1.0,s[62,8]=-0.3,s[62,9]=-0.9,s[62,10]=-1.2,s[62,11]=0.6,s[62,12]=-1.1,s[62,13]=1.0,s[62,14]=-0.9,s[62,15]=0.6,s[62,16]=0.9,s[62,17]=0.0,s[62,18]=0.0,s[62,19]=0.8,s[62,20]=-0.4,s[62,21]=-0.4,s[62,22]=-0.3,s[62,23]=0.4,s[62,24]=1.1,s[62,25]=-0.9,s[62,26]=1.2,s[62,27]=0.8,s[62,28]=0.0,s[62,29]=-0.3,s[62,30]=-0.6,s[62,31]=0.3,s[62,32]=-0.1,s[62,33]=0.3,s[62,34]=0.5,s[62,35]=0.2,s[62,36]=0.9,s[62,37]=-0.3,s[62,38]=-0.4,s[62,39]=1.2,s[62,40]=0.5,s[62,41]=0.0,s[62,42]=-1.0,s[62,43]=-0.7,s[62,44]=1.2,s[62,45]=-0.7,s[62,46]=-0.3,s[62,47]=-0.5,s[62,48]=-0.2,s[62,49]=0.5,s[62,50]=-1.2,s[62,51]=0.2,s[62,52]=-0.7,s[62,53]=1.2,s[62,54]=0.7,s[62,55]=-0.8,s[62,56]=-0.4,s[62,57]=0.0,s[62,58]=-0.9,s[62,59]=0.9,s[62,60]=0.2 s[63,1]=1.2,s[63,2]=-0.2,s[63,3]=-1.2,s[63,4]=-0.4,s[63,5]=-0.5,s[63,6]=-0.7,s[63,7]=0.1,s[63,8]=0.9,s[63,9]=0.5,s[63,10]=-1.2,s[63,11]=-1.1,s[63,12]=-0.8,s[63,13]=0.0,s[63,14]=0.5,s[63,15]=1.1,s[63,16]=-1.2,s[63,17]=-0.5,s[63,18]=-0.1,s[63,19]=0.4,s[63,20]=0.9,s[63,21]=-0.1,s[63,22]=-1.2,s[63,23]=0.1,s[63,24]=-1.2,s[63,25]=0.0,s[63,26]=-0.4,s[63,27]=0.1,s[63,28]=0.4,s[63,29]=-0.2,s[63,30]=-0.6,s[63,31]=-1.2,s[63,32]=0.1,s[63,33]=1.1,s[63,34]=-0.7,s[63,35]=0.6,s[63,36]=-0.3,s[63,37]=-0.8,s[63,38]=0.5,s[63,39]=-1.0,s[63,40]=0.6,s[63,41]=-0.7,s[63,42]=-0.9,s[63,43]=-0.1,s[63,44]=-0.9,s[63,45]=0.6,s[63,46]=0.1,s[63,47]=-0.7,s[63,48]=1.1,s[63,49]=-0.8,s[63,50]=-1.2,s[63,51]=1.2,s[63,52]=1.2,s[63,53]=-0.6,s[63,54]=1.2,s[63,55]=0.6,s[63,56]=-0.6,s[63,57]=0.7,s[63,58]=-0.9,s[63,59]=-0.1,s[63,60]=1.0 s[64,1]=1.1,s[64,2]=0.8,s[64,3]=0.4,s[64,4]=0.8,s[64,5]=1.2,s[64,6]=0.5,s[64,7]=0.5,s[64,8]=-0.4,s[64,9]=0.0,s[64,10]=-0.2,s[64,11]=0.9,s[64,12]=-0.3,s[64,13]=-0.5,s[64,14]=0.0,s[64,15]=0.9,s[64,16]=-0.9,s[64,17]=-1.2,s[64,18]=-0.6,s[64,19]=-0.1,s[64,20]=0.9,s[64,21]=0.0,s[64,22]=-0.6,s[64,23]=-0.1,s[64,24]=0.3,s[64,25]=-0.6,s[64,26]=-0.9,s[64,27]=0.6,s[64,28]=1.2,s[64,29]=-1.1,s[64,30]=0.5,s[64,31]=0.8,s[64,32]=-0.8,s[64,33]=-0.7,s[64,34]=0.7,s[64,35]=0.1,s[64,36]=-0.6,s[64,37]=0.0,s[64,38]=-0.7,s[64,39]=-1.0,s[64,40]=0.3,s[64,41]=0.1,s[64,42]=1.0,s[64,43]=0.2,s[64,44]=1.0,s[64,45]=-1.0,s[64,46]=0.5,s[64,47]=-1.2,s[64,48]=0.3,s[64,49]=0.1,s[64,50]=1.2,s[64,51]=-0.9,s[64,52]=-0.3,s[64,53]=0.5,s[64,54]=0.1,s[64,55]=-0.8,s[64,56]=-0.6,s[64,57]=-1.1,s[64,58]=0.8,s[64,59]=-0.1,s[64,60]=-1.0 s[65,1]=0.9,s[65,2]=-1.1,s[65,3]=0.9,s[65,4]=0.8,s[65,5]=-0.7,s[65,6]=-0.1,s[65,7]=0.2,s[65,8]=0.5,s[65,9]=-0.6,s[65,10]=-1.0,s[65,11]=0.9,s[65,12]=-0.8,s[65,13]=0.5,s[65,14]=0.7,s[65,15]=-0.4,s[65,16]=0.0,s[65,17]=-1.0,s[65,18]=-1.1,s[65,19]=-0.5,s[65,20]=0.4,s[65,21]=-1.2,s[65,22]=-1.1,s[65,23]=1.2,s[65,24]=-0.9,s[65,25]=-0.7,s[65,26]=-0.5,s[65,27]=0.1,s[65,28]=-0.6,s[65,29]=0.1,s[65,30]=-0.7,s[65,31]=0.3,s[65,32]=-1.0,s[65,33]=0.6,s[65,34]=1.0,s[65,35]=0.7,s[65,36]=-0.1,s[65,37]=1.1,s[65,38]=-0.9,s[65,39]=0.5,s[65,40]=1.2,s[65,41]=0.0,s[65,42]=-0.1,s[65,43]=0.4,s[65,44]=0.3,s[65,45]=0.6,s[65,46]=0.5,s[65,47]=1.2,s[65,48]=-0.2,s[65,49]=-0.2,s[65,50]=-0.3,s[65,51]=0.9,s[65,52]=-0.6,s[65,53]=0.5,s[65,54]=-0.8,s[65,55]=0.4,s[65,56]=1.2,s[65,57]=0.6,s[65,58]=0.9,s[65,59]=0.7,s[65,60]=-1.0 s[66,1]=-0.8,s[66,2]=-0.9,s[66,3]=0.2,s[66,4]=0.8,s[66,5]=-1.2,s[66,6]=-0.8,s[66,7]=0.2,s[66,8]=-0.9,s[66,9]=-1.1,s[66,10]=-0.5,s[66,11]=-0.7,s[66,12]=1.0,s[66,13]=0.0,s[66,14]=0.8,s[66,15]=-1.0,s[66,16]=-1.2,s[66,17]=-0.4,s[66,18]=0.0,s[66,19]=0.7,s[66,20]=-1.2,s[66,21]=-0.4,s[66,22]=-1.1,s[66,23]=1.0,s[66,24]=0.2,s[66,25]=0.4,s[66,26]=0.0,s[66,27]=0.4,s[66,28]=0.0,s[66,29]=-0.3,s[66,30]=-0.2,s[66,31]=1.0,s[66,32]=0.9,s[66,33]=-0.8,s[66,34]=0.8,s[66,35]=0.8,s[66,36]=-0.8,s[66,37]=-0.6,s[66,38]=-0.5,s[66,39]=0.0,s[66,40]=0.0,s[66,41]=0.4,s[66,42]=0.3,s[66,43]=-0.2,s[66,44]=0.0,s[66,45]=-0.5,s[66,46]=0.0,s[66,47]=-0.5,s[66,48]=0.2,s[66,49]=1.2,s[66,50]=-0.3,s[66,51]=0.1,s[66,52]=0.4,s[66,53]=-0.8,s[66,54]=0.5,s[66,55]=1.1,s[66,56]=-0.6,s[66,57]=-0.8,s[66,58]=0.8,s[66,59]=-0.2,s[66,60]=0.0 s[67,1]=-1.0,s[67,2]=0.2,s[67,3]=0.5,s[67,4]=-0.5,s[67,5]=1.1,s[67,6]=-0.7,s[67,7]=0.2,s[67,8]=-0.3,s[67,9]=0.2,s[67,10]=0.7,s[67,11]=-0.8,s[67,12]=0.5,s[67,13]=1.2,s[67,14]=0.4,s[67,15]=-1.0,s[67,16]=0.9,s[67,17]=-0.8,s[67,18]=0.9,s[67,19]=0.5,s[67,20]=0.7,s[67,21]=0.1,s[67,22]=-1.1,s[67,23]=-0.9,s[67,24]=0.7,s[67,25]=0.2,s[67,26]=0.2,s[67,27]=0.8,s[67,28]=1.1,s[67,29]=-0.7,s[67,30]=0.6,s[67,31]=1.0,s[67,32]=-0.7,s[67,33]=-1.2,s[67,34]=0.6,s[67,35]=0.4,s[67,36]=-0.2,s[67,37]=-1.1,s[67,38]=-1.2,s[67,39]=0.2,s[67,40]=1.1,s[67,41]=1.1,s[67,42]=0.9,s[67,43]=0.1,s[67,44]=0.2,s[67,45]=0.7,s[67,46]=-0.7,s[67,47]=0.5,s[67,48]=0.5,s[67,49]=1.0,s[67,50]=0.0,s[67,51]=0.1,s[67,52]=-1.1,s[67,53]=1.0,s[67,54]=0.5,s[67,55]=-0.4,s[67,56]=0.8,s[67,57]=1.1,s[67,58]=-1.2,s[67,59]=-1.1,s[67,60]=-0.8 s[68,1]=0.4,s[68,2]=-0.4,s[68,3]=0.7,s[68,4]=0.4,s[68,5]=-0.6,s[68,6]=0.6,s[68,7]=-0.2,s[68,8]=-0.3,s[68,9]=0.3,s[68,10]=1.1,s[68,11]=0.0,s[68,12]=0.5,s[68,13]=-1.2,s[68,14]=-0.9,s[68,15]=-0.7,s[68,16]=-0.4,s[68,17]=-1.0,s[68,18]=-0.3,s[68,19]=0.7,s[68,20]=-0.9,s[68,21]=0.3,s[68,22]=1.2,s[68,23]=0.0,s[68,24]=1.2,s[68,25]=0.3,s[68,26]=-0.4,s[68,27]=0.5,s[68,28]=0.7,s[68,29]=-0.9,s[68,30]=0.1,s[68,31]=0.4,s[68,32]=0.3,s[68,33]=-1.0,s[68,34]=-1.2,s[68,35]=-0.9,s[68,36]=0.6,s[68,37]=1.0,s[68,38]=-1.1,s[68,39]=0.4,s[68,40]=-0.6,s[68,41]=-1.1,s[68,42]=0.8,s[68,43]=-0.5,s[68,44]=0.3,s[68,45]=-1.0,s[68,46]=0.7,s[68,47]=-0.7,s[68,48]=-1.1,s[68,49]=-0.4,s[68,50]=1.0,s[68,51]=-0.7,s[68,52]=1.1,s[68,53]=-1.0,s[68,54]=-0.6,s[68,55]=-1.2,s[68,56]=-0.4,s[68,57]=-0.6,s[68,58]=1.1,s[68,59]=1.1,s[68,60]=-0.7 s[69,1]=0.4,s[69,2]=0.7,s[69,3]=-0.5,s[69,4]=1.1,s[69,5]=-0.6,s[69,6]=-0.8,s[69,7]=-1.1,s[69,8]=0.4,s[69,9]=0.8,s[69,10]=-0.9,s[69,11]=-0.3,s[69,12]=0.2,s[69,13]=0.4,s[69,14]=-0.7,s[69,15]=0.7,s[69,16]=1.1,s[69,17]=-0.5,s[69,18]=0.4,s[69,19]=0.0,s[69,20]=-0.5,s[69,21]=1.2,s[69,22]=0.0,s[69,23]=0.7,s[69,24]=-0.6,s[69,25]=-0.7,s[69,26]=-0.6,s[69,27]=-0.2,s[69,28]=0.5,s[69,29]=-1.2,s[69,30]=0.3,s[69,31]=-0.8,s[69,32]=0.5,s[69,33]=-0.1,s[69,34]=-0.5,s[69,35]=1.1,s[69,36]=-0.7,s[69,37]=-0.4,s[69,38]=0.6,s[69,39]=-0.9,s[69,40]=0.1,s[69,41]=-1.1,s[69,42]=-0.5,s[69,43]=-1.2,s[69,44]=-0.2,s[69,45]=0.3,s[69,46]=-0.1,s[69,47]=0.8,s[69,48]=0.4,s[69,49]=-0.1,s[69,50]=0.5,s[69,51]=-0.9,s[69,52]=1.1,s[69,53]=1.0,s[69,54]=0.9,s[69,55]=1.2,s[69,56]=0.9,s[69,57]=-0.4,s[69,58]=-1.2,s[69,59]=-0.3,s[69,60]=-1.0 s[70,1]=0.7,s[70,2]=0.8,s[70,3]=-0.2,s[70,4]=0.3,s[70,5]=1.0,s[70,6]=-0.8,s[70,7]=0.8,s[70,8]=-0.9,s[70,9]=-0.6,s[70,10]=-0.8,s[70,11]=0.8,s[70,12]=-0.9,s[70,13]=-0.5,s[70,14]=0.9,s[70,15]=0.6,s[70,16]=-0.2,s[70,17]=0.5,s[70,18]=-0.6,s[70,19]=0.3,s[70,20]=0.5,s[70,21]=-1.0,s[70,22]=0.0,s[70,23]=0.6,s[70,24]=0.9,s[70,25]=-1.1,s[70,26]=0.9,s[70,27]=-0.9,s[70,28]=0.8,s[70,29]=-0.8,s[70,30]=-0.3,s[70,31]=0.4,s[70,32]=-1.1,s[70,33]=-0.8,s[70,34]=-0.4,s[70,35]=0.7,s[70,36]=-1.2,s[70,37]=-0.6,s[70,38]=-0.9,s[70,39]=0.3,s[70,40]=-1.0,s[70,41]=0.6,s[70,42]=0.9,s[70,43]=0.9,s[70,44]=-1.1,s[70,45]=-0.9,s[70,46]=-0.9,s[70,47]=0.8,s[70,48]=1.0,s[70,49]=-1.2,s[70,50]=0.4,s[70,51]=-0.6,s[70,52]=-0.4,s[70,53]=0.3,s[70,54]=1.0,s[70,55]=0.3,s[70,56]=0.1,s[70,57]=0.0,s[70,58]=0.6,s[70,59]=0.3,s[70,60]=-0.8 s[71,1]=-1.0,s[71,2]=0.5,s[71,3]=0.6,s[71,4]=-1.2,s[71,5]=-1.1,s[71,6]=0.0,s[71,7]=-0.4,s[71,8]=0.6,s[71,9]=0.6,s[71,10]=0.9,s[71,11]=-0.9,s[71,12]=0.5,s[71,13]=-1.2,s[71,14]=-0.9,s[71,15]=0.3,s[71,16]=1.1,s[71,17]=-0.2,s[71,18]=-0.8,s[71,19]=0.4,s[71,20]=0.9,s[71,21]=0.2,s[71,22]=-0.8,s[71,23]=-0.5,s[71,24]=-1.1,s[71,25]=-0.7,s[71,26]=0.7,s[71,27]=1.1,s[71,28]=-0.3,s[71,29]=0.4,s[71,30]=0.8,s[71,31]=0.1,s[71,32]=0.4,s[71,33]=0.3,s[71,34]=-1.1,s[71,35]=0.5,s[71,36]=-1.2,s[71,37]=0.0,s[71,38]=0.8,s[71,39]=-1.1,s[71,40]=1.2,s[71,41]=0.6,s[71,42]=-0.6,s[71,43]=0.1,s[71,44]=0.9,s[71,45]=-0.8,s[71,46]=0.5,s[71,47]=1.0,s[71,48]=-1.0,s[71,49]=0.6,s[71,50]=-0.2,s[71,51]=0.2,s[71,52]=-0.1,s[71,53]=1.2,s[71,54]=-0.6,s[71,55]=-1.1,s[71,56]=-1.2,s[71,57]=-1.2,s[71,58]=-0.6,s[71,59]=0.4,s[71,60]=-0.7 s[72,1]=-0.3,s[72,2]=-0.9,s[72,3]=-0.4,s[72,4]=-0.8,s[72,5]=-1.1,s[72,6]=0.8,s[72,7]=-0.6,s[72,8]=0.1,s[72,9]=-0.7,s[72,10]=1.2,s[72,11]=0.4,s[72,12]=-0.7,s[72,13]=0.8,s[72,14]=-0.7,s[72,15]=1.1,s[72,16]=0.9,s[72,17]=0.7,s[72,18]=-0.7,s[72,19]=-1.2,s[72,20]=-0.9,s[72,21]=1.1,s[72,22]=-0.6,s[72,23]=0.1,s[72,24]=-0.5,s[72,25]=0.9,s[72,26]=-1.1,s[72,27]=1.2,s[72,28]=0.5,s[72,29]=0.2,s[72,30]=-0.9,s[72,31]=-0.9,s[72,32]=0.3,s[72,33]=-0.2,s[72,34]=0.5,s[72,35]=-1.0,s[72,36]=0.1,s[72,37]=0.7,s[72,38]=0.6,s[72,39]=0.7,s[72,40]=1.1,s[72,41]=0.0,s[72,42]=-0.9,s[72,43]=1.0,s[72,44]=0.5,s[72,45]=1.1,s[72,46]=-1.2,s[72,47]=1.1,s[72,48]=0.0,s[72,49]=0.4,s[72,50]=-0.6,s[72,51]=-1.0,s[72,52]=-0.6,s[72,53]=-0.3,s[72,54]=-0.6,s[72,55]=0.7,s[72,56]=-0.7,s[72,57]=0.5,s[72,58]=-0.7,s[72,59]=-0.3,s[72,60]=-1.1 s[73,1]=-0.3,s[73,2]=0.7,s[73,3]=-0.8,s[73,4]=0.8,s[73,5]=1.2,s[73,6]=0.9,s[73,7]=-0.7,s[73,8]=0.4,s[73,9]=-0.2,s[73,10]=0.4,s[73,11]=0.6,s[73,12]=-0.2,s[73,13]=-0.9,s[73,14]=0.7,s[73,15]=1.2,s[73,16]=-0.8,s[73,17]=0.5,s[73,18]=0.4,s[73,19]=-0.7,s[73,20]=0.6,s[73,21]=0.7,s[73,22]=-1.1,s[73,23]=-0.6,s[73,24]=-0.8,s[73,25]=-0.6,s[73,26]=0.5,s[73,27]=0.3,s[73,28]=0.4,s[73,29]=0.4,s[73,30]=0.7 s[73,31]=-0.5,s[73,32]=-0.2,s[73,33]=-0.9,s[73,34]=0.1,s[73,35]=0.9,s[73,36]=-1.0,s[73,37]=0.3,s[73,38]=0.8,s[73,39]=0.1,s[73,40]=0.4,s[73,41]=-1.0,s[73,42]=0.1,s[73,43]=0.6,s[73,44]=1.1,s[73,45]=0.0,s[73,46]=0.4,s[73,47]=-0.6,s[73,48]=0.7,s[73,49]=0.7,s[73,50]=1.2,s[73,51]=0.0,s[73,52]=0.0,s[73,53]=-1.2,s[73,54]=-0.1,s[73,55]=-0.6,s[73,56]=-0.8,s[73,57]=-0.8,s[73,58]=0.6,s[73,59]=-0.9,s[73,60]=0.3 s[74,1]=-0.4,s[74,2]=1.0,s[74,3]=1.1,s[74,4]=0.8,s[74,5]=0.9,s[74,6]=1.1,s[74,7]=0.8,s[74,8]=1.1,s[74,9]=-0.6,s[74,10]=-0.9,s[74,11]=1.1,s[74,12]=-1.0,s[74,13]=-1.2,s[74,14]=0.2,s[74,15]=1.2,s[74,16]=0.2,s[74,17]=-0.4,s[74,18]=0.5,s[74,19]=1.2,s[74,20]=1.0,s[74,21]=1.2,s[74,22]=-0.5,s[74,23]=0.1,s[74,24]=0.8,s[74,25]=-1.1,s[74,26]=-0.6,s[74,27]=-0.6,s[74,28]=0.2,s[74,29]=-0.1,s[74,30]=-0.8 s[74,31]=-0.7,s[74,32]=-0.6,s[74,33]=1.0,s[74,34]=0.6,s[74,35]=1.1,s[74,36]=0.3,s[74,37]=1.0,s[74,38]=-1.2,s[74,39]=0.4,s[74,40]=-1.0,s[74,41]=0.1,s[74,42]=-0.7,s[74,43]=-0.9,s[74,44]=-0.4,s[74,45]=0.8,s[74,46]=-0.2,s[74,47]=-1.1,s[74,48]=-0.2,s[74,49]=0.9,s[74,50]=0.7,s[74,51]=-0.4,s[74,52]=-0.1,s[74,53]=0.4,s[74,54]=-1.0,s[74,55]=0.8,s[74,56]=-0.3,s[74,57]=-1.2,s[74,58]=-0.2,s[74,59]=-1.0,s[74,60]=-0.2 s[75,1]=0.9,s[75,2]=0.6,s[75,3]=0.8,s[75,4]=-1.1,s[75,5]=-0.1,s[75,6]=0.6,s[75,7]=0.0,s[75,8]=-0.9,s[75,9]=0.7,s[75,10]=-1.1,s[75,11]=-1.2,s[75,12]=0.3,s[75,13]=1.0,s[75,14]=-0.7,s[75,15]=-0.3,s[75,16]=0.6,s[75,17]=0.4,s[75,18]=1.2,s[75,19]=1.2,s[75,20]=-0.5,s[75,21]=-1.0,s[75,22]=-0.6,s[75,23]=-0.2,s[75,24]=-0.6,s[75,25]=-0.4,s[75,26]=0.2,s[75,27]=0.8,s[75,28]=0.9,s[75,29]=-0.3,s[75,30]=-1.0 s[75,31]=-0.1,s[75,32]=0.3,s[75,33]=0.8,s[75,34]=0.5,s[75,35]=0.3,s[75,36]=-1.2,s[75,37]=0.6,s[75,38]=0.4,s[75,39]=-0.3,s[75,40]=-1.1,s[75,41]=-0.3,s[75,42]=-0.5,s[75,43]=-0.6,s[75,44]=-0.7,s[75,45]=-1.0,s[75,46]=0.6,s[75,47]=1.1,s[75,48]=-1.2,s[75,49]=-0.5,s[75,50]=-0.2,s[75,51]=-0.8,s[75,52]=0.5,s[75,53]=-1.2,s[75,54]=1.0,s[75,55]=1.2,s[75,56]=1.1,s[75,57]=-0.2,s[75,58]=0.2,s[75,59]=-0.9,s[75,60]=-0.4 s[76,1]=0.2,s[76,2]=-0.5,s[76,3]=0.1,s[76,4]=-0.1,s[76,5]=-0.5,s[76,6]=0.4,s[76,7]=0.5,s[76,8]=-0.3,s[76,9]=0.1,s[76,10]=0.9,s[76,11]=-0.9,s[76,12]=1.2,s[76,13]=1.2,s[76,14]=0.4,s[76,15]=-0.5,s[76,16]=0.7,s[76,17]=0.5,s[76,18]=0.7,s[76,19]=-0.9,s[76,20]=0.6,s[76,21]=0.5,s[76,22]=0.1,s[76,23]=0.4,s[76,24]=-0.4,s[76,25]=1.1,s[76,26]=0.2,s[76,27]=-0.2,s[76,28]=-0.3,s[76,29]=-0.9,s[76,30]=-1.1 s[76,31]=-0.2,s[76,32]=0.1,s[76,33]=0.3,s[76,34]=0.3,s[76,35]=-0.7,s[76,36]=-1.2,s[76,37]=1.1,s[76,38]=0.6,s[76,39]=0.4,s[76,40]=1.1,s[76,41]=-0.5,s[76,42]=-0.7,s[76,43]=0.5,s[76,44]=0.5,s[76,45]=1.1,s[76,46]=-0.4,s[76,47]=0.9,s[76,48]=1.1,s[76,49]=-0.6,s[76,50]=-0.9,s[76,51]=1.1,s[76,52]=-1.2,s[76,53]=0.5,s[76,54]=-1.1,s[76,55]=-0.9,s[76,56]=-1.2,s[76,57]=-1.1,s[76,58]=-0.9,s[76,59]=0.2,s[76,60]=-0.4 s[77,1]=0.6,s[77,2]=-0.9,s[77,3]=0.9,s[77,4]=-0.6,s[77,5]=-0.6,s[77,6]=-0.3,s[77,7]=-0.1,s[77,8]=-1.2,s[77,9]=-1.1,s[77,10]=0.5,s[77,11]=0.6,s[77,12]=-0.2,s[77,13]=0.3,s[77,14]=0.1,s[77,15]=-0.6,s[77,16]=1.1,s[77,17]=-1.2,s[77,18]=-1.1,s[77,19]=-0.7,s[77,20]=0.9,s[77,21]=-0.6,s[77,22]=-1.1,s[77,23]=1.2,s[77,24]=0.0,s[77,25]=0.2,s[77,26]=-0.3,s[77,27]=-0.1,s[77,28]=-1.0,s[77,29]=1.2,s[77,30]=0.7 s[77,31]=0.4,s[77,32]=0.2,s[77,33]=-0.4,s[77,34]=-1.1,s[77,35]=1.0,s[77,36]=0.0,s[77,37]=-0.4,s[77,38]=0.4,s[77,39]=0.1,s[77,40]=-0.7,s[77,41]=1.0,s[77,42]=-0.2,s[77,43]=-0.8,s[77,44]=-1.0,s[77,45]=-0.2,s[77,46]=-0.7,s[77,47]=-0.8,s[77,48]=-0.2,s[77,49]=-1.0,s[77,50]=-0.8,s[77,51]=0.6,s[77,52]=-0.5,s[77,53]=-0.9,s[77,54]=-0.4,s[77,55]=0.3,s[77,56]=-1.2,s[77,57]=0.2,s[77,58]=1.2,s[77,59]=0.4,s[77,60]=0.9 s[78,1]=1.1,s[78,2]=-0.6,s[78,3]=1.2,s[78,4]=1.0,s[78,5]=0.9,s[78,6]=0.7,s[78,7]=0.5,s[78,8]=-1.1,s[78,9]=-1.2,s[78,10]=0.0,s[78,11]=-1.2,s[78,12]=-1.1,s[78,13]=-0.2,s[78,14]=0.4,s[78,15]=-0.1,s[78,16]=-0.9,s[78,17]=0.6,s[78,18]=-0.4,s[78,19]=1.2,s[78,20]=-0.3,s[78,21]=-1.1,s[78,22]=-0.1,s[78,23]=0.2,s[78,24]=-0.6,s[78,25]=0.6,s[78,26]=0.2,s[78,27]=-1.0,s[78,28]=-0.4,s[78,29]=-1.1,s[78,30]=1.0 s[78,31]=0.7,s[78,32]=-0.6,s[78,33]=-0.8,s[78,34]=0.5,s[78,35]=0.9,s[78,36]=0.7,s[78,37]=-0.6,s[78,38]=0.7,s[78,39]=-0.2,s[78,40]=0.7,s[78,41]=0.0,s[78,42]=0.5,s[78,43]=0.3,s[78,44]=0.2,s[78,45]=0.1,s[78,46]=-1.2,s[78,47]=-1.1,s[78,48]=0.8,s[78,49]=0.0,s[78,50]=-0.4,s[78,51]=1.1,s[78,52]=0.3,s[78,53]=-0.5,s[78,54]=-1.2,s[78,55]=-1.0,s[78,56]=-0.1,s[78,57]=-0.5,s[78,58]=-0.8,s[78,59]=-0.8,s[78,60]=-0.6 s[79,1]=0.4,s[79,2]=-1.0,s[79,3]=-0.9,s[79,4]=1.1,s[79,5]=0.4,s[79,6]=0.0,s[79,7]=0.1,s[79,8]=1.2,s[79,9]=-0.6,s[79,10]=0.4,s[79,11]=1.1,s[79,12]=-1.2,s[79,13]=0.4,s[79,14]=0.7,s[79,15]=1.1,s[79,16]=-0.6,s[79,17]=-0.5,s[79,18]=-1.1,s[79,19]=-1.0,s[79,20]=-0.4,s[79,21]=0.8,s[79,22]=-0.8,s[79,23]=1.1,s[79,24]=1.2,s[79,25]=0.4,s[79,26]=-0.8,s[79,27]=-0.3,s[79,28]=1.1,s[79,29]=-0.1,s[79,30]=0.1 s[79,31]=1.2,s[79,32]=-1.0,s[79,33]=-0.6,s[79,34]=0.4,s[79,35]=0.0,s[79,36]=0.1,s[79,37]=-0.1,s[79,38]=0.2,s[79,39]=0.0,s[79,40]=1.2,s[79,41]=0.2,s[79,42]=0.1,s[79,43]=-0.9,s[79,44]=-0.6,s[79,45]=-0.7,s[79,46]=-0.9,s[79,47]=-0.7,s[79,48]=0.5,s[79,49]=-0.3,s[79,50]=-0.2,s[79,51]=-0.8,s[79,52]=0.9,s[79,53]=0.8,s[79,54]=-0.6,s[79,55]=0.7,s[79,56]=-0.2,s[79,57]=-0.1,s[79,58]=-0.8,s[79,59]=-1.2,s[79,60]=0.1 s[80,1]=-0.8,s[80,2]=1.0,s[80,3]=-0.9,s[80,4]=0.2,s[80,5]=-0.3,s[80,6]=-0.9,s[80,7]=0.8,s[80,8]=0.4,s[80,9]=0.4,s[80,10]=0.3,s[80,11]=-1.0,s[80,12]=0.0,s[80,13]=-1.2,s[80,14]=1.2,s[80,15]=0.3,s[80,16]=1.1,s[80,17]=-1.1,s[80,18]=-0.2,s[80,19]=-1.2,s[80,20]=-1.0,s[80,21]=0.9,s[80,22]=-0.1,s[80,23]=0.8,s[80,24]=-1.1,s[80,25]=-0.2,s[80,26]=-0.5,s[80,27]=0.8,s[80,28]=-0.1,s[80,29]=-0.4,s[80,30]=-0.2 s[80,31]=0.8,s[80,32]=0.4,s[80,33]=-1.2,s[80,34]=-1.0,s[80,35]=0.9,s[80,36]=0.6,s[80,37]=0.8,s[80,38]=-0.5,s[80,39]=-0.9,s[80,40]=0.8,s[80,41]=0.8,s[80,42]=0.6,s[80,43]=-1.0,s[80,44]=1.0,s[80,45]=0.0,s[80,46]=-0.2,s[80,47]=0.4,s[80,48]=0.0,s[80,49]=1.0,s[80,50]=-0.6,s[80,51]=-1.1,s[80,52]=1.2,s[80,53]=0.4,s[80,54]=0.8,s[80,55]=0.2,s[80,56]=0.8,s[80,57]=0.6,s[80,58]=0.2,s[80,59]=-0.9,s[80,60]=0.0 s[81,1]=1.0,s[81,2]=-0.3,s[81,3]=-0.5,s[81,4]=-0.9,s[81,5]=1.1,s[81,6]=-0.3,s[81,7]=-0.1,s[81,8]=0.1,s[81,9]=1.0,s[81,10]=-1.0,s[81,11]=0.5,s[81,12]=-0.5,s[81,13]=1.2,s[81,14]=0.9,s[81,15]=-0.5,s[81,16]=-0.6,s[81,17]=1.0,s[81,18]=1.1,s[81,19]=-0.4,s[81,20]=-0.9,s[81,21]=0.9,s[81,22]=0.0,s[81,23]=-0.9,s[81,24]=-0.4,s[81,25]=1.0,s[81,26]=-1.0,s[81,27]=-0.3,s[81,28]=-1.2,s[81,29]=-0.1,s[81,30]=-0.6 s[81,31]=-0.3,s[81,32]=-0.6,s[81,33]=0.9,s[81,34]=1.1,s[81,35]=-0.5,s[81,36]=-1.0,s[81,37]=0.7,s[81,38]=0.2,s[81,39]=0.8,s[81,40]=-1.1,s[81,41]=-1.1,s[81,42]=0.3,s[81,43]=0.0,s[81,44]=-0.6,s[81,45]=-0.6,s[81,46]=1.0,s[81,47]=0.1,s[81,48]=-1.0,s[81,49]=-0.9,s[81,50]=-1.1,s[81,51]=-0.1,s[81,52]=-1.1,s[81,53]=-1.2,s[81,54]=1.1,s[81,55]=0.8,s[81,56]=0.3,s[81,57]=-1.1,s[81,58]=-0.4,s[81,59]=-0.5,s[81,60]=0.2 s[82,1]=-0.1,s[82,2]=0.5,s[82,3]=-0.3,s[82,4]=0.7,s[82,5]=-0.6,s[82,6]=-0.8,s[82,7]=-1.2,s[82,8]=-1.2,s[82,9]=0.8,s[82,10]=1.1,s[82,11]=1.0,s[82,12]=-0.4,s[82,13]=-0.1,s[82,14]=-0.3,s[82,15]=0.6,s[82,16]=-0.9,s[82,17]=0.2,s[82,18]=-1.2,s[82,19]=-0.2,s[82,20]=-1.2,s[82,21]=0.0,s[82,22]=0.4,s[82,23]=0.4,s[82,24]=-0.9,s[82,25]=0.2,s[82,26]=-0.1,s[82,27]=1.0,s[82,28]=1.1,s[82,29]=-1.1,s[82,30]=0.3 s[82,31]=0.5,s[82,32]=-0.8,s[82,33]=-0.2,s[82,34]=0.1,s[82,35]=0.7,s[82,36]=-0.6,s[82,37]=-0.3,s[82,38]=-0.6,s[82,39]=0.7,s[82,40]=0.5,s[82,41]=-0.2,s[82,42]=0.5,s[82,43]=-0.7,s[82,44]=0.7,s[82,45]=0.7,s[82,46]=0.6,s[82,47]=0.9,s[82,48]=-0.4,s[82,49]=-1.1,s[82,50]=0.8,s[82,51]=0.0,s[82,52]=1.0,s[82,53]=-0.6,s[82,54]=1.0,s[82,55]=0.3,s[82,56]=-0.6,s[82,57]=1.0,s[82,58]=0.5,s[82,59]=-0.2,s[82,60]=0.9 s[83,1]=-0.1,s[83,2]=0.0,s[83,3]=-0.8,s[83,4]=0.7,s[83,5]=0.2,s[83,6]=1.2,s[83,7]=-0.5,s[83,8]=0.7,s[83,9]=1.1,s[83,10]=1.2,s[83,11]=0.0,s[83,12]=0.1,s[83,13]=0.5,s[83,14]=-0.2,s[83,15]=0.5,s[83,16]=1.1,s[83,17]=-0.1,s[83,18]=-0.5,s[83,19]=-1.1,s[83,20]=0.7,s[83,21]=0.6,s[83,22]=-1.1,s[83,23]=0.4,s[83,24]=-0.5,s[83,25]=0.1,s[83,26]=-1.0,s[83,27]=-1.2,s[83,28]=0.1,s[83,29]=0.5,s[83,30]=0.8 s[83,31]=-0.6,s[83,32]=1.1,s[83,33]=-0.8,s[83,34]=-1.1,s[83,35]=-0.9,s[83,36]=0.8,s[83,37]=1.1,s[83,38]=-0.4,s[83,39]=-0.4,s[83,40]=-0.5,s[83,41]=-0.2,s[83,42]=1.2,s[83,43]=0.5,s[83,44]=1.1,s[83,45]=-0.8,s[83,46]=0.3,s[83,47]=0.0,s[83,48]=1.2,s[83,49]=0.4,s[83,50]=0.7,s[83,51]=-1.2,s[83,52]=0.6,s[83,53]=-0.5,s[83,54]=-0.4,s[83,55]=1.1,s[83,56]=-0.9,s[83,57]=0.2,s[83,58]=1.0,s[83,59]=0.9,s[83,60]=-0.1 s[84,1]=0.7,s[84,2]=-0.5,s[84,3]=-0.6,s[84,4]=-0.1,s[84,5]=-0.8,s[84,6]=0.2,s[84,7]=1.0,s[84,8]=0.1,s[84,9]=-0.2,s[84,10]=0.9,s[84,11]=0.4,s[84,12]=1.0,s[84,13]=1.1,s[84,14]=0.8,s[84,15]=0.3,s[84,16]=-0.5,s[84,17]=0.8,s[84,18]=-0.2,s[84,19]=0.6,s[84,20]=0.8,s[84,21]=-0.8,s[84,22]=0.3,s[84,23]=0.5,s[84,24]=-0.8,s[84,25]=0.1,s[84,26]=1.1,s[84,27]=-1.2,s[84,28]=-0.3,s[84,29]=-0.6,s[84,30]=0.1 s[84,31]=-1.0,s[84,32]=-0.5,s[84,33]=0.4,s[84,34]=0.0,s[84,35]=-0.8,s[84,36]=-0.7,s[84,37]=0.2,s[84,38]=0.5,s[84,39]=-0.2,s[84,40]=-0.4,s[84,41]=0.7,s[84,42]=-0.3,s[84,43]=-0.1,s[84,44]=0.2,s[84,45]=-0.7,s[84,46]=-0.8,s[84,47]=0.8,s[84,48]=-0.1,s[84,49]=-1.2,s[84,50]=0.6,s[84,51]=-0.5,s[84,52]=-0.6,s[84,53]=-0.9,s[84,54]=-0.4,s[84,55]=0.1,s[84,56]=-0.1,s[84,57]=0.5,s[84,58]=0.1,s[84,59]=-0.4,s[84,60]=-0.1 s[85,1]=0.4,s[85,2]=1.2,s[85,3]=-0.7,s[85,4]=-1.2,s[85,5]=-1.0,s[85,6]=0.2,s[85,7]=0.5,s[85,8]=1.0,s[85,9]=-1.2,s[85,10]=0.0,s[85,11]=0.1,s[85,12]=1.0,s[85,13]=0.3,s[85,14]=0.1,s[85,15]=-1.2,s[85,16]=-1.0,s[85,17]=-0.7,s[85,18]=1.1,s[85,19]=-0.8,s[85,20]=1.0,s[85,21]=-0.2,s[85,22]=-1.0,s[85,23]=-1.0,s[85,24]=0.7,s[85,25]=0.1,s[85,26]=-0.6,s[85,27]=-0.3,s[85,28]=1.2,s[85,29]=0.7,s[85,30]=0.4 s[85,31]=0.8,s[85,32]=0.2,s[85,33]=0.2,s[85,34]=0.3,s[85,35]=-0.1,s[85,36]=1.1,s[85,37]=-0.8,s[85,38]=0.0,s[85,39]=-0.4,s[85,40]=-0.7,s[85,41]=-0.7,s[85,42]=-0.2,s[85,43]=0.0,s[85,44]=1.1,s[85,45]=-0.1,s[85,46]=-1.1,s[85,47]=0.9,s[85,48]=0.3,s[85,49]=-0.7,s[85,50]=-0.6,s[85,51]=0.6,s[85,52]=-0.6,s[85,53]=-1.0,s[85,54]=0.3,s[85,55]=0.5,s[85,56]=-0.1,s[85,57]=-0.7,s[85,58]=-0.3,s[85,59]=0.6,s[85,60]=1.2 s[86,1]=-1.0,s[86,2]=0.5,s[86,3]=0.0,s[86,4]=-1.0,s[86,5]=0.1,s[86,6]=0.1,s[86,7]=-0.8,s[86,8]=-1.2,s[86,9]=1.0,s[86,10]=-0.4,s[86,11]=-0.3,s[86,12]=0.9,s[86,13]=1.0,s[86,14]=-0.4,s[86,15]=-1.2,s[86,16]=1.0,s[86,17]=-0.5,s[86,18]=-0.3,s[86,19]=1.0,s[86,20]=-0.9,s[86,21]=-0.5,s[86,22]=1.1,s[86,23]=0.3,s[86,24]=-0.5,s[86,25]=0.8,s[86,26]=0.8,s[86,27]=-0.1,s[86,28]=-0.2,s[86,29]=0.2,s[86,30]=0.0 s[86,31]=1.1,s[86,32]=-0.4,s[86,33]=1.1,s[86,34]=-1.1,s[86,35]=-0.7,s[86,36]=-0.5,s[86,37]=-1.0,s[86,38]=-0.1,s[86,39]=-0.8,s[86,40]=-0.1,s[86,41]=0.2,s[86,42]=-0.1,s[86,43]=-0.9,s[86,44]=-0.1,s[86,45]=-1.1,s[86,46]=0.1,s[86,47]=0.3,s[86,48]=-0.4,s[86,49]=-1.1,s[86,50]=0.5,s[86,51]=1.0,s[86,52]=-0.9,s[86,53]=-0.3,s[86,54]=-0.2,s[86,55]=0.2,s[86,56]=-0.8,s[86,57]=-0.2,s[86,58]=-1.2,s[86,59]=-1.0,s[86,60]=0.3 s[87,1]=1.0,s[87,2]=-0.1,s[87,3]=0.0,s[87,4]=-1.0,s[87,5]=1.1,s[87,6]=0.3,s[87,7]=-1.2,s[87,8]=-0.1,s[87,9]=1.0,s[87,10]=0.0,s[87,11]=0.2,s[87,12]=0.3,s[87,13]=1.1,s[87,14]=-0.6,s[87,15]=0.0,s[87,16]=-0.5,s[87,17]=0.0,s[87,18]=0.8,s[87,19]=-1.2,s[87,20]=0.3,s[87,21]=-0.1,s[87,22]=-0.9,s[87,23]=0.7,s[87,24]=1.2,s[87,25]=-0.3,s[87,26]=1.1,s[87,27]=0.8,s[87,28]=1.0,s[87,29]=1.0,s[87,30]=0.0 s[87,31]=-0.5,s[87,32]=1.0,s[87,33]=-0.2,s[87,34]=-0.1,s[87,35]=0.1,s[87,36]=-0.1,s[87,37]=-0.9,s[87,38]=0.0,s[87,39]=-0.2,s[87,40]=-0.4,s[87,41]=0.5,s[87,42]=-0.5,s[87,43]=-0.5,s[87,44]=-0.3,s[87,45]=-1.2,s[87,46]=-0.1,s[87,47]=-0.8,s[87,48]=-0.5,s[87,49]=0.8,s[87,50]=0.4,s[87,51]=-0.9,s[87,52]=-0.1,s[87,53]=0.7,s[87,54]=0.3,s[87,55]=-0.6,s[87,56]=-1.2,s[87,57]=-0.7,s[87,58]=1.0,s[87,59]=-1.2,s[87,60]=0.8 s[88,1]=-0.2,s[88,2]=-0.5,s[88,3]=1.1,s[88,4]=-0.1,s[88,5]=0.8,s[88,6]=0.6,s[88,7]=0.0,s[88,8]=0.6,s[88,9]=-0.7,s[88,10]=1.2,s[88,11]=0.3,s[88,12]=1.2,s[88,13]=0.8,s[88,14]=-0.7,s[88,15]=-0.2,s[88,16]=1.1,s[88,17]=-0.9,s[88,18]=-1.2,s[88,19]=0.0,s[88,20]=0.5,s[88,21]=-0.9,s[88,22]=0.3,s[88,23]=0.5,s[88,24]=-0.5,s[88,25]=0.7,s[88,26]=0.1,s[88,27]=0.2,s[88,28]=1.1,s[88,29]=-0.7,s[88,30]=0.2 s[88,31]=-1.1,s[88,32]=-0.5,s[88,33]=-0.4,s[88,34]=0.5,s[88,35]=0.2,s[88,36]=0.1,s[88,37]=-0.1,s[88,38]=0.3,s[88,39]=-0.1,s[88,40]=-0.4,s[88,41]=-0.8,s[88,42]=-0.9,s[88,43]=-0.6,s[88,44]=0.5,s[88,45]=0.0,s[88,46]=-0.4,s[88,47]=0.2,s[88,48]=-0.6,s[88,49]=-0.5,s[88,50]=0.2,s[88,51]=1.0,s[88,52]=-0.8,s[88,53]=-1.0,s[88,54]=-0.1,s[88,55]=-1.1,s[88,56]=-0.3,s[88,57]=-0.7,s[88,58]=0.0,s[88,59]=0.5,s[88,60]=0.4 s[89,1]=0.3,s[89,2]=-0.9,s[89,3]=0.7,s[89,4]=0.9,s[89,5]=1.0,s[89,6]=-0.3,s[89,7]=-0.2,s[89,8]=-1.1,s[89,9]=-1.1,s[89,10]=-1.0,s[89,11]=1.2,s[89,12]=1.2,s[89,13]=0.8,s[89,14]=0.4,s[89,15]=1.1,s[89,16]=0.5,s[89,17]=-1.0,s[89,18]=-0.8,s[89,19]=-0.1,s[89,20]=-0.9,s[89,21]=0.1,s[89,22]=-0.5,s[89,23]=0.1,s[89,24]=-0.5,s[89,25]=0.8,s[89,26]=1.2,s[89,27]=-0.9,s[89,28]=-0.8,s[89,29]=-0.9,s[89,30]=0.8 s[89,31]=-0.9,s[89,32]=-0.1,s[89,33]=-0.3,s[89,34]=-0.9,s[89,35]=-1.0,s[89,36]=0.5,s[89,37]=-0.7,s[89,38]=1.0,s[89,39]=0.9,s[89,40]=0.6,s[89,41]=-0.9,s[89,42]=-0.9,s[89,43]=0.2,s[89,44]=0.9,s[89,45]=-0.2,s[89,46]=-0.3,s[89,47]=-1.0,s[89,48]=1.2,s[89,49]=1.2,s[89,50]=0.9,s[89,51]=0.1,s[89,52]=1.2,s[89,53]=0.5,s[89,54]=0.5,s[89,55]=-1.1,s[89,56]=-0.2,s[89,57]=0.7,s[89,58]=0.3,s[89,59]=-0.3,s[89,60]=1.0 s[90,1]=0.8,s[90,2]=0.1,s[90,3]=-0.7,s[90,4]=-0.9,s[90,5]=0.4,s[90,6]=1.2,s[90,7]=0.8,s[90,8]=1.2,s[90,9]=-1.1,s[90,10]=0.4,s[90,11]=0.8,s[90,12]=-0.3,s[90,13]=-0.1,s[90,14]=1.2,s[90,15]=-1.1,s[90,16]=-0.6,s[90,17]=-0.3,s[90,18]=0.9,s[90,19]=-0.5,s[90,20]=0.3,s[90,21]=-1.1,s[90,22]=-0.6,s[90,23]=-0.2,s[90,24]=-0.9,s[90,25]=-0.6,s[90,26]=-1.1,s[90,27]=-0.9,s[90,28]=0.7,s[90,29]=-0.2,s[90,30]=-0.8 s[90,31]=-0.7,s[90,32]=-0.8,s[90,33]=0.2,s[90,34]=-1.2,s[90,35]=0.4,s[90,36]=0.9,s[90,37]=-0.3,s[90,38]=-1.2,s[90,39]=-0.3,s[90,40]=-1.2,s[90,41]=-0.7,s[90,42]=0.5,s[90,43]=0.0,s[90,44]=-0.7,s[90,45]=0.9,s[90,46]=0.3,s[90,47]=0.0,s[90,48]=-0.2,s[90,49]=0.6,s[90,50]=1.2,s[90,51]=0.4,s[90,52]=0.7,s[90,53]=0.3,s[90,54]=0.1,s[90,55]=-0.6,s[90,56]=1.0,s[90,57]=0.4,s[90,58]=0.5,s[90,59]=-1.2,s[90,60]=0.4 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float ppz = @ppz float ppw = @ppw float pxx = 0 float pyy = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x pyy = y float pzz = ppz x = x+0.1*(s[@sel,1] + s[@sel,2]*x + s[@sel,3]*x*x + s[@sel,4]*x*y + s[@sel,5]*x*ppz + s[@sel,6]*x*ppw + s[@sel,7]*y + s[@sel,8]*y*y + \ s[@sel,9]*y*ppz + s[@sel,10]*y*ppw + s[@sel,11]*ppz + s[@sel,12]*ppz*ppz + s[@sel,13]*ppz*ppw + s[@sel,14]*ppw + s[@sel,15]*ppw*ppw) y = y+0.1*(s[@sel,16] + s[@sel,17]*pxx + s[@sel,18]*pxx*pxx + s[@sel,19]*pxx*y + s[@sel,20]*pxx*ppz + s[@sel,21]*pxx*ppw + s[@sel,22]*y + s[@sel,23]*y*y + \ s[@sel,24]*y*ppz + s[@sel,25]*y*ppw + s[@sel,26]*ppz + s[@sel,27]*ppz*ppz + s[@sel,28]*ppz*ppw + s[@sel,29]*ppw + s[@sel,30]*ppw*ppw) ppz = ppz+0.1*(s[@sel,31] + s[@sel,32]*pxx + s[@sel,33]*pxx*pxx + s[@sel,34]*pxx*pyy + s[@sel,35]*pxx*ppz + s[@sel,36]*pxx*ppw + s[@sel,37]*pyy + s[@sel,38]*pyy*pyy + \ s[@sel,39]*pyy*ppz + s[@sel,40]*pyy*ppw + s[@sel,41]*ppz + s[@sel,42]*ppz*ppz + s[@sel,43]*ppz*ppw + s[@sel,44]*ppw + s[@sel,45]*ppw*ppw) ppw = ppw+0.1*(s[@sel,46] + s[@sel,47]*pxx + s[@sel,48]*pxx*pxx + s[@sel,49]*pxx*pyy + s[@sel,50]*pxx*pzz + s[@sel,51]*pxx*ppw + s[@sel,52]*pyy + s[@sel,53]*pyy*pyy + \ s[@sel,54]*pyy*pzz + s[@sel,55]*pyy*ppw + s[@sel,56]*pzz + s[@sel,57]*pzz*pzz + s[@sel,58]*pzz*ppw + s[@sel,59]*ppw + s[@sel,60]*ppw*ppw) att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y) + ppz*@pw + ppw*@p4) float d = @distscale*|pz-(x + sgn*flip(y) + ppz*@pw + ppw*@p4)| return d endfunc private: float s[91,61] default: title = "Sprott4D_ODE" heading text="Strange attractors from simultaneous ordinary differential \ equations using Euler's finite difference method to calculate." endheading heading text="Sprott 4D ODE quadratic attractors" endheading heading text=" x -> x + 0.1*(Quadratic in x, y, z and w)" endheading heading text=" y -> y + 0.1*(Quadratic in x, y, z and w)" endheading heading text=" z -> z + 0.1*(Quadratic in x, y, z and w)" endheading heading text=" w -> w + 0.1*(Quadratic in x, y, z and w)" endheading int param v_trapshapesprott4d_ode caption = "Version (Trap Shape Sprott4D_ODE)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesprott4D_ode < 100 endparam param sel caption = "Sprott selector" default = 0 enum = "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" \ "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" \ "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" \ "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" \ "41" "42" "43" "44" "45" "46" "47" "48" "49" "50" \ "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" \ "61" "62" "63" "64" "65" "66" "67" "68" "69" "70" \ "71" "72" "73" "74" "75" "76" "77" "78" "79" "80" \ "81" "82" "83" "84" "85" "86" "87" "88" "89" "90" hint = "Each Sprott selector uses a different strange attractor." endparam heading text = "'Initialize Height' sets the starting z value for the attractor." endheading float param ppz caption = "Initialize Height" default = 0.0 endparam heading text = "'Initialize 4th dim' sets the starting w value for the attractor." endheading float param ppw caption = "Initialize 4th dim" default = 0.0 endparam heading text = "'Height weight' determines the weight of the final z value which is added \ to the trap distance." endheading complex param pw caption = "Height weight" default = (0,0) endparam heading text = "'4D weight' determines the weight of the final w value which is added \ to the trap distance." endheading complex param p4 caption = "4D weight" default = (0,0) endparam float param distscale caption = "Distance scale" default = 1 endparam float param s caption = "Attractor scale" default = 0.5 endparam int param max_att_iterations caption = "Attractor iterations" default = 100 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeSprott3D_ODE(common.ulb:TrapShape) { ; This shape uses a Sprott strange attractor.
;

; The Sprott attractors were developed by Julien C. Sprott, and are ; based upon polynomials and linear differential equations of polynomials. public: import "common.ulb" ; Constructor func REB_TrapShapeSprott3D_ODE(Generic pparent) TrapShape.TrapShape(pparent) so[0,1]=-1.2,so[0,2]=-0.7,so[0,3]=0.9,so[0,4]=0.5,so[0,5]=0.9,so[0,6]=-0.1,so[0,7]=-0.2,so[0,8]=-0.5,so[0,9]=-1.1,so[0,10]=0.5,so[0,11]=-1.0,so[0,12]=1.0,so[0,13]=-0.8,so[0,14]=0.6 so[0,15]=0.6,so[0,16]=1.2,so[0,17]=-0.1,so[0,18]=1.1,so[0,19]=1.1,so[0,20]=0.6,so[0,21]=0.3,so[0,22]=0.6,so[0,23]=-1.1,so[0,24]=-0.7,so[0,25]=-0.1,so[0,26]=-1.0,so[0,27]=-0.2,so[0,28]=-0.2,so[0,29]=-0.1,so[0,30]=0.1 so[1,1]=1.0,so[1,2]=-1.1,so[1,3]=-0.6,so[1,4]=-1.0,so[1,5]=0.2,so[1,6]=0.4,so[1,7]=1.0,so[1,8]=0.8,so[1,9]=0.5,so[1,10]=-0.8,so[1,11]=0.1,so[1,12]=-0.1,so[1,13]=-1.2,so[1,14]=-0.9 so[1,15]=0.3,so[1,16]=1.0,so[1,17]=-0.9,so[1,18]=-0.5,so[1,19]=1.1,so[1,20]=1.0,so[1,21]=0.1,so[1,22]=-1.0,so[1,23]=1.0,so[1,24]=-0.9,so[1,25]=-0.4,so[1,26]=-0.6,so[1,27]=0.3,so[1,28]=-0.6,so[1,29]=0.1,so[1,30]=0.7 so[2,1]=-1.0,so[2,2]=-0.3,so[2,3]=0.2,so[2,4]=-0.9,so[2,5]=0.7,so[2,6]=-0.1,so[2,7]=0.3,so[2,8]=1.1,so[2,9]=-0.8,so[2,10]=-0.5,so[2,11]=-1.1,so[2,12]=1.2,so[2,13]=-1.0,so[2,14]=-0.6 so[2,15]=0.6,so[2,16]=1.2,so[2,17]=-0.1,so[2,18]=0.5,so[2,19]=0.5,so[2,20]=0.8,so[2,21]=-1.2,so[2,22]=-0.8,so[2,23]=-1.1,so[2,24]=1.1,so[2,25]=0.7,so[2,26]=0.5,so[2,27]=0.0,so[2,28]=-1.1,so[2,29]=-0.5,so[2,30]=0.6 so[3,1]=-0.8,so[3,2]=-0.5,so[3,3]=0.5,so[3,4]=0.2,so[3,5]=0.2,so[3,6]=-1.1,so[3,7]=-0.8,so[3,8]=-1.0,so[3,9]=-1.1,so[3,10]=0.4,so[3,11]=-1.0,so[3,12]=-0.3,so[3,13]=0.6,so[3,14]=1.1 so[3,15]=0.7,so[3,16]=0.4,so[3,17]=0.1,so[3,18]=1.0,so[3,19]=1.0,so[3,20]=-0.7,so[3,21]=1.1,so[3,22]=-1.0,so[3,23]=-0.9,so[3,24]=-0.9,so[3,25]=-0.7,so[3,26]=-0.3,so[3,27]=-0.2,so[3,28]=-0.3,so[3,29]=-1.0,so[3,30]=0.1 so[4,1]=-0.3,so[4,2]=-0.9,so[4,3]=1.2,so[4,4]=0.1,so[4,5]=1.1,so[4,6]=-1.1,so[4,7]=-0.1,so[4,8]=0.4,so[4,9]=0.4,so[4,10]=-0.6,so[4,11]=0.8,so[4,12]=-0.2,so[4,13]=-0.1,so[4,14]=1.0 so[4,15]=-1.1,so[4,16]=0.3,so[4,17]=-0.5,so[4,18]=-1.0,so[4,19]=1.2,so[4,20]=0.1,so[4,21]=-0.7,so[4,22]=0.1,so[4,23]=-0.3,so[4,24]=0.1,so[4,25]=0.6,so[4,26]=0.6,so[4,27]=0.7,so[4,28]=1.1,so[4,29]=-0.8,so[4,30]=-0.4 so[5,1]=-1.1,so[5,2]=0.1,so[5,3]=0.9,so[5,4]=0.1,so[5,5]=0.2,so[5,6]=0.6,so[5,7]=0.2,so[5,8]=0.0,so[5,9]=-0.2,so[5,10]=-0.2,so[5,11]=-0.3,so[5,12]=-1.1,so[5,13]=0.6,so[5,14]=0.8 so[5,15]=-0.1,so[5,16]=-0.1,so[5,17]=0.3,so[5,18]=0.2,so[5,19]=0.8,so[5,20]=-0.7,so[5,21]=0.6,so[5,22]=-1.1,so[5,23]=0.8,so[5,24]=-0.9,so[5,25]=0.1,so[5,26]=0.1,so[5,27]=-0.4,so[5,28]=0.8,so[5,29]=-0.7,so[5,30]=0.6 so[6,1]=0.7,so[6,2]=-0.2,so[6,3]=-1.2,so[6,4]=0.4,so[6,5]=0.3,so[6,6]=-1.0,so[6,7]=0.2,so[6,8]=-1.0,so[6,9]=-1.2,so[6,10]=1.2,so[6,11]=0.5,so[6,12]=0.8,so[6,13]=-1.1,so[6,14]=-0.6 so[6,15]=-0.3,so[6,16]=0.4,so[6,17]=-0.2,so[6,18]=-0.1,so[6,19]=-1.2,so[6,20]=0.1,so[6,21]=0.1,so[6,22]=0.8,so[6,23]=1.1,so[6,24]=0.5,so[6,25]=1.0,so[6,26]=0.0,so[6,27]=-0.8,so[6,28]=-0.3,so[6,29]=-0.6,so[6,30]=0.4 so[7,1]=0.3,so[7,2]=0.1,so[7,3]=0.6,so[7,4]=-0.5,so[7,5]=0.2,so[7,6]=0.5,so[7,7]=1.2,so[7,8]=0.0,so[7,9]=-0.1,so[7,10]=-1.1,so[7,11]=0.9,so[7,12]=-0.9,so[7,13]=-1.0,so[7,14]=0.0 so[7,15]=0.3,so[7,16]=-1.2,so[7,17]=0.7,so[7,18]=1.0,so[7,19]=0.9,so[7,20]=0.2,so[7,21]=-0.5,so[7,22]=-0.1,so[7,23]=0.6,so[7,24]=0.0,so[7,25]=1.1,so[7,26]=-1.2,so[7,27]=-0.8,so[7,28]=0.9,so[7,29]=1.2,so[7,30]=-0.4 so[8,1]=-0.3,so[8,2]=0.4,so[8,3]=0.3,so[8,4]=-1.1,so[8,5]=1.0,so[8,6]=0.7,so[8,7]=0.8,so[8,8]=0.2,so[8,9]=0.4,so[8,10]=-0.9,so[8,11]=0.1,so[8,12]=-0.6,so[8,13]=1.1,so[8,14]=-0.3 so[8,15]=0.2,so[8,16]=0.2,so[8,17]=-0.4,so[8,18]=0.5,so[8,19]=0.9,so[8,20]=-0.3,so[8,21]=1.0,so[8,22]=-0.7,so[8,23]=1.0,so[8,24]=-0.5,so[8,25]=0.0,so[8,26]=-1.2,so[8,27]=-0.6,so[8,28]=0.5,so[8,29]=-0.8,so[8,30]=0.5 so[9,1]=0.7,so[9,2]=0.2,so[9,3]=0.5,so[9,4]=-0.6,so[9,5]=0.4,so[9,6]=0.8,so[9,7]=1.1,so[9,8]=-0.8,so[9,9]=-1.2,so[9,10]=-1.0,so[9,11]=-0.5,so[9,12]=0.4,so[9,13]=0.8,so[9,14]=-0.1 so[9,15]=-0.2,so[9,16]=-0.5,so[9,17]=-0.6,so[9,18]=-0.4,so[9,19]=-0.3,so[9,20]=0.7,so[9,21]=0.6,so[9,22]=1.1,so[9,23]=0.3,so[9,24]=0.6,so[9,25]=0.0,so[9,26]=-1.2,so[9,27]=-0.5,so[9,28]=-0.9,so[9,29]=-1.1,so[9,30]=0.8 so[10,1]=-0.1,so[10,2]=-1.0,so[10,3]=-0.4,so[10,4]=-0.5,so[10,5]=1.0,so[10,6]=-0.6,so[10,7]=1.1,so[10,8]=1.2,so[10,9]=-0.9,so[10,10]=-0.4,so[10,11]=-1.2,so[10,12]=0.7,so[10,13]=-0.1,so[10,14]=0.8 so[10,15]=-0.5,so[10,16]=-0.8,so[10,17]=-0.9,so[10,18]=-0.9,so[10,19]=0.6,so[10,20]=1.1,so[10,21]=0.0,so[10,22]=1.0,so[10,23]=0.3,so[10,24]=-0.9,so[10,25]=0.5,so[10,26]=-1.1,so[10,27]=-0.3,so[10,28]=-0.8,so[10,29]=-0.9,so[10,30]=-0.6 so[11,1]=0.4,so[11,2]=-1.0,so[11,3]=0.8,so[11,4]=1.0,so[11,5]=1.1,so[11,6]=-0.5,so[11,7]=-0.1,so[11,8]=-0.8,so[11,9]=-1.1,so[11,10]=-0.4,so[11,11]=0.5,so[11,12]=-0.6,so[11,13]=-0.2,so[11,14]=-0.5 so[11,15]=-0.3,so[11,16]=-0.7,so[11,17]=0.3,so[11,18]=1.2,so[11,19]=1.2,so[11,20]=0.1,so[11,21]=1.2,so[11,22]=0.1,so[11,23]=-0.5,so[11,24]=0.3,so[11,25]=-0.9,so[11,26]=0.2,so[11,27]=-1.2,so[11,28]=-0.8,so[11,29]=0.3,so[11,30]=1.0 so[12,1]=-0.3,so[12,2]=-0.4,so[12,3]=-0.2,so[12,4]=-0.8,so[12,5]=-0.2,so[12,6]=-0.1,so[12,7]=-0.4,so[12,8]=0.2,so[12,9]=0.3,so[12,10]=0.4,so[12,11]=0.8,so[12,12]=1.0,so[12,13]=-0.5,so[12,14]=-0.5,so[12,15]=-0.7 so[12,16]=-1.1,so[12,17]=-0.1,so[12,18]=-0.1,so[12,19]=-1.1,so[12,20]=0.5,so[12,21]=-0.2,so[12,22]=0.0,so[12,23]=-0.5,so[12,24]=-1.0,so[12,25]=-0.6,so[12,26]=1.1,so[12,27]=0.2,so[12,28]=-0.1,so[12,29]=-0.6,so[12,30]=0.3 so[13,1]=-0.5,so[13,2]=0.2,so[13,3]=0.3,so[13,4]=0.2,so[13,5]=-0.5,so[13,6]=-1.0,so[13,7]=1.1,so[13,8]=0.6,so[13,9]=-0.1,so[13,10]=-1.2,so[13,11]=0.3,so[13,12]=-0.9,so[13,13]=-1.2,so[13,14]=-1.2,so[13,15]=0.7 so[13,16]=0.1,so[13,17]=1.1,so[13,18]=0.3,so[13,19]=1.1,so[13,20]=-0.9,so[13,21]=-0.3,so[13,22]=1.0,so[13,23]=0.4,so[13,24]=1.0,so[13,25]=0.8,so[13,26]=-0.4,so[13,27]=0.7,so[13,28]=0.1,so[13,29]=-0.2,so[13,30]=-0.5 so[14,1]=0.4,so[14,2]=0.7,so[14,3]=0.9,so[14,4]=0.3,so[14,5]=-1.1,so[14,6]=0.9,so[14,7]=0.5,so[14,8]=0.7,so[14,9]=0.9,so[14,10]=-1.2,so[14,11]=-0.2,so[14,12]=-0.8,so[14,13]=-0.9,so[14,14]=0.7,so[14,15]=0.6 so[14,16]=0.1,so[14,17]=-1.1,so[14,18]=-0.5,so[14,19]=-0.3,so[14,20]=0.6,so[14,21]=0.5,so[14,22]=1.2,so[14,23]=-1.0,so[14,24]=0.0,so[14,25]=0.9,so[14,26]=-1.1,so[14,27]=-0.2,so[14,28]=0.2,so[14,29]=-0.7,so[14,30]=0.9 so[15,1]=0.4,so[15,2]=0.5,so[15,3]=-0.6,so[15,4]=0.3,so[15,5]=-0.1,so[15,6]=-0.6,so[15,7]=1.0,so[15,8]=0.2,so[15,9]=0.7,so[15,10]=-0.3,so[15,11]=-0.9,so[15,12]=1.1,so[15,13]=1.2,so[15,14]=0.5,so[15,15]=0.1 so[15,16]=-0.7,so[15,17]=0.6,so[15,18]=0.4,so[15,19]=-1.1,so[15,20]=-1.1,so[15,21]=1.0,so[15,22]=-0.8,so[15,23]=-0.8,so[15,24]=0.6,so[15,25]=-0.5,so[15,26]=-0.7,so[15,27]=-0.6,so[15,28]=0.9,so[15,29]=0.9,so[15,30]=0.4 so[16,1]=0.3,so[16,2]=-1.1,so[16,3]=0.4,so[16,4]=0.2,so[16,5]=-0.5,so[16,6]=0.9,so[16,7]=-0.2,so[16,8]=-1.1,so[16,9]=0.9,so[16,10]=-0.7,so[16,11]=-1.0,so[16,12]=-1.0,so[16,13]=1.2,so[16,14]=0.6,so[16,15]=0.9 so[16,16]=0.0,so[16,17]=-0.9,so[16,18]=-0.9,so[16,19]=0.0,so[16,20]=-0.3,so[16,21]=-1.1,so[16,22]=1.1,so[16,23]=0.2,so[16,24]=0.1,so[16,25]=0.2,so[16,26]=-0.7,so[16,27]=-0.1,so[16,28]=-1.0,so[16,29]=0.3,so[16,30]=-0.7 so[17,1]=-1.1,so[17,2]=-0.2,so[17,3]=-0.5,so[17,4]=1.0,so[17,5]=0.6,so[17,6]=0.0,so[17,7]=0.4,so[17,8]=-1.2,so[17,9]=-1.1,so[17,10]=0.1,so[17,11]=0.4,so[17,12]=1.2,so[17,13]=-1.0,so[17,14]=-0.1,so[17,15]=0.8 so[17,16]=0.1,so[17,17]=0.4,so[17,18]=-0.2,so[17,19]=0.7,so[17,20]=-0.8,so[17,21]=-0.9,so[17,22]=0.9,so[17,23]=-0.6,so[17,24]=0.8,so[17,25]=-0.5,so[17,26]=0.4,so[17,27]=0.9,so[17,28]=-0.5,so[17,29]=0.3,so[17,30]=-0.1 so[18,1]=-0.4,so[18,2]=-0.2,so[18,3]=0.7,so[18,4]=1.2,so[18,5]=0.8,so[18,6]=-1.2,so[18,7]=1.0,so[18,8]=-0.9,so[18,9]=-0.9,so[18,10]=-1.1,so[18,11]=-0.7,so[18,12]=0.0,so[18,13]=0.2,so[18,14]=-0.5,so[18,15]=0.8 so[18,16]=-1.0,so[18,17]=-0.9,so[18,18]=0.3,so[18,19]=-0.4,so[18,20]=1.2,so[18,21]=1.2,so[18,22]=1.2,so[18,23]=-0.3,so[18,24]=0.3,so[18,25]=0.5,so[18,26]=-0.5,so[18,27]=1.0,so[18,28]=0.5,so[18,29]=-0.9,so[18,30]=0.1 so[19,1]=-0.8,so[19,2]=0.9,so[19,3]=0.2,so[19,4]=-0.8,so[19,5]=0.4,so[19,6]=-0.8,so[19,7]=0.6,so[19,8]=0.1,so[19,9]=1.1,so[19,10]=0.6,so[19,11]=0.4,so[19,12]=0.8,so[19,13]=-0.2,so[19,14]=-0.6,so[19,15]=0.3 so[19,16]=-1.0,so[19,17]=-0.9,so[19,18]=-1.1,so[19,19]=-0.5,so[19,20]=0.9,so[19,21]=-0.8,so[19,22]=-1.2,so[19,23]=-1.2,so[19,24]=-0.9,so[19,25]=-1.2,so[19,26]=-0.2,so[19,27]=1.2,so[19,28]=0.8,so[19,29]=0.5,so[19,30]=0.7 so[20,1]=0.7,so[20,2]=-1.0,so[20,3]=-0.3,so[20,4]=0.5,so[20,5]=0.1,so[20,6]=0.3,so[20,7]=-0.7,so[20,8]=1.1,so[20,9]=-1.2,so[20,10]=-0.3,so[20,11]=1.2,so[20,12]=1.2,so[20,13]=-0.7,so[20,14]=1.0,so[20,15]=0.8 so[20,16]=-0.5,so[20,17]=1.0,so[20,18]=-0.6,so[20,19]=0.4,so[20,20]=-1.1,so[20,21]=-0.4,so[20,22]=1.1,so[20,23]=-1.2,so[20,24]=0.7,so[20,25]=0.9,so[20,26]=1.2,so[20,27]=1.0,so[20,28]=0.1,so[20,29]=0.3,so[20,30]=-0.6 so[21,1]=-0.7,so[21,2]=0.7,so[21,3]=0.8,so[21,4]=0.2,so[21,5]=1.0,so[21,6]=-0.8,so[21,7]=0.6,so[21,8]=-1.1,so[21,9]=-0.8,so[21,10]=1.1,so[21,11]=0.0,so[21,12]=1.1,so[21,13]=0.9,so[21,14]=0.9,so[21,15]=0.9 so[21,16]=0.1,so[21,17]=-0.6,so[21,18]=0.9,so[21,19]=0.1,so[21,20]=1.2,so[21,21]=0.5,so[21,22]=1.0,so[21,23]=1.2,so[21,24]=0.4,so[21,25]=-0.5,so[21,26]=0.9,so[21,27]=-0.5,so[21,28]=-1.0,so[21,29]=-0.3,so[21,30]=0.0 so[22,1]=0.2,so[22,2]=-0.3,so[22,3]=-0.8,so[22,4]=-0.4,so[22,5]=-0.1,so[22,6]=1.1,so[22,7]=0.1,so[22,8]=1.0,so[22,9]=0.1,so[22,10]=-1.1,so[22,11]=-1.1,so[22,12]=0.0,so[22,13]=0.8,so[22,14]=-0.3,so[22,15]=-0.8 so[22,16]=-0.9,so[22,17]=-0.1,so[22,18]=-0.5,so[22,19]=-1.1,so[22,20]=1.0,so[22,21]=-0.7,so[22,22]=0.0,so[22,23]=0.3,so[22,24]=-0.6,so[22,25]=0.0,so[22,26]=0.6,so[22,27]=-0.1,so[22,28]=-1.1,so[22,29]=-0.8,so[22,30]=-0.4 so[23,1]=-1.2,so[23,2]=0.5,so[23,3]=-0.5,so[23,4]=0.0,so[23,5]=0.4,so[23,6]=0.7,so[23,7]=0.3,so[23,8]=-0.3,so[23,9]=0.5,so[23,10]=1.0,so[23,11]=-0.7,so[23,12]=0.5,so[23,13]=0.1,so[23,14]=-1.2,so[23,15]=0.2 so[23,16]=-0.3,so[23,17]=0.8,so[23,18]=0.4,so[23,19]=-0.3,so[23,20]=-0.6,so[23,21]=1.1,so[23,22]=-1.0,so[23,23]=0.2,so[23,24]=0.9,so[23,25]=-0.4,so[23,26]=1.2,so[23,27]=-0.6,so[23,28]=1.2,so[23,29]=0.5,so[23,30]=0.8 so[24,1]=-1.1,so[24,2]=0.3,so[24,3]=0.4,so[24,4]=0.5,so[24,5]=0.7,so[24,6]=0.4,so[24,7]=0.8,so[24,8]=0.4,so[24,9]=0.4,so[24,10]=-0.7,so[24,11]=-0.7,so[24,12]=0.5,so[24,13]=-1.1,so[24,14]=0.3,so[24,15]=0.6 so[24,16]=-0.6,so[24,17]=-0.2,so[24,18]=0.9,so[24,19]=-1.2,so[24,20]=-0.6,so[24,21]=0.5,so[24,22]=-0.8,so[24,23]=1.1,so[24,24]=0.3,so[24,25]=0.9,so[24,26]=1.2,so[24,27]=-0.1,so[24,28]=0.9,so[24,29]=-0.6,so[24,30]=-0.9 so[25,1]=-0.3,so[25,2]=-0.1,so[25,3]=0.2,so[25,4]=0.9,so[25,5]=1.1,so[25,6]=1.1,so[25,7]=0.0,so[25,8]=0.2,so[25,9]=0.3,so[25,10]=0.3,so[25,11]=0.6,so[25,12]=-0.9,so[25,13]=0.1,so[25,14]=-1.0,so[25,15]=0.2 so[25,16]=0.6,so[25,17]=-0.3,so[25,18]=1.2,so[25,19]=0.8,so[25,20]=0.7,so[25,21]=0.3,so[25,22]=1.2,so[25,23]=-0.6,so[25,24]=-1.2,so[25,25]=-0.1,so[25,26]=0.6,so[25,27]=0.9,so[25,28]=-1.0,so[25,29]=-1.1,so[25,30]=0.0 so[26,1]=1.1,so[26,2]=-0.1,so[26,3]=-0.4,so[26,4]=-1.2,so[26,5]=0.6,so[26,6]=0.9,so[26,7]=-1.1,so[26,8]=-1.0,so[26,9]=-0.9,so[26,10]=0.6,so[26,11]=1.1,so[26,12]=0.9,so[26,13]=0.0,so[26,14]=1.2,so[26,15]=1.2 so[26,16]=0.2,so[26,17]=-0.1,so[26,18]=0.9,so[26,19]=0.3,so[26,20]=-1.0,so[26,21]=0.0,so[26,22]=1.1,so[26,23]=-0.2,so[26,24]=0.9,so[26,25]=-1.2,so[26,26]=0.2,so[26,27]=0.8,so[26,28]=-1.2,so[26,29]=-0.9,so[26,30]=0.7 so[27,1]=-0.6,so[27,2]=-1.2,so[27,3]=0.5,so[27,4]=-0.9,so[27,5]=-1.0,so[27,6]=-0.8,so[27,7]=-0.4,so[27,8]=-0.9,so[27,9]=0.0,so[27,10]=-1.0,so[27,11]=-0.8,so[27,12]=-0.6,so[27,13]=0.3,so[27,14]=1.0,so[27,15]=-1.2 so[27,16]=-0.4,so[27,17]=-1.1,so[27,18]=-0.1,so[27,19]=1.1,so[27,20]=0.7,so[27,21]=-0.2,so[27,22]=1.0,so[27,23]=0.2,so[27,24]=0.8,so[27,25]=0.7,so[27,26]=-1.1,so[27,27]=1.2,so[27,28]=-1.0,so[27,29]=0.9,so[27,30]=-0.4 so[28,1]=-0.2,so[28,2]=-1.0,so[28,3]=0.8,so[28,4]=0.5,so[28,5]=-1.0,so[28,6]=0.6,so[28,7]=0.9,so[28,8]=-0.2,so[28,9]=0.1,so[28,10]=-1.1,so[28,11]=-1.2,so[28,12]=-0.5,so[28,13]=0.7,so[28,14]=-0.1,so[28,15]=-0.4 so[28,16]=-0.4,so[28,17]=-0.4,so[28,18]=-0.7,so[28,19]=0.9,so[28,20]=0.3,so[28,21]=-1.2,so[28,22]=-0.4,so[28,23]=-0.1,so[28,24]=1.2,so[28,25]=1.0,so[28,26]=-1.2,so[28,27]=1.2,so[28,28]=-0.8,so[28,29]=-0.5,so[28,30]=0.4 so[29,1]=-1.0,so[29,2]=-1.1,so[29,3]=0.5,so[29,4]=-0.2,so[29,5]=1.0,so[29,6]=0.0,so[29,7]=0.1,so[29,8]=1.0,so[29,9]=-0.9,so[29,10]=0.4,so[29,11]=-0.6,so[29,12]=-1.2,so[29,13]=-0.9,so[29,14]=-1.2,so[29,15]=0.9 so[29,16]=1.1,so[29,17]=0.9,so[29,18]=-0.5,so[29,19]=-0.3,so[29,20]=-1.0,so[29,21]=-0.3,so[29,22]=0.9,so[29,23]=-0.5,so[29,24]=-1.1,so[29,25]=-1.2,so[29,26]=-0.7,so[29,27]=0.7,so[29,28]=1.2,so[29,29]=1.0,so[29,30]=-0.7 so[30,1]=-1.0,so[30,2]=0.9,so[30,3]=0.4,so[30,4]=1.1,so[30,5]=-1.1,so[30,6]=-0.9,so[30,7]=0.8,so[30,8]=0.4,so[30,9]=1.1,so[30,10]=0.0,so[30,11]=-0.5,so[30,12]=-0.5,so[30,13]=-0.3,so[30,14]=-1.2,so[30,15]=0.9 so[30,16]=-1.2,so[30,17]=-0.8,so[30,18]=1.1,so[30,19]=-1.0,so[30,20]=0.7,so[30,21]=-1.0,so[30,22]=1.0,so[30,23]=0.5,so[30,24]=-0.8,so[30,25]=1.1,so[30,26]=1.2,so[30,27]=-0.1,so[30,28]=0.8,so[30,29]=-1.2,so[30,30]=-0.8 so[31,1]=0.1,so[31,2]=0.7,so[31,3]=-0.8,so[31,4]=-1.2,so[31,5]=1.2,so[31,6]=0.8,so[31,7]=-0.3,so[31,8]=0.6,so[31,9]=0.8,so[31,10]=-0.2,so[31,11]=0.9,so[31,12]=-1.1,so[31,13]=-1.0,so[31,14]=0.4,so[31,15]=1.0 so[31,16]=-0.3,so[31,17]=-0.1,so[31,18]=-1.0,so[31,19]=0.0,so[31,20]=0.8,so[31,21]=-0.9,so[31,22]=-0.4,so[31,23]=-0.5,so[31,24]=-0.1,so[31,25]=0.7,so[31,26]=0.1,so[31,27]=0.7,so[31,28]=-0.5,so[31,29]=-0.3,so[31,30]=-1.0 so[32,1]=1.1,so[32,2]=-0.6,so[32,3]=-1.1,so[32,4]=-0.2,so[32,5]=-0.7,so[32,6]=0.7,so[32,7]=0.3,so[32,8]=0.9,so[32,9]=-0.4,so[32,10]=-0.4,so[32,11]=-0.3,so[32,12]=-0.7,so[32,13]=0.7,so[32,14]=0.0,so[32,15]=-0.8 so[32,16]=0.7,so[32,17]=0.1,so[32,18]=-1.0,so[32,19]=-0.5,so[32,20]=0.2,so[32,21]=-0.6,so[32,22]=0.3,so[32,23]=0.8,so[32,24]=-0.3,so[32,25]=0.7,so[32,26]=-0.1,so[32,27]=1.1,so[32,28]=0.8,so[32,29]=0.7,so[32,30]=-0.2 so[33,1]=0.9,so[33,2]=1.1,so[33,3]=0.8,so[33,4]=-0.7,so[33,5]=-0.5,so[33,6]=0.6,so[33,7]=-0.8,so[33,8]=0.3,so[33,9]=1.0,so[33,10]=-0.7,so[33,11]=0.5,so[33,12]=0.7,so[33,13]=0.6,so[33,14]=0.5,so[33,15]=0.5,so[33,16]=-1.0,so[33,17]=0.5,so[33,18]=-0.5,so[33,19]=-1.1,so[33,20]=-0.5,so[33,21]=0.7,so[33,22]=0.9,so[33,23]=-0.2,so[33,24]=-1.0,so[33,25]=1.2,so[33,26]=1.2,so[33,27]=1.2,so[33,28]=0.7,so[33,29]=-0.4,so[33,30]=-1.0 so[34,1]=-0.9,so[34,2]=-0.6,so[34,3]=-0.9,so[34,4]=1.0,so[34,5]=-0.9,so[34,6]=0.8,so[34,7]=1.1,so[34,8]=-1.2,so[34,9]=0.4,so[34,10]=-0.8,so[34,11]=1.0,so[34,12]=-0.4,so[34,13]=-1.1,so[34,14]=-1.1,so[34,15]=0.4,so[34,16]=-0.3,so[34,17]=0.3,so[34,18]=-0.7,so[34,19]=0.1,so[34,20]=0.0,so[34,21]=0.0,so[34,22]=-0.2,so[34,23]=0.6,so[34,24]=0.3,so[34,25]=0.9,so[34,26]=1.0,so[34,27]=0.8,so[34,28]=1.1,so[34,29]=-1.1,so[34,30]=0.2 so[35,1]=-0.3,so[35,2]=-1.1,so[35,3]=0.1,so[35,4]=0.9,so[35,5]=0.0,so[35,6]=-0.2,so[35,7]=-1.1,so[35,8]=-0.4,so[35,9]=0.9,so[35,10]=0.8,so[35,11]=0.3,so[35,12]=1.2,so[35,13]=0.5,so[35,14]=0.4,so[35,15]=0.1,so[35,16]=0.1,so[35,17]=-0.1,so[35,18]=-0.9,so[35,19]=1.1,so[35,20]=0.3,so[35,21]=0.1,so[35,22]=0.1,so[35,23]=0.4,so[35,24]=0.8,so[35,25]=-0.4,so[35,26]=-1.0,so[35,27]=0.0,so[35,28]=1.0,so[35,29]=0.0,so[35,30]=-0.4 so[36,1]=0.3,so[36,2]=0.6,so[36,3]=0.5,so[36,4]=-0.9,so[36,5]=-0.6,so[36,6]=-1.0,so[36,7]=0.6,so[36,8]=1.1,so[36,9]=-1.2,so[36,10]=-1.1,so[36,11]=-0.1,so[36,12]=0.9,so[36,13]=0.8,so[36,14]=1.1,so[36,15]=0.3,so[36,16]=0.0,so[36,17]=-0.2,so[36,18]=0.8,so[36,19]=0.0,so[36,20]=1.0,so[36,21]=0.1,so[36,22]=0.0,so[36,23]=0.1,so[36,24]=-0.9,so[36,25]=1.0,so[36,26]=-0.1,so[36,27]=-0.6,so[36,28]=-0.7,so[36,29]=-0.2,so[36,30]=1.2 so[37,1]=0.1,so[37,2]=-0.4,so[37,3]=-0.3,so[37,4]=0.7,so[37,5]=-0.7,so[37,6]=-0.2,so[37,7]=0.3,so[37,8]=-1.2,so[37,9]=1.0,so[37,10]=-0.3,so[37,11]=0.4,so[37,12]=-0.3,so[37,13]=-0.7,so[37,14]=0.0,so[37,15]=0.4,so[37,16]=0.5,so[37,17]=0.9,so[37,18]=-0.7,so[37,19]=0.8,so[37,20]=-0.8,so[37,21]=-0.4,so[37,22]=-0.4,so[37,23]=-0.4,so[37,24]=0.8,so[37,25]=1.2,so[37,26]=-1.1,so[37,27]=-0.4,so[37,28]=0.6,so[37,29]=-0.4,so[37,30]=-0.7 so[38,1]=-0.3,so[38,2]=0.7,so[38,3]=0.0,so[38,4]=-0.1,so[38,5]=0.3,so[38,6]=0.3,so[38,7]=0.8,so[38,8]=-0.9,so[38,9]=0.4,so[38,10]=-0.8,so[38,11]=0.4,so[38,12]=-0.3,so[38,13]=-0.2,so[38,14]=-0.7,so[38,15]=0.5,so[38,16]=0.8,so[38,17]=-1.2,so[38,18]=-0.9,so[38,19]=1.0,so[38,20]=0.9,so[38,21]=-0.3,so[38,22]=0.4,so[38,23]=1.1,so[38,24]=-1.2,so[38,25]=-1.0,so[38,26]=0.2,so[38,27]=-1.0,so[38,28]=0.2,so[38,29]=-0.5,so[38,30]=1.1 so[39,1]=-1.1,so[39,2]=0.8,so[39,3]=0.8,so[39,4]=-0.4,so[39,5]=-0.6,so[39,6]=0.6,so[39,7]=-1.2,so[39,8]=-1.2,so[39,9]=0.6,so[39,10]=0.8,so[39,11]=-0.8,so[39,12]=-0.9,so[39,13]=0.0,so[39,14]=1.0,so[39,15]=0.3,so[39,16]=-0.1,so[39,17]=0.2,so[39,18]=1.2,so[39,19]=0.5,so[39,20]=0.9,so[39,21]=0.3,so[39,22]=0.6,so[39,23]=-0.2,so[39,24]=0.8,so[39,25]=-1.2,so[39,26]=-0.9,so[39,27]=-0.1,so[39,28]=-0.9,so[39,29]=-0.2,so[39,30]=0.6 so[40,1]=0.0,so[40,2]=0.3,so[40,3]=-1.0,so[40,4]=1.1,so[40,5]=-0.7,so[40,6]=-1.0,so[40,7]=-0.3,so[40,8]=0.3,so[40,9]=0.2,so[40,10]=-1.2,so[40,11]=-0.1,so[40,12]=0.0,so[40,13]=0.9,so[40,14]=0.7,so[40,15]=0.9,so[40,16]=-0.4,so[40,17]=0.1,so[40,18]=-0.5,so[40,19]=-1.0,so[40,20]=-0.7,so[40,21]=0.1,so[40,22]=-1.1,so[40,23]=-0.8,so[40,24]=-1.0,so[40,25]=-0.8,so[40,26]=1.2,so[40,27]=0.2,so[40,28]=1.0,so[40,29]=-0.6,so[40,30]=-1.0 so[41,1]=0.8,so[41,2]=-0.5,so[41,3]=0.9,so[41,4]=-1.1,so[41,5]=1.1,so[41,6]=-1.2,so[41,7]=-1.1,so[41,8]=-0.8,so[41,9]=0.1,so[41,10]=-0.4,so[41,11]=0.0,so[41,12]=0.5,so[41,13]=0.2,so[41,14]=-0.5,so[41,15]=-0.5,so[41,16]=1.0,so[41,17]=-0.7,so[41,18]=0.4,so[41,19]=1.2,so[41,20]=0.1,so[41,21]=0.8,so[41,22]=-0.8,so[41,23]=-0.4,so[41,24]=1.0,so[41,25]=-0.9,so[41,26]=-0.4,so[41,27]=-0.6,so[41,28]=0.3,so[41,29]=-0.8,so[41,30]=-0.3 so[42,1]=1.2,so[42,2]=-0.9,so[42,3]=0.0,so[42,4]=-0.4,so[42,5]=-1.1,so[42,6]=0.3,so[42,7]=-0.5,so[42,8]=0.4,so[42,9]=0.5,so[42,10]=0.3,so[42,11]=-1.0,so[42,12]=1.0,so[42,13]=0.4,so[42,14]=1.0,so[42,15]=0.7,so[42,16]=-0.7,so[42,17]=0.5,so[42,18]=0.6,so[42,19]=0.4,so[42,20]=0.6,so[42,21]=-0.2,so[42,22]=-0.9,so[42,23]=1.1,so[42,24]=-0.4,so[42,25]=-0.9,so[42,26]=0.5,so[42,27]=-0.4,so[42,28]=-0.5,so[42,29]=0.3,so[42,30]=-0.1 so[43,1]=1.0,so[43,2]=0.5,so[43,3]=-0.4,so[43,4]=-0.9,so[43,5]=0.8,so[43,6]=1.1,so[43,7]=-1.1,so[43,8]=-0.2,so[43,9]=0.6,so[43,10]=0.9,so[43,11]=-0.3,so[43,12]=0.4,so[43,13]=1.1,so[43,14]=1.0,so[43,15]=0.2,so[43,16]=-0.7,so[43,17]=-0.2,so[43,18]=0.8,so[43,19]=-1.0,so[43,20]=0.5,so[43,21]=1.1,so[43,22]=0.6,so[43,23]=0.1,so[43,24]=0.6,so[43,25]=-0.3,so[43,26]=1.0,so[43,27]=-0.2,so[43,28]=-1.0,so[43,29]=0.7,so[43,30]=-0.8 so[44,1]=-0.5,so[44,2]=-1.2,so[44,3]=0.3,so[44,4]=-1.2,so[44,5]=0.3,so[44,6]=-0.5,so[44,7]=1.2,so[44,8]=-1.0,so[44,9]=-0.4,so[44,10]=-0.5,so[44,11]=-1.2,so[44,12]=0.8,so[44,13]=1.2,so[44,14]=-0.5,so[44,15]=1.1,so[44,16]=0.4,so[44,17]=0.7,so[44,18]=0.9,so[44,19]=-0.9,so[44,20]=-0.9,so[44,21]=0.5,so[44,22]=-1.1,so[44,23]=0.4,so[44,24]=0.4,so[44,25]=0.5,so[44,26]=-0.1,so[44,27]=-1.2,so[44,28]=0.2,so[44,29]=-0.8,so[44,30]=-0.6 so[45,1]=0.0,so[45,2]=0.1,so[45,3]=1.2,so[45,4]=-0.4,so[45,5]=0.5,so[45,6]=0.4,so[45,7]=-1.1,so[45,8]=0.1,so[45,9]=-0.2,so[45,10]=0.0,so[45,11]=-1.1,so[45,12]=0.4,so[45,13]=0.7,so[45,14]=0.3,so[45,15]=-1.1,so[45,16]=0.5,so[45,17]=-1.2,so[45,18]=-1.0,so[45,19]=-1.1,so[45,20]=-1.2,so[45,21]=0.2,so[45,22]=0.8,so[45,23]=0.1,so[45,24]=0.0,so[45,25]=0.3,so[45,26]=0.5,so[45,27]=0.6,so[45,28]=0.2,so[45,29]=-0.7,so[45,30]=0.4 so[46,1]=1.2,so[46,2]=0.0,so[46,3]=0.7,so[46,4]=-0.7,so[46,5]=-0.9,so[46,6]=0.3,so[46,7]=-1.1,so[46,8]=1.1,so[46,9]=-0.2,so[46,10]=-0.4,so[46,11]=0.0,so[46,12]=-0.5,so[46,13]=0.8,so[46,14]=-1.2,so[46,15]=-1.1,so[46,16]=-0.2,so[46,17]=-0.5,so[46,18]=-0.1,so[46,19]=0.6,so[46,20]=-0.6,so[46,21]=-0.5,so[46,22]=0.7,so[46,23]=1.2,so[46,24]=0.8,so[46,25]=0.5,so[46,26]=0.0,so[46,27]=1.1,so[46,28]=0.8,so[46,29]=0.4,so[46,30]=-0.9 so[47,1]=-0.1,so[47,2]=-0.8,so[47,3]=0.4,so[47,4]=0.6,so[47,5]=-0.4,so[47,6]=1.1,so[47,7]=0.2,so[47,8]=-0.1,so[47,9]=-0.1,so[47,10]=1.2,so[47,11]=0.2,so[47,12]=-1.2,so[47,13]=1.1,so[47,14]=-1.2,so[47,15]=1.2,so[47,16]=-0.2,so[47,17]=0.7,so[47,18]=-0.3,so[47,19]=0.4,so[47,20]=-0.8,so[47,21]=-0.5,so[47,22]=0.4,so[47,23]=0.7,so[47,24]=0.4,so[47,25]=1.2,so[47,26]=-0.2,so[47,27]=1.0,so[47,28]=0.6,so[47,29]=0.4,so[47,30]=-0.3 so[48,1]=1.1,so[48,2]=-0.4,so[48,3]=0.4,so[48,4]=0.8,so[48,5]=0.0,so[48,6]=-0.4,so[48,7]=-1.1,so[48,8]=-1.1,so[48,9]=-0.2,so[48,10]=-1.2,so[48,11]=-0.3,so[48,12]=-0.7,so[48,13]=1.2,so[48,14]=0.4,so[48,15]=0.2,so[48,16]=0.0,so[48,17]=0.5,so[48,18]=-0.5,so[48,19]=0.9,so[48,20]=-0.9,so[48,21]=-0.5,so[48,22]=0.7,so[48,23]=0.7,so[48,24]=-1.0,so[48,25]=0.3,so[48,26]=-0.2,so[48,27]=0.2,so[48,28]=-1.0,so[48,29]=0.3,so[48,30]=-0.3 so[49,1]=1.2,so[49,2]=0.5,so[49,3]=-0.2,so[49,4]=-1.0,so[49,5]=-0.1,so[49,6]=-0.6,so[49,7]=0.3,so[49,8]=-0.1,so[49,9]=0.6,so[49,10]=-0.9,so[49,11]=-0.5,so[49,12]=-0.7,so[49,13]=0.7,so[49,14]=0.7,so[49,15]=1.1,so[49,16]=-1.2,so[49,17]=0.4,so[49,18]=-0.2,so[49,19]=-0.9,so[49,20]=0.4,so[49,21]=-0.4,so[49,22]=-0.7,so[49,23]=-0.5,so[49,24]=-1.1,so[49,25]=0.8,so[49,26]=-0.3,so[49,27]=0.9,so[49,28]=-1.1,so[49,29]=-0.4,so[49,30]=0.4 so[50,1]=-0.1,so[50,2]=0.3,so[50,3]=-0.1,so[50,4]=-0.5,so[50,5]=0.0,so[50,6]=0.9,so[50,7]=-0.7,so[50,8]=-0.5,so[50,9]=-1.2,so[50,10]=-0.2,so[50,11]=-1.0,so[50,12]=1.2,so[50,13]=0.9,so[50,14]=0.4,so[50,15]=0.2,so[50,16]=-0.9,so[50,17]=0.3,so[50,18]=0.7,so[50,19]=-0.4,so[50,20]=0.7,so[50,21]=-0.4,so[50,22]=1.2,so[50,23]=-0.2,so[50,24]=-1.2,so[50,25]=0.4,so[50,26]=-0.4,so[50,27]=0.4,so[50,28]=-1.0,so[50,29]=-0.3,so[50,30]=0.6 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float ppz = @ppz float pxx = 0 float pyy = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x pyy = y x = x + 0.1*(so[@sd,1] + so[@sd,2]*x + so[@sd,3]*x*x + so[@sd,4]*x*y \ + so[@sd,5]*x*ppz + so[@sd,6]*y + so[@sd,7]*y*y + \ so[@sd,8]*y*ppz + so[@sd,9]*ppz + so[@sd,10]*ppz*ppz) y = y + 0.1*(so[@sd,11] + so[@sd,12]*pxx + so[@sd,13]*pxx*pxx + so[@sd,14]*pxx*y \ + so[@sd,15]*pxx*ppz + so[@sd,16]*y + so[@sd,17]*y*y + \ so[@sd,18]*y*ppz + so[@sd,19]*ppz + so[@sd,20]*ppz*ppz) ppz = ppz + 0.1*(so[@sd,21] + so[@sd,22]*pxx + so[@sd,23]*pxx*pxx + so[@sd,24]*pxx*pyy + \ so[@sd,25]*pxx*ppz + so[@sd,26]*pyy + so[@sd,27]*pyy*pyy + \ so[@sd,28]*pyy*ppz + so[@sd,29]*ppz + so[@sd,30]*ppz*ppz) att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y) + ppz*@pw) float d = @distscale*|pz-(x + sgn*flip(y) + ppz*@pw)| return d endfunc private: float so[51,31] default: title = "Sprott3D_ODE" heading text="Strange attractors from simultaneous ordinary differential \ equations using Euler's finite difference method to calculate." endheading heading text="Sprott 3D ODE quadratic attractors" endheading heading text=" x -> x + 0.1*(Quadratic in x, y and z)" endheading heading text=" y -> y + 0.1*(Quadratic in x, y and z)" endheading heading text=" z -> z + 0.1*(Quadratic in x, y and z)" endheading int param v_trapshapesprott3d_ode caption = "Version (Trap Shape Sprott3D_ODE)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesprott3d_ode < 101 endparam param sd caption = "Sprott selector" default = 0 enum = "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" \ "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" \ "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" \ "45" "46" "47" "48" "49" "50" hint = "Each Sprott selector uses a different strange attractor." endparam heading text = "'Initialize Height' sets the starting z value for the attractor." endheading float param ppz caption = "Initialize Height" default = 0.5 endparam heading text = "'Height weight' determines the weight of the final z value which is added \ to the trap distance." endheading complex param pw caption = "Height weight" default = (0.5,0) endparam float param distscale caption = "Distance scale" default = 0.1 endparam float param s caption = "Attractor scale" default = 2.0 endparam int param max_att_iterations caption = "Attractor iterations" default = 50 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeSprottQuad(common.ulb:TrapShape) { ; This shape uses a Sprott strange attractor.
;

; The Sprott attractors were developed by Julien C. Sprott, and are ; based upon polynomials and linear differential equations of polynomials. public: import "common.ulb" ; Constructor func REB_TrapShapeSprottQuad(Generic pparent) TrapShape.TrapShape(pparent) qd[0,1]=1,qd[0,2]=-1.1,qd[0,3]=-0.2,qd[0,4]=-0.1,qd[0,5]=-0.4,qd[0,6]=0.1,qd[0,7]=-0.3,qd[0,8]=0.8,qd[0,9]=-0.1,qd[0,10]=0.3,qd[0,11]=-1,qd[0,12]=-0.9 qd[1,1]=0.9,qd[1,2]=-0.1,qd[1,3]=0.2,qd[1,4]=0.5,qd[1,5]=-0.6,qd[1,6]=-1.0,qd[1,7]=-0.9,qd[1,8]=-0.8,qd[1,9]=1.0,qd[1,10]=-0.2,qd[1,11]=0.4,qd[1,12]=-0.2 qd[2,1]=-0.8,qd[2,2]=1.1,qd[2,3]=0.5,qd[2,4]=1.1,qd[2,5]=1.1,qd[2,6]=1.1,qd[2,7]=-0.6,qd[2,8]=-0.1,qd[2,9]=-0.6,qd[2,10]=-0.1,qd[2,11]=0.2,qd[2,12]=0.5 qd[3,1]=-0.8,qd[3,2]=-0.7,qd[3,3]=0.4,qd[3,4]=0.8,qd[3,5]=0.4,qd[3,6]=1.1,qd[3,7]=0.9,qd[3,8]=0.9,qd[3,9]=0.4,qd[3,10]=0.6,qd[3,11]=0.9,qd[3,12]=0.1 qd[4,1]=0.9,qd[4,2]=0.5,qd[4,3]=-1.2,qd[4,4]=0.0,qd[4,5]=-0.3,qd[4,6]=0.0,qd[4,7]=0.2,qd[4,8]=0.4,qd[4,9]=0.9,qd[4,10]=-0.1,qd[4,11]=-1.1,qd[4,12]=-0.1 qd[5,1]=0.6,qd[5,2]=-0.1,qd[5,3]=-0.5,qd[5,4]=-1.2,qd[5,5]=-0.3,qd[5,6]=-0.6,qd[5,7]=0.8,qd[5,8]=0.4,qd[5,9]=-0.1,qd[5,10]=1.0,qd[5,11]=-0.8,qd[5,12]=-1.0 qd[6,1]=-0.8,qd[6,2]=0.5,qd[6,3]=0.5,qd[6,4]=-0.7,qd[6,5]=-0.9,qd[6,6]=1.0,qd[6,7]=-0.1,qd[6,8]=-0.4,qd[6,9]=1.1,qd[6,10]=-0.4,qd[6,11]=0.0,qd[6,12]=-0.3 qd[7,1]=-0.6,qd[7,2]=0.8,qd[7,3]=0.4,qd[7,4]=-0.8,qd[7,5]=-1.0,qd[7,6]=-1.1,qd[7,7]=-0.8,qd[7,8]=1.0,qd[7,9]=0.3,qd[7,10]=1.0,qd[7,11]=0.8,qd[7,12]=0.4 qd[8,1]=-0.9,qd[8,2]=-0.4,qd[8,3]=-1.1,qd[8,4]=-0.4,qd[8,5]=0.8,qd[8,6]=0.9,qd[8,7]=0.9,qd[8,8]=-0.2,qd[8,9]=-1.1,qd[8,10]=-0.7,qd[8,11]=-0.2,qd[8,12]=0.1 qd[9,1]=-0.2,qd[9,2]=0.8,qd[9,3]=-0.4,qd[9,4]=-0.3,qd[9,5]=-0.8,qd[9,6]=1.0,qd[9,7]=0.5,qd[9,8]=-0.9,qd[9,9]=0.9,qd[9,10]=-0.6,qd[9,11]=0.4,qd[9,12]=-0.3 qd[10,1]=0.7,qd[10,2]=-0.3,qd[10,3]=-1.1,qd[10,4]=0.5,qd[10,5]=0.3,qd[10,6]=-0.7,qd[10,7]=0.0,qd[10,8]=0.9,qd[10,9]=-0.4,qd[10,10]=0.3,qd[10,11]=0.7,qd[10,12]=0.2 qd[11,1]=1.1,qd[11,2]=-0.4,qd[11,3]=-0.1,qd[11,4]=-1.1,qd[11,5]=-0.8,qd[11,6]=-0.9,qd[11,7]=-0.7,qd[11,8]=-0.7,qd[11,9]=0.7,qd[11,10]=0.4,qd[11,11]=0.0,qd[11,12]=-0.1 qd[12,1]=-1.2,qd[12,2]=-0.1,qd[12,3]=-0.5,qd[12,4]=0.6,qd[12,5]=-1.0,qd[12,6]=-0.3,qd[12,7]=-0.6,qd[12,8]=-0.2,qd[12,9]=-0.8,qd[12,10]=-0.7,qd[12,11]=-0.4,qd[12,12]=0.1 qd[13,1]=0.2,qd[13,2]=1.0,qd[13,3]=-0.3,qd[13,4]=0.9,qd[13,5]=0.6,qd[13,6]=-0.5,qd[13,7]=0.6,qd[13,8]=1.0,qd[13,9]=-1.0,qd[13,10]=-0.1,qd[13,11]=-1.2,qd[13,12]=0.8 qd[14,1]=-0.6,qd[14,2]=-0.5,qd[14,3]=0.7,qd[14,4]=0.4,qd[14,5]=-0.7,qd[14,6]=-0.1,qd[14,7]=0.7,qd[14,8]=0.4,qd[14,9]=-0.7,qd[14,10]=1.0,qd[14,11]=0.1,qd[14,12]=-0.1 qd[15,1]=0.6,qd[15,2]=-0.3,qd[15,3]=-0.1,qd[15,4]=-1.1,qd[15,5]=-1.1,qd[15,6]=0.5,qd[15,7]=-0.1,qd[15,8]=0.1,qd[15,9]=0.7,qd[15,10]=0.9,qd[15,11]=-0.8,qd[15,12]=1.0 qd[16,1]=-0.4,qd[16,2]=-1.0,qd[16,3]=-0.7,qd[16,4]=-0.7,qd[16,5]=-1.1,qd[16,6]=-0.1,qd[16,7]=1.2,qd[16,8]=-0.5,qd[16,9]=-0.7,qd[16,10]=0.3,qd[16,11]=0.5,qd[16,12]=-0.6 qd[17,1]=-0.7,qd[17,2]=0.7,qd[17,3]=1.0,qd[17,4]=-0.5,qd[17,5]=0.7,qd[17,6]=0.3,qd[17,7]=0.8,qd[17,8]=-0.9,qd[17,9]=-0.8,qd[17,10]=-1.0,qd[17,11]=-0.6,qd[17,12]=-1.1 qd[18,1]=0.8,qd[18,2]=0.3,qd[18,3]=0.0,qd[18,4]=0.2,qd[18,5]=0.3,qd[18,6]=-0.8,qd[18,7]=-0.4,qd[18,8]=-1.2,qd[18,9]=-0.9,qd[18,10]=-1.1,qd[18,11]=-0.2,qd[18,12]=0.2 qd[19,1]=0.3,qd[19,2]=1.0,qd[19,3]=-0.4,qd[19,4]=0.9,qd[19,5]=0.3,qd[19,6]=-0.5,qd[19,7]=0.0,qd[19,8]=-1.0,qd[19,9]=-1.2,qd[19,10]=0.1,qd[19,11]=-0.9,qd[19,12]=0.0 qd[20,1]=1.2,qd[20,2]=-0.2,qd[20,3]=-0.9,qd[20,4]=1.1,qd[20,5]=0.5,qd[20,6]=-0.5,qd[20,7]=0.3,qd[20,8]=-0.5,qd[20,9]=-1.2,qd[20,10]=0.6,qd[20,11]=-0.1,qd[20,12]=-0.4 qd[21,1]=0.2,qd[21,2]=0.3,qd[21,3]=0.4,qd[21,4]=-0.1,qd[21,5]=1.2,qd[21,6]=-0.5,qd[21,7]=-0.4,qd[21,8]=-1.1,qd[21,9]=0.5,qd[21,10]=-1.2,qd[21,11]=1.2,qd[21,12]=0.3 qd[22,1]=1.1,qd[22,2]=0.4,qd[22,3]=-0.3,qd[22,4]=-0.2,qd[22,5]=0.4,qd[22,6]=-1.0,qd[22,7]=0.6,qd[22,8]=-0.4,qd[22,9]=-0.5,qd[22,10]=1.2,qd[22,11]=-0.9,qd[22,12]=1.0 qd[23,1]=-1.1,qd[23,2]=0.9,qd[23,3]=1.1,qd[23,4]=0.4,qd[23,5]=-1.2,qd[23,6]=1.0,qd[23,7]=0.3,qd[23,8]=0.3,qd[23,9]=0.3,qd[23,10]=-0.7,qd[23,11]=0.6,qd[23,12]=-0.9 qd[24,1]=-0.1,qd[24,2]=-0.4,qd[24,3]=-0.8,qd[24,4]=-0.8,qd[24,5]=0.9,qd[24,6]=-0.2,qd[24,7]=0.9,qd[24,8]=-0.2,qd[24,9]=-0.9,qd[24,10]=-0.9,qd[24,11]=-0.4,qd[24,12]=-1.2 qd[25,1]=-0.7,qd[25,2]=-0.2,qd[25,3]=-0.4,qd[25,4]=0.4,qd[25,5]=-0.9,qd[25,6]=0.9,qd[25,7]=0.3,qd[25,8]=-0.3,qd[25,9]=-1.1,qd[25,10]=-0.2,qd[25,11]=0.0,qd[25,12]=-0.4 qd[26,1]=-0.6,qd[26,2]=1.1,qd[26,3]=-0.2,qd[26,4]=0.7,qd[26,5]=-0.1,qd[26,6]=1.1,qd[26,7]=-1.2,qd[26,8]=0.0,qd[26,9]=1.1,qd[26,10]=0.3,qd[26,11]=0.7,qd[26,12]=0.8 qd[27,1]=0.1,qd[27,2]=-0.7,qd[27,3]=0.2,qd[27,4]=-0.2,qd[27,5]=0.1,qd[27,6]=1.2,qd[27,7]=-0.5,qd[27,8]=-0.9,qd[27,9]=0.5,qd[27,10]=0.4,qd[27,11]=-1.0,qd[27,12]=0.2 qd[28,1]=0.7,qd[28,2]=-0.6,qd[28,3]=-0.2,qd[28,4]=0.1,qd[28,5]=0.2,qd[28,6]=-0.2,qd[28,7]=-0.8,qd[28,8]=-0.7,qd[28,9]=0.6,qd[28,10]=1.2,qd[28,11]=0.4,qd[28,12]=1.2 qd[29,1]=-0.4,qd[29,2]=-0.1,qd[29,3]=-0.2,qd[29,4]=-0.4,qd[29,5]=-1.2,qd[29,6]=0.8,qd[29,7]=-0.7,qd[29,8]=-0.1,qd[29,9]=0.6,qd[29,10]=0.5,qd[29,11]=-0.9,qd[29,12]=0.7 qd[30,1]=-0.9,qd[30,2]=0.4,qd[30,3]=-0.6,qd[30,4]=-0.7,qd[30,5]=1.1,qd[30,6]=0.9,qd[30,7]=0.2,qd[30,8]=-1.0,qd[30,9]=0.3,qd[30,10]=1.1,qd[30,11]=0.3,qd[30,12]=0.0 qd[31,1]=-0.6,qd[31,2]=-0.4,qd[31,3]=1.1,qd[31,4]=-1.0,qd[31,5]=-0.6,qd[31,6]=1.2,qd[31,7]=0.4,qd[31,8]=0.3,qd[31,9]=-0.1,qd[31,10]=-0.8,qd[31,11]=0.9,qd[31,12]=0.1, qd[32,1]=0.2,qd[32,2]=-0.2,qd[32,3]=-0.3,qd[32,4]=-1.1,qd[32,5]=-0.3,qd[32,6]=-0.9,qd[32,7]=0.4,qd[32,8]=1.0,qd[32,9]=0.5,qd[32,10]=1.1,qd[32,11]=-0.7,qd[32,12]=-1.2 qd[33,1]=1.0,qd[33,2]=-0.8,qd[33,3]=-0.9,qd[33,4]=-0.3,qd[33,5]=-0.8,qd[33,6]=-0.1,qd[33,7]=0.3,qd[33,8]=-0.3,qd[33,9]=0.1,qd[33,10]=-0.1,qd[33,11]=0.1,qd[33,12]=-1.1 qd[34,1]=0.0,qd[34,2]=-0.9,qd[34,3]=0.0,qd[34,4]=-0.8,qd[34,5]=0.6,qd[34,6]=0.9,qd[34,7]=0.2,qd[34,8]=-0.9,qd[34,9]=-1.0,qd[34,10]=-1.2,qd[34,11]=-0.8,qd[34,12]=-1.2 qd[35,1]=0.2,qd[35,2]=0.4,qd[35,3]=-1.2,qd[35,4]=-0.6,qd[35,5]=-1.2,qd[35,6]=0.6,qd[35,7]=0.4,qd[35,8]=-1.1,qd[35,9]=1.2,qd[35,10]=-0.9,qd[35,11]=-0.4,qd[35,12]=-0.1 qd[36,1]=0.7,qd[36,2]=0.5,qd[36,3]=-1.2,qd[36,4]=-0.6,qd[36,5]=0.3,qd[36,6]=0.2,qd[36,7]=-1.2,qd[36,8]=-0.6,qd[36,9]=0.2,qd[36,10]=-0.7,qd[36,11]=-0.1,qd[36,12]=0.8 qd[37,1]=0.3,qd[37,2]=-0.3,qd[37,3]=-1.1,qd[37,4]=-1.0,qd[37,5]=0.5,qd[37,6]=-0.8,qd[37,7]=0.8,qd[37,8]=1.1,qd[37,9]=0.8,qd[37,10]=0.1,qd[37,11]=-0.9,qd[37,12]=0.1 qd[38,1]=-0.8,qd[38,2]=-1.1,qd[38,3]=-0.1,qd[38,4]=-0.5,qd[38,5]=-0.2,qd[38,6]=0.6,qd[38,7]=0.0,qd[38,8]=-0.8,qd[38,9]=-0.3,qd[38,10]=1.2,qd[38,11]=-1.0,qd[38,12]=1.1 qd[39,1]=0.5,qd[39,2]=0.3,qd[39,3]=-0.7,qd[39,4]=-0.2,qd[39,5]=-0.3,qd[39,6]=1.1,qd[39,7]=0.8,qd[39,8]=1.1,qd[39,9]=-1.0,qd[39,10]=-0.1,qd[39,11]=0.4,qd[39,12]=-0.6 qd[40,1]=-0.5,qd[40,2]=0.4,qd[40,3]=0.6,qd[40,4]=0.8,qd[40,5]=-0.3,qd[40,6]=-1.2,qd[40,7]=0.7,qd[40,8]=-0.5,qd[40,9]=-0.7,qd[40,10]=-1.0,qd[40,11]=0.1,qd[40,12]=-0.5 qd[41,1]=1.1,qd[41,2]=0.3,qd[41,3]=-1.2,qd[41,4]=1.0,qd[41,5]=0.7,qd[41,6]=-1.2,qd[41,7]=0.8,qd[41,8]=-0.7,qd[41,9]=0.1,qd[41,10]=-0.2,qd[41,11]=-1.0,qd[41,12]=1.0 qd[42,1]=-0.6,qd[42,2]=-0.2,qd[42,3]=1.0,qd[42,4]=0.9,qd[42,5]=-1.1,qd[42,6]=-0.6,qd[42,7]=0.3,qd[42,8]=0.7,qd[42,9]=-0.7,qd[42,10]=0.0,qd[42,11]=0.1,qd[42,12]=-0.6 qd[43,1]=0.6,qd[43,2]=-0.6,qd[43,3]=-0.5,qd[43,4]=0.2,qd[43,5]=-0.7,qd[43,6]=0.3,qd[43,7]=-0.5,qd[43,8]=0.8,qd[43,9]=-0.5,qd[43,10]=-1.1,qd[43,11]=-0.2,qd[43,12]=1.2 qd[44,1]=0.0,qd[44,2]=0.2,qd[44,3]=0.1,qd[44,4]=-0.9,qd[44,5]=-0.9,qd[44,6]=-1.2,qd[44,7]=-0.8,qd[44,8]=-1.0,qd[44,9]=0.4,qd[44,10]=0.1,qd[44,11]=0.6,qd[44,12]=0.4 qd[45,1]=-1.2,qd[45,2]=1.0,qd[45,3]=1.2,qd[45,4]=-0.8,qd[45,5]=-1.1,qd[45,6]=0.4,qd[45,7]=-0.2,qd[45,8]=0.6,qd[45,9]=-0.2,qd[45,10]=0.5,qd[45,11]=-1.0,qd[45,12]=-0.2 qd[46,1]=-0.2,qd[46,2]=-1.1,qd[46,3]=-0.5,qd[46,4]=0.1,qd[46,5]=0.9,qd[46,6]=0.3,qd[46,7]=0.5,qd[46,8]=-0.6,qd[46,9]=-1.0,qd[46,10]=0.8,qd[46,11]=-0.7,qd[46,12]=-0.7 qd[47,1]=-0.3,qd[47,2]=-0.3,qd[47,3]=0.7,qd[47,4]=-0.9,qd[47,5]=1.0,qd[47,6]=0.8,qd[47,7]=-0.7,qd[47,8]=-0.9,qd[47,9]=0.5,qd[47,10]=0.8,qd[47,11]=0.1,qd[47,12]=0.2 qd[48,1]=-0.8,qd[48,2]=-0.8,qd[48,3]=1.2,qd[48,4]=0.7,qd[48,5]=-0.7,qd[48,6]=0.1,qd[48,7]=1.0,qd[48,8]=-0.8,qd[48,9]=-0.6,qd[48,10]=0.5,qd[48,11]=1.0,qd[48,12]=-0.5 qd[49,1]=-0.3,qd[49,2]=-0.9,qd[49,3]=0.6,qd[49,4]=-0.2,qd[49,5]=-0.1,qd[49,6]=0.4,qd[49,7]=0.5,qd[49,8]=-1.1,qd[49,9]=1.0,qd[49,10]=-1.2,qd[49,11]=0.0,qd[49,12]=-1.0 qd[50,1]=-0.9,qd[50,2]=-0.2,qd[50,3]=1.1,qd[50,4]=0.5,qd[50,5]=0.5,qd[50,6]=-0.8,qd[50,7]=0.3,qd[50,8]=0.2,qd[50,9]=0.0,qd[50,10]=0.3,qd[50,11]=-0.6,qd[50,12]=-1.1 qd[51,1]=-1.1,qd[51,2]=0.0,qd[51,3]=1.0,qd[51,4]=0.0,qd[51,5]=0.4,qd[51,6]=0.1,qd[51,7]=-0.3,qd[51,8]=-0.7,qd[51,9]=-0.6,qd[51,10]=0.7,qd[51,11]=-0.8,qd[51,12]=0.9 qd[52,1]=0.0,qd[52,2]=-0.5,qd[52,3]=-0.2,qd[52,4]=-1.0,qd[52,5]=-1.2,qd[52,6]=-1.0,qd[52,7]=0.7,qd[52,8]=-0.3,qd[52,9]=-0.8,qd[52,10]=0.4,qd[52,11]=0.0,qd[52,12]=-0.5 qd[53,1]=-0.1,qd[53,2]=0.5,qd[53,3]=-0.1,qd[53,4]=-1.0,qd[53,5]=-0.6,qd[53,6]=-0.5,qd[53,7]=-0.6,qd[53,8]=-0.4,qd[53,9]=0.4,qd[53,10]=-0.8,qd[53,11]=-1.2,qd[53,12]=0.5 qd[54,1]=0.1,qd[54,2]=-0.8,qd[54,3]=0.6,qd[54,4]=0.1,qd[54,5]=1.1,qd[54,6]=0.6,qd[54,7]=0.3,qd[54,8]=-0.8,qd[54,9]=-1.0,qd[54,10]=-0.5,qd[54,11]=-0.5,qd[54,12]=-1.1 qd[55,1]=-1.1,qd[55,2]=0.1,qd[55,3]=1.1,qd[55,4]=0.9,qd[55,5]=0.3,qd[55,6]=-0.3,qd[55,7]=0.9,qd[55,8]=-1.1,qd[55,9]=-0.5,qd[55,10]=0.7,qd[55,11]=0.6,qd[55,12]=-0.2 qd[56,1]=-0.9,qd[56,2]=0.4,qd[56,3]=1.2,qd[56,4]=-1.2,qd[56,5]=0.8,qd[56,6]=0.5,qd[56,7]=-0.5,qd[56,8]=0.5,qd[56,9]=0.8,qd[56,10]=-0.4,qd[56,11]=-1.0,qd[56,12]=-1.1 qd[57,1]=0.8,qd[57,2]=-0.3,qd[57,3]=0.4,qd[57,4]=-1.0,qd[57,5]=-0.5,qd[57,6]=0.3,qd[57,7]=-1.1,qd[57,8]=0.0,qd[57,9]=0.3,qd[57,10]=0.1,qd[57,11]=-0.8,qd[57,12]=0.7 qd[58,1]=-0.2,qd[58,2]=-1.2,qd[58,3]=1.2,qd[58,4]=1.1,qd[58,5]=-1.0,qd[58,6]=0.9,qd[58,7]=0.1,qd[58,8]=-0.5,qd[58,9]=0.7,qd[58,10]=-1.2,qd[58,11]=-0.6,qd[58,12]=1.2 qd[59,1]=-0.1,qd[59,2]=-1.0,qd[59,3]=-0.7,qd[59,4]=0.9,qd[59,5]=0.4,qd[59,6]=-0.1,qd[59,7]=-0.6,qd[59,8]=0.4,qd[59,9]=0.6,qd[59,10]=1.0,qd[59,11]=-0.7,qd[59,12]=1.1 qd[60,1]=-0.4,qd[60,2]=-0.3,qd[60,3]=0.1,qd[60,4]=0.7,qd[60,5]=1.0,qd[60,6]=0.6,qd[60,7]=-0.3,qd[60,8]=1.0,qd[60,9]=-0.8,qd[60,10]=-0.5,qd[60,11]=0.5,qd[60,12]=0.8 qd[61,1]=0.4,qd[61,2]=-0.7,qd[61,3]=0.7,qd[61,4]=0.0,qd[61,5]=1.1,qd[61,6]=0.9,qd[61,7]=0.2,qd[61,8]=-0.9,qd[61,9]=-1.1,qd[61,10]=-0.4,qd[61,11]=-0.1,qd[61,12]=0.1 qd[62,1]=0.7,qd[62,2]=-0.2,qd[62,3]=-0.6,qd[62,4]=0.9,qd[62,5]=0.0,qd[62,6]=0.3,qd[62,7]=1.2,qd[62,8]=0.3,qd[62,9]=-0.6,qd[62,10]=-0.6,qd[62,11]=0.3,qd[62,12]=-1.0 qd[63,1]=1.0,qd[63,2]=0.7,qd[63,3]=-0.7,qd[63,4]=-0.2,qd[63,5]=0.9,qd[63,6]=0.1,qd[63,7]=0.9,qd[63,8]=1.0,qd[63,9]=-0.9,qd[63,10]=1.0,qd[63,11]=-0.2,qd[63,12]=-0.3 qd[64,1]=-0.7,qd[64,2]=1.1,qd[64,3]=0.9,qd[64,4]=1.1,qd[64,5]=0.3,qd[64,6]=-0.2,qd[64,7]=0.3,qd[64,8]=-1.1,qd[64,9]=-1.0,qd[64,10]=0.4,qd[64,11]=-0.6,qd[64,12]=-0.5 qd[65,1]=0.5,qd[65,2]=-0.2,qd[65,3]=-0.1,qd[65,4]=-0.6,qd[65,5]=0.3,qd[65,6]=0.7,qd[65,7]=1.0,qd[65,8]=0.6,qd[65,9]=-0.2,qd[65,10]=-1.2,qd[65,11]=0.3,qd[65,12]=-0.6 qd[66,1]=1.0,qd[66,2]=-0.8,qd[66,3]=-0.5,qd[66,4]=0.2,qd[66,5]=0.1,qd[66,6]=-0.4,qd[66,7]=-0.7,qd[66,8]=-0.4,qd[66,9]=1.1,qd[66,10]=-1.1,qd[66,11]=-0.5,qd[66,12]=-0.5 qd[67,1]=1.1,qd[67,2]=-0.4,qd[67,3]=-0.2,qd[67,4]=-0.6,qd[67,5]=0.4,qd[67,6]=-0.8,qd[67,7]=0.5,qd[67,8]=-0.9,qd[67,9]=-0.6,qd[67,10]=0.1,qd[67,11]=1.2,qd[67,12]=0.7 qd[68,1]=-0.2,qd[68,2]=-0.5,qd[68,3]=-0.1,qd[68,4]=-0.1,qd[68,5]=0.7,qd[68,6]=0.3,qd[68,7]=1.1,qd[68,8]=0.9,qd[68,9]=-0.8,qd[68,10]=0.2,qd[68,11]=0.2,qd[68,12]=-0.5 qd[69,1]=1.1,qd[69,2]=-0.9,qd[69,3]=0.4,qd[69,4]=-0.7,qd[69,5]=0.2,qd[69,6]=0.0,qd[69,7]=0.4,qd[69,8]=1.2,qd[69,9]=0.8,qd[69,10]=-0.7,qd[69,11]=-0.8,qd[69,12]=0.1 qd[70,1]=-0.8,qd[70,2]=0.3,qd[70,3]=0.4,qd[70,4]=-1.1,qd[70,5]=-0.1,qd[70,6]=1.2,qd[70,7]=-0.9,qd[70,8]=-0.7,qd[70,9]=1.2,qd[70,10]=-1.1,qd[70,11]=-0.2,qd[70,12]=0.3 qd[71,1]=-0.3,qd[71,2]=-1.2,qd[71,3]=0.5,qd[71,4]=-0.8,qd[71,5]=0.2,qd[71,6]=1.1,qd[71,7]=1.2,qd[71,8]=-0.8,qd[71,9]=0.9,qd[71,10]=-1.1,qd[71,11]=-1.1,qd[71,12]=1.2, qd[72,1]=-0.3,qd[72,2]=-1.2,qd[72,3]=0.7,qd[72,4]=0.3,qd[72,5]=0.4,qd[72,6]=0.6,qd[72,7]=0.1,qd[72,8]=0.7,qd[72,9]=-0.6,qd[72,10]=-0.6,qd[72,11]=0.7,qd[72,12]=0.8 qd[73,1]=-1.1,qd[73,2]=0.2,qd[73,3]=0.2,qd[73,4]=-1.1,qd[73,5]=-0.6,qd[73,6]=1.1,qd[73,7]=-0.1,qd[73,8]=0.5,qd[73,9]=1.2,qd[73,10]=0.9,qd[73,11]=0.8,qd[73,12]=-0.7 qd[74,1]=0.9,qd[74,2]=0.5,qd[74,3]=-1.1,qd[74,4]=-0.5,qd[74,5]=0.0,qd[74,6]=-1.2,qd[74,7]=0.2,qd[74,8]=1.2,qd[74,9]=-0.5,qd[74,10]=-0.3,qd[74,11]=-0.3,qd[74,12]=-0.8 qd[75,1]=0.8,qd[75,2]=0.7,qd[75,3]=-1.2,qd[75,4]=0.4,qd[75,5]=-0.1,qd[75,6]=-1.2,qd[75,7]=-0.7,qd[75,8]=-0.1,qd[75,9]=-1.0,qd[75,10]=0.0,qd[75,11]=-1.0,qd[75,12]=-0.3 qd[76,1]=-0.8,qd[76,2]=1.0,qd[76,3]=0.9,qd[76,4]=-1.1,qd[76,5]=-0.9,qd[76,6]=0.4,qd[76,7]=0.6,qd[76,8]=-0.1,qd[76,9]=0.8,qd[76,10]=-0.5,qd[76,11]=-0.2,qd[76,12]=-0.3 qd[77,1]=-0.7,qd[77,2]=-1.1,qd[77,3]=0.5,qd[77,4]=0.1,qd[77,5]=-0.6,qd[77,6]=0.6,qd[77,7]=-0.1,qd[77,8]=1.1,qd[77,9]=0.0,qd[77,10]=-1.2,qd[77,11]=-0.1,qd[77,12]=0.4 qd[78,1]=0.5,qd[78,2]=-1.1,qd[78,3]=-1.1,qd[78,4]=0.0,qd[78,5]=-0.5,qd[78,6]=0.0,qd[78,7]=0.7,qd[78,8]=1.2,qd[78,9]=-0.9,qd[78,10]=-0.2,qd[78,11]=0.5,qd[78,12]=-1.0 qd[79,1]=-0.4,qd[79,2]=-0.3,qd[79,3]=0.3,qd[79,4]=-0.1,qd[79,5]=-1.0,qd[79,6]=1.0,qd[79,7]=-0.7,qd[79,8]=-0.7,qd[79,9]=1.0,qd[79,10]=-1.2,qd[79,11]=0.5,qd[79,12]=0.8 qd[80,1]=0.6,qd[80,2]=-0.3,qd[80,3]=0.0,qd[80,4]=0.4,qd[80,5]=-0.8,qd[80,6]=-0.3,qd[80,7]=-0.7,qd[80,8]=-0.9,qd[80,9]=-0.3,qd[80,10]=0.2,qd[80,11]=1.1,qd[80,12]=1.1 qd[81,1]=-0.3,qd[81,2]=-0.7,qd[81,3]=0.2,qd[81,4]=-0.7,qd[81,5]=-0.3,qd[81,6]=0.5,qd[81,7]=1.2,qd[81,8]=-0.1,qd[81,9]=-0.8,qd[81,10]=-1.1,qd[81,11]=-0.1,qd[81,12]=-0.8 qd[82,1]=0.2,qd[82,2]=-0.4,qd[82,3]=-0.9,qd[82,4]=-0.2,qd[82,5]=1.2,qd[82,6]=1.2,qd[82,7]=0.3,qd[82,8]=-0.7,qd[82,9]=-1.1,qd[82,10]=-0.2,qd[82,11]=-0.2,qd[82,12]=-0.7 qd[83,1]=1.2,qd[83,2]=-0.7,qd[83,3]=-0.5,qd[83,4]=0.1,qd[83,5]=0.2,qd[83,6]=-1.1,qd[83,7]=0.3,qd[83,8]=-1.0,qd[83,9]=0.6,qd[83,10]=-0.3,qd[83,11]=0.2,qd[83,12]=-1.1 qd[84,1]=0.7,qd[84,2]=-1.2,qd[84,3]=0.9,qd[84,4]=0.0,qd[84,5]=-0.7,qd[84,6]=0.2,qd[84,7]=-0.7,qd[84,8]=1.2,qd[84,9]=0.5,qd[84,10]=1.0,qd[84,11]=-0.4,qd[84,12]=1.2 qd[85,1]=1.1,qd[85,2]=-0.4,qd[85,3]=-0.7,qd[85,4]=0.4,qd[85,5]=0.7,qd[85,6]=-0.4,qd[85,7]=-0.3,qd[85,8]=0.5,qd[85,9]=-0.2,qd[85,10]=0.6,qd[85,11]=0.0,qd[85,12]=0.8 qd[86,1]=1.2,qd[86,2]=-0.3,qd[86,3]=-0.1,qd[86,4]=-0.9,qd[86,5]=0.6,qd[86,6]=0.0,qd[86,7]=0.6,qd[86,8]=0.6,qd[86,9]=0.9,qd[86,10]=-0.6,qd[86,11]=-1.2,qd[86,12]=0.4 qd[87,1]=0.3,qd[87,2]=-1.0,qd[87,3]=0.3,qd[87,4]=-0.1,qd[87,5]=-1.0,qd[87,6]=1.1,qd[87,7]=-0.8,qd[87,8]=-0.4,qd[87,9]=0.6,qd[87,10]=0.0,qd[87,11]=0.6,qd[87,12]=1.0 qd[88,1]=-0.3,qd[88,2]=0.0,qd[88,3]=-0.3,qd[88,4]=0.8,qd[88,5]=-0.8,qd[88,6]=0.8,qd[88,7]=0.7,qd[88,8]=1.1,qd[88,9]=-0.5,qd[88,10]=0.0,qd[88,11]=0.6,qd[88,12]=-1.0 qd[89,1]=0.4,qd[89,2]=0.8,qd[89,3]=-0.3,qd[89,4]=-0.2,qd[89,5]=-1.2,qd[89,6]=-0.2,qd[89,7]=0.0,qd[89,8]=0.0,qd[89,9]=1.2,qd[89,10]=1.2,qd[89,11]=0.5,qd[89,12]=-1.1 qd[90,1]=0.5,qd[90,2]=-0.4,qd[90,3]=-0.8,qd[90,4]=-1.0,qd[90,5]=0.0,qd[90,6]=-0.7,qd[90,7]=0.0,qd[90,8]=-0.5,qd[90,9]=-1.1,qd[90,10]=1.0,qd[90,11]=0.8,qd[90,12]=0.1 qd[91,1]=-0.6,qd[91,2]=0.1,qd[91,3]=-0.3,qd[91,4]=-0.8,qd[91,5]=-0.5,qd[91,6]=0.2,qd[91,7]=-1.1,qd[91,8]=0.3,qd[91,9]=0.6,qd[91,10]=1.0,qd[91,11]=-0.2,qd[91,12]=0.9 qd[92,1]=1.0,qd[92,2]=0.3,qd[92,3]=-0.5,qd[92,4]=0.6,qd[92,5]=-1.2,qd[92,6]=-0.1,qd[92,7]=-1.0,qd[92,8]=-0.3,qd[92,9]=0.0,qd[92,10]=-1.2,qd[92,11]=0.4,qd[92,12]=0.1, qd[93,1]=-0.1,qd[93,2]=-1.2,qd[93,3]=-1.1,qd[93,4]=-0.3,qd[93,5]=0.9,qd[93,6]=-0.7,qd[93,7]=1.0,qd[93,8]=0.1,qd[93,9]=0.3,qd[93,10]=-0.6,qd[93,11]=0.4,qd[93,12]=-0.5 qd[94,1]=-1.2,qd[94,2]=0.8,qd[94,3]=0.1,qd[94,4]=1.1,qd[94,5]=-0.7,qd[94,6]=1.2,qd[94,7]=-0.5,qd[94,8]=0.7,qd[94,9]=-0.4,qd[94,10]=0.9,qd[94,11]=-1.2,qd[94,12]=-0.3 qd[95,1]=0.2,qd[95,2]=-0.4,qd[95,3]=-0.9,qd[95,4]=0.0,qd[95,5]=0.6,qd[95,6]=0.4,qd[95,7]=0.5,qd[95,8]=0.7,qd[95,9]=-1.1,qd[95,10]=0.4,qd[95,11]=-0.2,qd[95,12]=-1.1 qd[96,1]=0.8,qd[96,2]=0.2,qd[96,3]=-1.1,qd[96,4]=0.7,qd[96,5]=-1.2,qd[96,6]=-1.0,qd[96,7]=0.0,qd[96,8]=-0.3,qd[96,9]=1.1,qd[96,10]=-0.8,qd[96,11]=-0.5,qd[96,12]=0.9 qd[97,1]=0.7,qd[97,2]=-0.7,qd[97,3]=1.2,qd[97,4]=0.1,qd[97,5]=-1.0,qd[97,6]=0.1,qd[97,7]=0.5,qd[97,8]=1.1,qd[97,9]=-0.9,qd[97,10]=0.9,qd[97,11]=0.6,qd[97,12]=-1.2 qd[98,1]=1.0,qd[98,2]=-0.1,qd[98,3]=-0.8,qd[98,4]=0.0,qd[98,5]=0.7,qd[98,6]=-0.6,qd[98,7]=0.6,qd[98,8]=0.2,qd[98,9]=-0.2,qd[98,10]=0.8,qd[98,11]=1.0,qd[98,12]=-0.4 qd[99,1]=0.2,qd[99,2]=-0.9,qd[99,3]=0.1,qd[99,4]=0.5,qd[99,5]=0.0,qd[99,6]=0.8,qd[99,7]=-1.0,qd[99,8]=-0.4,qd[99,9]=0.9,qd[99,10]=-0.2,qd[99,11]=0.6,qd[99,12]=0.0 qd[100,1]=-1.0,qd[100,2]=-0.4,qd[100,3]=-0.3,qd[100,4]=0.9,qd[100,5]=0.8,qd[100,6]=1.0,qd[100,7]=-1.2,qd[100,8]=0.5,qd[100,9]=0.3,qd[100,10]=-0.4,qd[100,11]=0.1,qd[100,12]=0.1 qd[101,1]=0.1,qd[101,2]=1.2,qd[101,3]=0.7,qd[101,4]=-0.3,qd[101,5]=0.8,qd[101,6]=-0.7,qd[101,7]=-0.6,qd[101,8]=-0.9,qd[101,9]=1.0,qd[101,10]=-0.7,qd[101,11]=-0.1,qd[101,12]=1.2 qd[102,1]=-0.6,qd[102,2]=-0.2,qd[102,3]=0.1,qd[102,4]=0.2,qd[102,5]=-0.4,qd[102,6]=1.1,qd[102,7]=0.8,qd[102,8]=-1.1,qd[102,9]=-0.2,qd[102,10]=-0.6,qd[102,11]=-0.3,qd[102,12]=-0.9 qd[103,1]=0.7,qd[103,2]=-0.1,qd[103,3]=-0.9,qd[103,4]=0.2,qd[103,5]=0.8,qd[103,6]=-0.6,qd[103,7]=-0.4,qd[103,8]=-1.2,qd[103,9]=1.0,qd[103,10]=0.8,qd[103,11]=0.3,qd[103,12]=0.4 qd[104,1]=0.1,qd[104,2]=-1.2,qd[104,3]=-0.6,qd[104,4]=0.9,qd[104,5]=1.1,qd[104,6]=-0.6,qd[104,7]=0.3,qd[104,8]=-0.7,qd[104,9]=-0.8,qd[104,10]=-0.7,qd[104,11]=0.0,qd[104,12]=-0.8 qd[105,1]=1.0,qd[105,2]=0.0,qd[105,3]=-0.1,qd[105,4]=0.0,qd[105,5]=-0.3,qd[105,6]=-0.2,qd[105,7]=0.7,qd[105,8]=0.3,qd[105,9]=0.4,qd[105,10]=1.1,qd[105,11]=0.3,qd[105,12]=-0.3 qd[106,1]=-0.4,qd[106,2]=-1.2,qd[106,3]=-0.1,qd[106,4]=-0.5,qd[106,5]=-0.6,qd[106,6]=0.0,qd[106,7]=-0.3,qd[106,8]=1.1,qd[106,9]=0.7,qd[106,10]=0.3,qd[106,11]=-0.6,qd[106,12]=0.5 qd[107,1]=0.1,qd[107,2]=0.2,qd[107,3]=-0.3,qd[107,4]=1.2,qd[107,5]=1.1,qd[107,6]=0.5,qd[107,7]=0.7,qd[107,8]=0.5,qd[107,9]=-1.1,qd[107,10]=0.4,qd[107,11]=-0.2,qd[107,12]=-1.2 qd[108,1]=0.2,qd[108,2]=-0.1,qd[108,3]=-0.2,qd[108,4]=0.3,qd[108,5]=0.4,qd[108,6]=-0.8,qd[108,7]=-0.7,qd[108,8]=-1.2,qd[108,9]=-0.1,qd[108,10]=-0.6,qd[108,11]=-0.7,qd[108,12]=1.0 qd[109,1]=0.3,qd[109,2]=0.5,qd[109,3]=-0.5,qd[109,4]=-1.0,qd[109,5]=0.4,qd[109,6]=1.2,qd[109,7]=-0.8,qd[109,8]=-1.0,qd[109,9]=0.5,qd[109,10]=0.2,qd[109,11]=-0.3,qd[109,12]=0.5 qd[110,1]=0.2,qd[110,2]=-0.1,qd[110,3]=-0.3,qd[110,4]=1.0,qd[110,5]=0.9,qd[110,6]=-1.1,qd[110,7]=1.2,qd[110,8]=0.6,qd[110,9]=-0.3,qd[110,10]=-0.3,qd[110,11]=-0.6,qd[110,12]=-0.7 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = qd[@sd,1] + qd[@sd,2]*x + qd[@sd,3]*x*x + qd[@sd,4]*x*y \ + qd[@sd,5]*y + qd[@sd,6]*y*y y = qd[@sd,7] + qd[@sd,8]*pxx + qd[@sd,9]*pxx*pxx + qd[@sd,10]*pxx*y \ + qd[@sd,11]*y + qd[@sd,12]*y*y att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc private: float qd[111,13] default: title = "SprottQuad" heading text="Sprott 2D Quadratic Attractors" endheading heading text=" x -> Quadratic in x and y" endheading heading text=" y -> Quadratic in x and y" endheading int param v_trapshapesprottquad caption = "Version (Trap Shape SprottQuad)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesprottquad < 101 endparam param sd caption = "Sprott selector" default = 0 enum = "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" \ "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" \ "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" \ "45" "46" "47" "48" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" \ "60" "61" "62" "63" "64" "65" "66" "67" "69" "69" "70" "71" "72" "73" "74" \ "75" "76" "77" "78" "79" "80" "81" "82" "83" "84" "85" "86" "87" "88" "89" \ "90" "91" "92" "93" "94" "95" "96" "97" "98" "99" "100" "101" "102" "103" \ "104" "105" "106" "107" "108" "109" "110" hint = "Each Sprott selector uses a different strange attractor." endparam float param distscale caption = "Distance scale" default = 1.0 endparam float param s caption = "Attractor scale" default = 0.5 endparam int param max_att_iterations caption = "Attractor iterations" default = 20 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeThreeply(common.ulb:TrapShape) { ; This shape is the Threeply strange attractor. public: import "common.ulb" ; Constructor func REB_TrapShapeThreeply(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x if x != 0 x = y - x/abs(x)*(abs(sin(x)*cos(@h2) + @h3 \ - x*sin(@h1 + @h2 + @h3))) else x = y - (abs(sin(x)*cos(@h2) + @h3 \ - x*sin(@h1 + @h2 + @h3))) endif y = @h1 - pxx att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Threeply" heading text = "Threeply attractor" endheading heading text = "x->y-sign(x)*(abs(sin(x)*cos(h2)+\ h3-x*sin(h1+h2+h3)))" endheading heading text = "y->h1-x" endheading int param v_trapshapethreeply caption = "Version (Trap Shape Threeply)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapethreeply < 101 endparam float param h1 caption = "Threeply param 1" default = -55 endparam float param h2 caption = "Threeply param 2" default = -1 endparam float param h3 caption = "Threeply param 3" default = 0.8 endparam float param distscale caption = "Distance scale" default = 0.0002 endparam float param s caption = "Attractor scale" default = 100 endparam int param max_att_iterations caption = "Attractor iterations" default = 100 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_TrapShapeZito(common.ulb:TrapShape) { ; This shape uses the Zito strange attractor. public: import "common.ulb" ; Constructor func REB_TrapShapeZito(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float x = real(pz)*@s float y = imag(pz)*@s float pxx = 0 int att_iter = 0 while att_iter < @max_att_iterations && x < 1e100 && x > -1e100 pxx = x x = x*y +@h1*x - y y= pxx + y att_iter = att_iter + 1 endwhile m_LastZ = (x + sgn*flip(y)) float d = @distscale*|pz-(x + sgn*flip(y))| return d endfunc default: title = "Zito" heading text = "Zito attractor" endheading heading text = "x -> x*y + a*x - y" endheading heading text = "y -> x + y" endheading int param v_trapshapezito caption = "Version (Trap Shape Zito)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapezito < 101 endparam float param h1 caption = "Zito param" default = 0.357 endparam float param distscale caption = "Distance scale" default = 1 endparam float param s caption = "Attractor scale" default = 2 endparam int param max_att_iterations caption = "Attractor iterations" default = 10 endparam bool param sgn caption = "Conjugate transform" default = false endparam } class REB_SpokesNRings(common.ulb:TrapShape) { ; This trap creates rings and spokes shapes.
; It can also be used as a texture ; public: import "common.ulb" ; constructor func REB_SpokesNRings(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; call for each iterated point float func Iterate(complex pz) TrapShape.Iterate(pz) float dist = cabs(pz) float theta = atan2(pz) if theta < 0 theta = theta + 2*#pi endif if theta > 2*#pi theta = 2*#pi endif float wedge = 2*#pi/@spokes float swidth = @swidth if swidth >= wedge swidth = wedge endif if @type == "Spokes" if @spiralize if (theta+@twist*dist) % wedge < (theta+@twist*dist+swidth) % wedge dist = 1e20 pz = (1e20,1e20) endif else if theta % wedge < (theta+swidth) % wedge dist = 1e20 pz = (1e20,1e20) endif endif elseif @type == "Rings" if dist % (1/@dens) < (dist+0.5*@rwidth/@dens) % (1/@dens) dist = 1e20 pz = (1e20,1e20) endif endif m_lastZ = pz return dist endfunc protected: default: title = "Spokes N Rings" int param v_spokesnrings caption = "Version (Trap Shape Spokes N Rings)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_spokesnrings < 100 endparam param type caption = "Trap Type" default = 0 enum = "Spokes" "Rings" endparam int param spokes caption = "# of Spokes" default = 5 visible = @type == "Spokes" endparam float param swidth caption = "Spoke thickness" default = 1 visible = @type == "Spokes" endparam bool param spiralize caption = "Spiral spokes" default = false visible = @type == "Spokes" endparam float param twist caption = "Amount of twist" default = 1 visible = @type == "Spokes" && @spiralize endparam float param dens caption = "Ring density" default = 20 visible = @type == "Rings" endparam float param rwidth caption = "Ring thickness" default = 1 visible = @type == "Rings" endparam } class REB_TrapShapeAmpersand(common.ulb:TrapShape) { ; This shape uses the ampersand function.
;

; This variant of the ampersand function involves taking a square root ; so there are two solutions. A signed and absolute value version of ; the distance is also available. The transformed value is the ; complex return value of the function. public: import "common.ulb" $define debug ; Constructor func REB_TrapShapeAmpersand(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale if !@cmplx x = real(@fn1(pz)) y = imag(@fn2(pz)) else x = real(@fn1(pz)) y = imag(@fn1(pz)) endif if @ref == "pz" d = (y^2-x^2)*(x-@a1)*(@a2*x-@a3)-@a4*(x^2+y^2-@a5*x)^2+cabs(pz)*@offset else d = (y^2-x^2)*(x-@a1)*(@a2*x-@a3)-@a4*(x^2+y^2-@a5*x)^2+@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else int sgn = 1 if @sgn sgn = -1 endif float x = real(pz) float qy = 0 float qb = 6*x^2 - 3*x - 3 float qc = 6*x^4 - 13*x^3 + 19*x^2 if @negroot qy = ((-qb - (qb^2 - 16*qc)^0.5)/(8))^0.5 else qy = ((-qb + (qb^2 - 16*qc)^0.5)/(8))^0.5 endif m_LastZ = @a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(@a*(x + sgn*flip(qy)))) else d = cabs(pz - @a*(x + sgn*flip(qy))) endif endif return d endfunc default: title = "Ampersand" int param v_trapshapeampersand caption = "Version (Trap Shape Ampersand)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeampersand < 101 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam bool param adv caption = "advanced" default = false visible = @altformula endparam float param a1 caption = "parameter a1" default = 1 visible = @adv && @altformula endparam float param a2 caption = "parameter a2" default = 2 visible = @adv && @altformula endparam float param a3 caption = "parameter a3" default = 3 visible = @adv endparam float param a4 caption = "parameter a4" default = 4 visible = @adv && @altformula endparam float param a5 caption = "parameter a5" default = 2 visible = @adv && @altformula endparam bool param cmplx caption = "Apply to complex" default = false visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = !@cmplx && @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam param negroot caption = "Quad Neg Root" default = true visible = !@altformula endparam } class REB_TrapShapeSpiricOfPerseus(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeSpiricOfPerseus(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) complex qy = 0 if @negroot qy = -(2*(x^2+@c^2)^0.5 -x^2 - 1 + @b^2 - @c^2)^0.5 else qy = (2*(x^2+@c^2)^0.5 -x^2 - 1 + @b^2 - @c^2)^0.5 endif m_LastZ = 3*@a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(3*@a*(x + sgn*flip(qy)))) else d = cabs(pz - 3*@a*(x + sgn*flip(qy))) endif return d endfunc default: title = "Spiric Of Perseus" int param v_SpiricOfPerseus caption = "Version (Spiric Of Perseus)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_SpiricOfPerseus < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "Spiric 1 parameter" default = 0.3 endparam float param c caption = "Spiric 2 parameter" default = 0.6 endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam param negroot caption = "Quad Neg Root" default = true endparam } class REB_TrapShapeGranvillesEgg(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeGranvillesEgg(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) complex qy = 0 if @negroot qy = -((x-@b)*(1-x)/x^2)^0.5 else qy = ((x-@b)*(1-x)/x^2)^0.5 endif m_LastZ = @a*(x + sgn*flip(qy))/2 if @absval d = abs(cabs(pz) - cabs(@a*(x + sgn*flip(qy)))/2) else d = cabs(pz - @a*(x + sgn*flip(qy))/2) endif return d endfunc default: title = "Granville's Egg" int param v_GranvillesEgg caption = "Version (Granville's Egg)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_GranvillesEgg < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "Granville parameter" default = 0.1 endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam param negroot caption = "Quad Neg Root" default = true endparam } class REB_TrapShapeGudermannian(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeGudermannian(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) float qy = atan(exp(x)) m_LastZ = 5*@a*(x + sgn*flip(qy))/2 if @absval d = abs(cabs(pz) - cabs(5*@a*(x + sgn*flip(qy)))/2) else d = cabs(pz - 5*@a*(x + sgn*flip(qy))/2) endif return d endfunc default: title = "Gudermannian" int param v_Gudermannian caption = "Version (Gudermannian)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Gudermannian < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeHeatCapacity(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeHeatCapacity(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) float qy = x + @b/x^2 m_LastZ = @a*(x + sgn*flip(qy))/2 if @absval d = abs(cabs(pz) - cabs(@a*(x + sgn*flip(qy)))/2) else d = cabs(pz - @a*(x + sgn*flip(qy))/2) endif return d endfunc default: title = "Heat Capacity" int param v_HeatCapacity caption = "Version (Heat Capacity)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_HeatCapacity < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "Heat Capacity parameter" default = 0.01 endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeHoerlFunction(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeHoerlFunction(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) float qy = x^@b*exp(x) m_LastZ = 2.5*@a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(2.5*@a*(x + sgn*flip(qy)))) else d = cabs(pz - 2.5*@a*(x + sgn*flip(qy))) endif return d endfunc default: title = "Hoerl Function" int param v_HoerlFunction caption = "Version (Hoerl Function)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_HoerlFunction < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "Hoerl parameter" default = 0.5 endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeBesace(common.ulb:TrapShape) { public: import "common.ulb" $define debug ; Constructor func REB_TrapShapeBesace(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = (y+@aa*x^2)^2-x^2+x^4-cabs(pz)*@offset else d = (y+@aa*x^2)^2-x^2+x^4-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else int sgn = 1 if @sgn sgn = -1 endif d = 0 x = real(pz) complex qy = 0 if @negroot qy = -sqrt(x^2-x^4) - @b*x^2 else qy = sqrt(x^2-x^4) - @b*x^2 endif m_LastZ = @a*(x + sgn*flip(qy))/2 if @absval d = abs(cabs(pz) - cabs(@a*(x + sgn*flip(qy)))/2) else d = cabs(pz - @a*(x + sgn*flip(qy))/2) endif endif return d endfunc default: title = "Besace" int param v_Besace caption = "Version (Besace)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_besace < 100 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.2 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "Besace parameter" default = 2 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "Besace parameter" default = 100 visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam param negroot caption = "Quad Neg Root" default = true visible = !@altformula endparam } class REB_TrapShapeKulpsQuartic(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeKulpsQuartic(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) float qy = 0 if @negroot qy = -sqrt(1/(1+x^2)) else qy = sqrt(1/(1+x^2)) endif m_LastZ = 2.5*@a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(2.5*@a*(x + sgn*flip(qy)))) else d = cabs(pz - 2.5*@a*(x + sgn*flip(qy))) endif return d endfunc default: title = "Kulp's Quartic" int param v_KulpsQuartic caption = "Version (Kulp's Quartic)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_KulpsQuartic < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam param negroot caption = "Quad Neg Root" default = true endparam } class REB_TrapShapeKiepertsCurve(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeKiepertsCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) complex qy = 0 if @negroot qy = -sqrt((1-x^2)^3) else qy = sqrt((1-x^2)^3) endif m_LastZ = 3*@a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(3*@a*(x + sgn*flip(qy)))) else d = cabs(pz - 3*@a*(x + sgn*flip(qy))) endif return d endfunc default: title = "Kiepert's Curve" int param v_KiepertsCurve caption = "Version (Kiepert's Curve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_KiepertsCurve < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam param negroot caption = "Quad Neg Root" default = true endparam } class REB_TrapShapeLennardJones(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeLennardJones(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) float qy = 0 qy = x^(-12) - x^(-6) m_LastZ = 5*@a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(5*@a*(x + sgn*flip(qy)))) else d = cabs(pz - 5*@a*(x + sgn*flip(qy))) endif return d endfunc default: title = "Lennard-Jones Potential" int param v_LennardJones caption = "Version (Lennard-Jones Potential)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_LennardJones < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeFunction(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeFunction(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) float qy = 0 qy = real(@fn(x)) m_LastZ = 5*@a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(5*@a*(x + sgn*flip(qy)))) else d = cabs(pz - 5*@a*(x + sgn*flip(qy))) endif return d endfunc default: title = "Function" int param v_Function caption = "Version (Function)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Function < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam func fn caption = "Function" default = sin() endfunc } class REB_TrapShapeCubicSpiral(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeCubicspiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) float qy = 0 qy = x^3 m_LastZ = 4*@a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(4*@a*(x + sgn*flip(qy)))) else d = cabs(pz - 4*@a*(x + sgn*flip(qy))) endif return d endfunc default: title = "Cubic Spiral" int param v_CubicSpiral caption = "Version (Cubic Spiral)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_CubicSpiral < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeGauss(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeGauss(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 float x = real(pz) float qy = 0 qy = (1/(@sigma*sqrt(2*#pi)))*exp(-x^2/(2*@sigma^2)) m_LastZ = 4*@a*(x + sgn*flip(qy)) if @absval d = abs(cabs(pz) - cabs(4*@a*(x + sgn*flip(qy)))) else d = cabs(pz - 4*@a*(x + sgn*flip(qy))) endif return d endfunc default: title = "Gauss Curve" int param v_Gauss caption = "Version (Gauss Curve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Gauss < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param sigma caption = "Sigma" default = 1 endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeOphiuride(common.ulb:TrapShape) { ; This shape uses the ophiuride function.
;

; This variant of the ophuiride function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeOphiuride(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = (0.01*@b*sin(theta)-@a*cos(theta))*tan(theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Ophiuride" int param v_trapshapeophiuride caption = "Version (Trap Shape Ophiuride)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeophiuride < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeREBAstroid(common.ulb:TrapShape) { ; This shape uses the astroid function.
;

; This variant of the astoid function is different from that used by Damien ; Jones. It has signed and absolute value version of the distance. The function ; also has a complex conjugate variant. The transformed value is the complex ; return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeREBAstroid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 complex as = 0 complex af1 = 0 complex af2 = 0 float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale if !@cmplx x = real(@fn1(pz)) y = imag(@fn2(pz)) else x = real(@fn1(pz)) y = imag(@fn1(pz)) endif if @ref == "pz" d = x^(2/3)+y^(2/3)-@a^(2/3)+cabs(pz)*@offset else d = x^(2/3)+y^(2/3)-@a^(2/3)+@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif af1 = @afn1(theta)^real(@pwr) af2 = @afn2(theta)^imag(@pwr) as = @ar*(af1+sgn*flip(af2)) m_LastZ = as if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - (as)) endif endif return d endfunc default: title = "Astroid REB" int param v_trapshapeastroidreb caption = "Version (Trap Shape Astroid REB)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeastroidreb < 102 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.2 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param a caption = "parameter a" default = 1 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam bool param cmplx caption = "Apply to complex" default = false visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula && !@cmplx endfunc float param ar caption = "Radius" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam complex param pwr caption = "Power" default = (3,3) hint = "Affects shape and scale of trap." visible = !@altformula endparam func afn1 caption = "Function #1" default = cos() visible = !@altformula endfunc func afn2 caption = "Function #2" default = sin() visible = !@altformula endfunc bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeBean(common.ulb:TrapShape) { ; This shape uses the bean function.
;

; It has signed and absolute value version of the distance. The function ; also has a complex conjugate variant. The transformed value is the complex ; return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeBean(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) float theta = 0 TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = (x^2+y^2)^2-x^3-y^3-cabs(pz)*@offset else d = (x^2+y^2)^2-x^3-y^3-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else complex af1 = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif af1 = @a*(@afn1(theta)^real(@pwr)+@afn2(theta)^imag(@pwr)) if @absval d = abs(cabs(pz) - cabs(af1*cos(theta) + sgn*flip(af1*sin(theta)))) else d = cabs(pz - (af1*cos(theta) + sgn*flip(af1*sin(theta)))) endif m_LastZ = (af1*cos(theta) + sgn*flip(af1*sin(theta))) endif return d endfunc default: title = "Bean" int param v_trapshapebean caption = "Version (Trap Shape Bean)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapebean < 101 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.2 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam complex param pwr caption = "Power" default = (3,3) hint = "Affects shape and scale of trap." visible = !@altformula endparam func afn1 caption = "Function #1" default = cos() visible = !@altformula endfunc func afn2 caption = "Function #2" default = sin() visible = !@altformula endfunc bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam } class REB_TrapShapeCircle(common.ulb:TrapShape) { ; This shape uses the circle function.
;

; This variant of the circle function has a signed and absolute value ; version of the distance. The function also has a complex conjugate. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCircle(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a*sin(theta)^2 + 0.2*@b*cos(theta)^2 if @absval d = abs(cabs(pz) - cabs(rr*cos(theta) + sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) return d endfunc default: title = "Circle" int param v_trapshapecircle caption = "Version (Trap Shape Circle)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecircle < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_AstroidalEllipsoid(common.ulb:TrapShape) { ; This shape uses the 3D Astroidal Ellipsoid function.
;

public: import "common.ulb" ; Constructor func REB_AstroidalEllipsoid(Generic pparent) TrapShape.TrapShape(pparent) xrot = (0,1)^(@xang/90) yrot = (0,1)^(@yang/90) temp = 0 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = (@aa*cos(real(pz))*cos(imag(pz)))^3*@scale2 float y = (@ab*sin(real(pz))*cos(imag(pz)))^3*@scale2 float z = (@ac*sin(imag(pz)))^3*@scale2 ; ; Y axis rotation ; temp = x + flip(z) temp = temp*yrot x = real(temp) z = imag(temp) ; ; X axis rotation ; temp = y + flip(z) temp = temp*xrot y = real(temp) z = imag(temp) ; calculate 3D distance float d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +z^2)*@scale if @usez if @tz == "cabs(z)" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*cabs(pz)-z)^2)*@scale elseif @tz == "real+imag z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz)+imag(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((imag(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(imag(pz))-z)^2)*@scale elseif @tz == "angle pz" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*atan2(pz)-z)^2)*@scale endif endif m_lastZ = x + flip(y) return d endfunc protected: complex xrot complex yrot complex temp default: title = "Astroidal Ellipsoid" heading text = "This is a 3D parametric surface." endheading int param v_AstroidalEllipsoid caption = "Version (Trap Shape AstroidalEllipsoid)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_AstroidalEllipsoid < 100 endparam float param xang caption = "X rotation" default = -40 endparam float param yang caption = "Y rotation" default = 30 endparam float param scale2 caption = "prescale" default = 1.0 endparam float param scale caption = "Scale" default = 0.2 endparam bool param usez caption = "fractal z for z value" default = false endparam param tz caption = "fractal z type" enum = "cabs(z)" "real+imag z" "real z" "imag z" "angle pz" default = 0 visible = @usez endparam float param sz caption = "fractal z scale" default = 1 visible = @usez endparam float param aa caption = "param a" default = 1.0 endparam float param ab caption = "param b" default = 1.0 endparam float param ac caption = "param c" default = 1.0 endparam } class REB_AppleSurface(common.ulb:TrapShape) { ; This shape uses the 3D Apple Surface function.
;

public: import "common.ulb" ; Constructor func REB_AppleSurface(Generic pparent) TrapShape.TrapShape(pparent) xrot = (0,1)^(@xang/90) yrot = (0,1)^(@yang/90) temp = 0 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = (cos(real(pz))*(4 + 3.8*cos(imag(pz))))*@ap*@scale2 float y = (sin(real(pz))*(4 + 3.8*cos(imag(pz))))*@ap*@scale2 float z = ((cos(imag(pz)) + sin(imag(pz)) - 1)+\ (1 + sin(imag(pz)))*log(1 - #pi*imag(pz) / 10) +\ 7.5*sin(imag(pz)))*@ap*@scale2 ; ; Y axis rotation ; temp = x + flip(z) temp = temp*yrot x = real(temp) z = imag(temp) ; ; X axis rotation ; temp = y + flip(z) temp = temp*xrot y = real(temp) z = imag(temp) ; calculate 3D distance float d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +z^2)*@scale if @usez if @tz == "cabs(z)" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*cabs(pz)-z)^2)*@scale elseif @tz == "real+imag z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz)+imag(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((imag(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(imag(pz))-z)^2)*@scale elseif @tz == "angle pz" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*atan2(pz)-z)^2)*@scale endif endif m_lastZ = x + flip(y) return d endfunc protected: complex xrot complex yrot complex temp default: title = "Apple Surface" heading text = "This is a 3D parametric surface." endheading int param v_AppleSurface caption = "Version (Trap Shape AppleSurface)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_AppleSurface < 100 endparam float param xang caption = "X rotation" default = -75 endparam float param yang caption = "Y rotation" default = 20 endparam float param scale2 caption = "Precale" default = 1.0 endparam float param scale caption = "Scale" default = 0.2 endparam bool param usez caption = "fractal z for z value" default = false endparam param tz caption = "fractal z type" enum = "cabs(z)" "real+imag z" "real z" "imag z" "angle pz" default = 0 visible = @usez endparam float param sz caption = "fractal z scale" default = 1 visible = @usez endparam float param ap caption = "param" default = 0.1 endparam } class REB_BowTie(common.ulb:TrapShape) { ; This shape uses the 3D Bow Tie Surface function.
;

public: import "common.ulb" ; Constructor func REB_BowTie(Generic pparent) TrapShape.TrapShape(pparent) xrot = (0,1)^(@xang/90) yrot = (0,1)^(@yang/90) temp = 0 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = sin(real(pz))/(sqrt(2)+sin(imag(pz)))*@scale2 float y = sin(real(pz))/(sqrt(2)+cos(imag(pz)))*@scale2 float z = cos(real(pz))/(sqrt(2)+1)*@scale2 ; ; Y axis rotation ; temp = x + flip(z) temp = temp*yrot x = real(temp) z = imag(temp) ; ; X axis rotation ; temp = y + flip(z) temp = temp*xrot y = real(temp) z = imag(temp) ; calculate 3D distance float d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +z^2)*@scale if @usez if @tz == "cabs(z)" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*cabs(pz)-z)^2)*@scale elseif @tz == "real+imag z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz)+imag(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((imag(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(imag(pz))-z)^2)*@scale elseif @tz == "angle pz" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*atan2(pz)-z)^2)*@scale endif endif m_lastZ = x + flip(y) return d endfunc protected: complex xrot complex yrot complex temp default: title = "Bow Tie Surface" heading text = "This is a 3D parametric surface." endheading int param v_BowTieSurface caption = "Version (Trap Shape BowTieSurface)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BowTieSurface < 100 endparam float param xang caption = "X rotation" default = -45 endparam float param yang caption = "Y rotation" default = 90 endparam float param scale2 caption = "Prescale" default = 1 endparam float param scale caption = "Scale" default = 0.2 endparam bool param usez caption = "fractal z for z value" default = false endparam param tz caption = "fractal z type" enum = "cabs(z)" "real+imag z" "real z" "imag z" "angle pz" default = 0 visible = @usez endparam float param sz caption = "fractal z scale" default = 1 visible = @usez endparam } class REB_BowSurface(common.ulb:TrapShape) { ; This shape uses the 3D Bow Surface function.
;

public: import "common.ulb" ; Constructor func REB_BowSurface(Generic pparent) TrapShape.TrapShape(pparent) xrot = (0,1)^(@xang/90) yrot = (0,1)^(@yang/90) temp = 0 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = ((2 + @T*sin(2*#pi*real(pz)))*sin(4*#pi*imag(pz)))*@scale2 float y = (2 + @T*sin(2*#pi*real(pz)))*cos(4*#pi*imag(pz))*@scale2 float z = (@T*cos(2*#pi*real(pz)) + 3*cos(2*#pi*imag(pz))*@scale2) ; ; Y axis rotation ; temp = x + flip(z) temp = temp*yrot x = real(temp) z = imag(temp) ; ; X axis rotation ; temp = y + flip(z) temp = temp*xrot y = real(temp) z = imag(temp) ; calculate 3D distance float d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +z^2)*@scale if @usez if @tz == "cabs(z)" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*cabs(pz)-z)^2)*@scale elseif @tz == "real+imag z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz)+imag(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((imag(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(imag(pz))-z)^2)*@scale elseif @tz == "angle pz" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*atan2(pz)-z)^2)*@scale endif endif m_lastZ = x + flip(y) return d endfunc protected: complex xrot complex yrot complex temp default: title = "Bow Surface" heading text = "This is a 3D parametric surface." endheading int param v_BowSurface caption = "Version (Trap Shape BowSurface)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BowSurface < 100 endparam float param xang caption = "X rotation" default = -100 endparam float param yang caption = "Y rotation" default = 30 endparam float param scale2 caption = "Prescale" default = 0.5 endparam float param scale caption = "Scale" default = 0.2 endparam float param T caption = "Bow thickness" default = 1 endparam bool param usez caption = "fractal z for z value" default = false endparam param tz caption = "fractal z type" enum = "cabs(z)" "real+imag z" "real z" "imag z" "angle pz" default = 0 visible = @usez endparam float param sz caption = "fractal z scale" default = 1 visible = @usez endparam } class REB_BoySurface(common.ulb:TrapShape) { ; This shape uses the 3D Boy Surface function.
;

public: import "common.ulb" ; Constructor func REB_BoySurface(Generic pparent) TrapShape.TrapShape(pparent) xrot = (0,1)^(@xang/90) yrot = (0,1)^(@yang/90) temp = 0 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = (((2/3)*(cos(real(pz))*cos(2*imag(pz))+sqrt(2)*sin(real(pz))*cos(imag(pz)))*cos(real(pz)) \ /(sqrt(2) - sin(2*real(pz))*sin(3*imag(pz)))))*@scale2 float y = (((2/3)*(cos(real(pz))*sin(2*imag(pz))-sqrt(2)*sin(real(pz))*sin(imag(pz)))*cos(real(pz)) \ /(sqrt(2)-sin(2*real(pz))*sin(3*imag(pz)))))*@scale2 float z = ((sqrt(2)*cos(real(pz))^2 / (sqrt(2) - sin(2*real(pz))*sin(2*imag(pz)))))*@scale2 ; ; Y axis rotation ; temp = x + flip(z) temp = temp*yrot x = real(temp) z = imag(temp) ; ; X axis rotation ; temp = y + flip(z) temp = temp*xrot y = real(temp) z = imag(temp) ; calculate 3D distance float d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +z^2)*@scale if @usez if @tz == "cabs(z)" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*cabs(pz)-z)^2)*@scale elseif @tz == "real+imag z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz)+imag(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((imag(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(imag(pz))-z)^2)*@scale elseif @tz == "angle pz" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*atan2(pz)-z)^2)*@scale endif endif m_lastZ = x + flip(y) return d endfunc protected: complex xrot complex yrot complex temp default: title = "Boy Surface" heading text = "This is a 3D parametric surface." endheading int param v_BoySurface caption = "Version (Trap Shape BowSurface)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BoySurface < 100 endparam float param xang caption = "X rotation" default = -20 endparam float param yang caption = "Y rotation" default = 0 endparam float param scale2 caption = "Prescale" default = 1.0 endparam float param scale caption = "Scale" default = 0.2 endparam bool param usez caption = "fractal z for z value" default = false endparam param tz caption = "fractal z type" enum = "cabs(z)" "real+imag z" "real z" "imag z" "angle pz" default = 0 visible = @usez endparam float param sz caption = "fractal z scale" default = 1 visible = @usez endparam } class REB_BourMinimalSurface(common.ulb:TrapShape) { ; This shape uses the 3D Bour Minimal Surface function.
;

public: import "common.ulb" ; Constructor func REB_BourMinimalSurface(Generic pparent) TrapShape.TrapShape(pparent) xrot = (0,1)^(@xang/90) yrot = (0,1)^(@yang/90) temp = 0 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = ((real(pz)^(@n-1)* cos((@n-1)*imag(pz))/(2*(@n-1)) - real(pz)^(@n+1)* cos((@n+1)*imag(pz))/(2*(@n+1))))*@scale2 float y = ((real(pz)^(@n-1)* sin((@n-1)*imag(pz))/(2*(@n-1)) + real(pz)^(@n+1)* sin((@n+1)*imag(pz))/(2*(@n+1))))*@scale2 float z = ((real(pz)^@n*cos(@n*imag(pz)) / @n))*@scale2 ; ; Y axis rotation ; temp = x + flip(z) temp = temp*yrot x = real(temp) z = imag(temp) ; ; X axis rotation ; temp = y + flip(z) temp = temp*xrot y = real(temp) z = imag(temp) ; calculate 3D distance float d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +z^2)*@scale if @usez if @tz == "cabs(z)" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*cabs(pz)-z)^2)*@scale elseif @tz == "real+imag z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz)+imag(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((imag(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(imag(pz))-z)^2)*@scale elseif @tz == "angle pz" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*atan2(pz)-z)^2)*@scale endif endif m_lastZ = x + flip(y) return d endfunc protected: complex xrot complex yrot complex temp default: title = "Bour Minimal Surface" heading text = "This is a 3D parametric surface." endheading int param v_BourMinimalSurface caption = "Version (Trap Shape BourMinimalSurface)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BourMinimalSurface < 100 endparam float param xang caption = "X rotation" default = -20 endparam float param yang caption = "Y rotation" default = 30 endparam float param scale2 caption = "Prescale" default = 1.0 endparam float param scale caption = "Scale" default = 0.2 endparam int param n caption = "Integer parameter" default = 3 min = 2 endparam bool param usez caption = "fractal z for z value" default = false endparam param tz caption = "fractal z type" enum = "cabs(z)" "real+imag z" "real z" "imag z" "angle pz" default = 0 visible = @usez endparam float param sz caption = "fractal z scale" default = 1 visible = @usez endparam } class REB_BohemianDome(common.ulb:TrapShape) { ; This shape uses the 3D Bohemian Dome Surface function.
;

public: import "common.ulb" ; Constructor func REB_BohemianDome(Generic pparent) TrapShape.TrapShape(pparent) xrot = (0,1)^(@xang/90) yrot = (0,1)^(@yang/90) temp = 0 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = (@ba*cos(real(pz)))*@scale2 float y = (@bb*cos(imag(pz)) + @ba*sin(real(pz)))*@scale2 float z = (@bc*sin(imag(pz)))*@scale2 ; ; Y axis rotation ; temp = x + flip(z) temp = temp*yrot x = real(temp) z = imag(temp) ; ; X axis rotation ; temp = y + flip(z) temp = temp*xrot y = real(temp) z = imag(temp) ; calculate 3D distance float d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +z^2)*@scale if @usez if @tz == "cabs(z)" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*cabs(pz)-z)^2)*@scale elseif @tz == "real+imag z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz)+imag(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((imag(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(imag(pz))-z)^2)*@scale elseif @tz == "angle pz" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*atan2(pz)-z)^2)*@scale endif endif m_lastZ = x + flip(y) return d endfunc protected: complex xrot complex yrot complex temp default: title = "Bohemian Dome" heading text = "This is a 3D parametric surface." endheading int param v_BohemianDome caption = "Version (Trap Shape Bohemian Dome)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BohemianDome < 100 endparam float param xang caption = "X rotation" default = -30 endparam float param yang caption = "Y rotation" default = 60 endparam float param scale2 caption = "Precale" default = 1.0 endparam float param scale caption = "Scale" default = 0.2 endparam float param ba caption = "param a" default = 0.5 endparam float param bb caption = "param b" default = 1.5 endparam float param bc caption = "param c" default = 1.0 endparam bool param usez caption = "fractal z for z value" default = false endparam param tz caption = "fractal z type" enum = "cabs(z)" "real+imag z" "real z" "imag z" "angle pz" default = 0 visible = @usez endparam float param sz caption = "fractal z scale" default = 1 visible = @usez endparam } class REB_BanchoffKleinBottle(common.ulb:TrapShape) { ; This shape uses the 3D Banchoff Klein Bottle Surface function.
;

public: import "common.ulb" ; Constructor func REB_BanchoffKleinBottle(Generic pparent) TrapShape.TrapShape(pparent) xrot = (0,1)^(@xang/90) yrot = (0,1)^(@yang/90) temp = 0 endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = (cos(real(pz)/@banc)*(cos(real(pz)/@banb)*(@bana+cos(imag(pz)))+ \ (sin(real(pz)/@banb)*sin(imag(pz))*cos(imag(pz)))))*@bc float y = (sin(real(pz)/@banc)*(cos(real(pz)/@banb)*(@bana+cos(imag(pz)))+ \ (sin(real(pz)/@banb)*sin(imag(pz))*cos(imag(pz)))))*@bc float z = (-sin(real(pz)/@banb)*(@bana+cos(imag(pz)))+cos(real(pz)/@banb)*sin(imag(pz))*cos(imag(pz)))*@bc ; ; Y axis rotation ; temp = x + flip(z) temp = temp*yrot x = real(temp) z = imag(temp) ; ; X axis rotation ; temp = y + flip(z) temp = temp*xrot y = real(temp) z = imag(temp) ; calculate 3D distance float d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +z^2)*@scale if @usez if @tz == "cabs(z)" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*cabs(pz)-z)^2)*@scale elseif @tz == "real+imag z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz)+imag(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((imag(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(real(pz))-z)^2)*@scale elseif @tz == "real z" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*(imag(pz))-z)^2)*@scale elseif @tz == "angle pz" d = sqrt((real(pz)-x)^2 + (imag(pz)-y)^2 +(@sz*atan2(pz)-z)^2)*@scale endif endif m_lastZ = x + flip(y) return d endfunc protected: complex xrot complex yrot complex temp default: title = "Banchoff Klein Bottle" heading text = "This is a 3D parametric surface." endheading int param v_BanchoffKleinBottle caption = "Version (Banchoff Klein Bottle)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BanchoffKleinBottle < 100 endparam float param xang caption = "X rotation" default = -90 endparam float param yang caption = "Y rotation" default = 90 endparam float param scale caption = "scale" default = 0.2 endparam bool param usez caption = "fractal z for z value" default = false endparam param tz caption = "fractal z type" enum = "cabs(z)" "real+imag z" "real z" "imag z" "angle pz" default = 0 visible = @usez endparam float param sz caption = "fractal z scale" default = 1 visible = @usez endparam float param bc caption = "Banchoff scale" default = 0.5 endparam float param bana caption = "Parameter a" default = 1.414213 endparam float param banb caption = "Parameter b" default = 2.0 endparam float param banc caption = "Parameter c" default = 1.0 endparam } class REB_TrapShapeConvexPolygons(common.ulb:TrapShape) { ; This shape uses the Convex Polygons.
$define debug public: import "common.ulb" ; Constructor func REB_TrapShapeConvexPolygons(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; call before each iteration func Init(complex pz) TrapShape.Init(pz) twopi = 2*#pi i = 0 x=0.0 y=0.0 ; create the vertex aray repeat vx[i] = sin(i*twopi/@sides) vy[i] = cos(i*twopi/@sides) v[i] = vx[i] + flip(vy[i]) i = i + 1 until i == @sides endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) i = 0 if @flavor == "flavor 1" d = 1e10 else d = 0 endif ; calculate r[i] and t[i] for first n-1 sides repeat t[i]=(5*pz/@scale-v[i])/(v[i+1]-v[i]) x=real(t[i]) y=imag(t[i]) if @extend && @flavor == "flavor 1" r[i]=abs(y) else if(x<0.0) r[i]=cabs(t[i]) elseif(x>1.0) r[i]=cabs(t[i]-1) else r[i]=abs(y) endif endif r[i]=r[i]*cabs(v[i+1]-v[i]) i = i + 1 until i == (@sides-1) ; calculate r[i] and t[i] for the last side t[@sides-1]=(5*pz/@scale-v[@sides-1])/(v[0]-v[@sides-1]) x=real(t[@sides-1]) y=imag(t[@sides-1]) if @extend && @flavor == "flavor 1" r[@sides-1]=abs(y) else if(x<0.0) r[@sides-1]=cabs(t[@sides-1]) elseif(x>1.0) r[@sides-1]=cabs(t[@sides-1]-1) else r[@sides-1]=abs(y) endif endif r[@sides-1]=r[@sides-1]*cabs(v[0]-v[@sides-1]) i = 0 repeat if r[i] < d if @flavor == "flavor 1" d = r[i] endif endif m_LastZ = m_LastZ + t[i] if @flavor == "flavor 2" d = d + cabs(r[i]) elseif @flavor == "flavor 3" d = d + cabs(t[i]) endif i = i + 1 until i == @sides m_LastZ = m_LastZ/@sides^2 if @flavor != "flavor 1" d = d/@sides^2 else d = d/@sscale endif return d endfunc private: complex v[10] complex t[10] float r[10] float vx[10] float vy[10] float twopi int i float x float y float d default: title = "Convex Polygons" int param v_ConvexPolygons caption = "Version (ConvexPolygons)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_ConvexPolygons < 100 endparam int param sides caption="# of sides" default = 5 min = 3 max = 10 endparam float param scale caption = "Polygon scale" default = 1.0 endparam bool param extend caption = "Extend the sides" default = false visible = @flavor == "flavor 1" endparam param flavor caption = "Poly Shape flavor" default = 0 enum = "flavor 1" "flavor 2" "flavor 3" endparam float param sscale caption = "Poly Shape scale" default = 1.0 visible = @flavor == "flavor 1" endparam } class REB_TrapShapeStars(common.ulb:TrapShape) { ; This shape uses the Convex Polygons.
$define debug public: import "common.ulb" ; Constructor func REB_TrapShapeStars(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; call before each iteration func Init(complex pz) TrapShape.Init(pz) twopi = 2*#pi i = 0 x=0.0 y=0.0 ; create the vertex aray repeat vx[i] = sin(i*twopi/@sides) vy[i] = cos(i*twopi/@sides) v[i] = vx[i] + flip(vy[i]) i = i + 1 until i == @sides endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) i = 0 if @flavor == "flavor 1" d = 1e10 else d = 0 endif ; calculate r[i] and t[i] for first n-2 sides repeat t[i]=(5*pz/@scale-v[i])/(v[i+2]-v[i]) x=real(t[i]) y=imag(t[i]) if @extend && @flavor == "flavor 1" r[i]=abs(y) else if(x<0.0) r[i]=cabs(t[i]) elseif(x>1.0) r[i]=cabs(t[i]-1) else r[i]=abs(y) endif endif r[i]=r[i]*cabs(v[i+2]-v[i]) i = i + 1 until i == (@sides-2) ; calculate r[i] and t[i] for the last two sides t[@sides-2]=(5*pz/@scale-v[@sides-2])/(v[0]-v[@sides-2]) x=real(t[@sides-2]) y=imag(t[@sides-2]) if @extend && @flavor == "flavor 1" r[@sides-2]=abs(y) else if(x<0.0) r[@sides-2]=cabs(t[@sides-2]) elseif(x>1.0) r[@sides-2]=cabs(t[@sides-2]-1) else r[@sides-2]=abs(y) endif endif r[@sides-2]=r[@sides-2]*cabs(v[0]-v[@sides-2]) t[@sides-1]=(5*pz/@scale-v[@sides-1])/(v[1]-v[@sides-1]) x=real(t[@sides-1]) y=imag(t[@sides-1]) if @extend && @flavor == "flavor 1" r[@sides-1]=abs(y) else if(x<0.0) r[@sides-1]=cabs(t[@sides-1]) elseif(x>1.0) r[@sides-1]=cabs(t[@sides-1]-1) else r[@sides-1]=abs(y) endif endif r[@sides-1]=r[@sides-1]*cabs(v[1]-v[@sides-1]) i = 0 repeat if r[i] < d if @flavor == "flavor 1" d = r[i] endif endif m_LastZ = m_LastZ + t[i] if @flavor == "flavor 2" d = d + cabs(r[i]) elseif @flavor == "flavor 3" d = d + cabs(t[i]) endif i = i + 1 until i == @sides m_LastZ = m_LastZ/@sides^2 if @flavor != "flavor 1" d = d/@sides^2 else d = d/@sscale endif return d endfunc private: complex v[10] complex t[10] float r[10] float vx[10] float vy[10] float twopi int i float x float y float d default: title = "Stars" int param v_Stars caption = "Version (Stars)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Stars < 100 endparam int param sides caption="# of sides" default = 5 min = 5 max = 10 endparam float param scale caption = "Star scale" default = 1.0 endparam bool param extend caption = "Extend the sides" default = false visible = @flavor == "flavor 1" endparam param flavor caption = "Star Shape flavor" default = 0 enum = "flavor 1" "flavor 2" "flavor 3" endparam float param sscale caption = "Star Shape scale" default = 1.0 visible = @flavor == "flavor 1" endparam } class REB_TrapShapeCircleCatacaustic(common.ulb:TrapShape) { ; This shape uses the circle catacaustic function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCircleCatacaustic(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 float af1 = 0 float af2 = 0 complex as = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif af1 = 2*@b*(1-3*2*@b*cos(theta)+2*2*@b*cos(theta)^3)/(-(1+2*(2*@b)^2)+3*2*@b*cos(theta)) af2 = 2*(2*@b)^2*sin(theta)^3/(1+2*(2*@b)^2-3*2*@b*cos(theta)) as = @a*(af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - (as)) endif m_LastZ = as return d endfunc default: title = "Circle Catacaustic" int param v_trapshapecirclecatacaustic caption = "Version (Trap Shape Circle Catacaustic)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecirclecatacaustic < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeCruciform(common.ulb:TrapShape) { ; This shape uses the cruciform function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCruciform(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 float af1 = 0 float af2 = 0 complex as = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif af1 = 0.1*@a/cos(theta) af2 = 0.02*@b/sin(theta) as = (af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - (as)) endif m_LastZ = as return d endfunc default: title = "Cruciform" int param v_trapshapecruciform caption = "Version (Trap Shape Cruciform)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecruciform < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeCurtateCycloid(common.ulb:TrapShape) { ; This shape uses the curtate cycloid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCurtateCycloid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 complex af1 = 0 complex af2 = 0 complex as = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif af1 = @a*theta - 0.1*@b*@afn2(theta) af2 = @a - 0.1*@b*@afn1(theta) as = (af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - (as)) endif m_LastZ = as return d endfunc default: title = "Curtate Cycloid" int param v_trapshapecurtatecycloid caption = "Version (Trap Shape Curtate Cycloid)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecurtatecycloid < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam func afn1 caption = "Function #1" default = cos() endfunc func afn2 caption = "Function #2" default = sin() endfunc bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeCycloid(common.ulb:TrapShape) { ; This shape uses the cycloid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCycloid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = cabs(pz) if @absval d = abs(cabs(pz) - cabs(rr*(theta-sin(theta) + sgn*flip(rr*(1-cos(theta)))))) else d = cabs(pz - (rr*(theta-sin(theta) + sgn*flip(rr*(1-cos(theta)))))) endif m_LastZ = (rr*(theta-sin(theta) + sgn*flip(rr*(1-cos(theta))))) return d endfunc default: title = "Cycloid" int param v_trapshapecycloid caption = "Version (Trap Shape Cycloid)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecycloid < 102 endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeCycloidofSeva(common.ulb:TrapShape) { ; This shape uses the cycloid of Seva function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCycloidofSeva(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.5*@a*(1+2*cos(2*theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Cycloid of Seva" int param v_trapshapecycloidofseva caption = "Version (Trap Shape Cycloid Of Seva)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecycloidofseva < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeDeltoidCatacaustic(common.ulb:TrapShape) { ; This shape uses the deltoid catacaustic function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeDeltoidCatacaustic(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 complex af1 = 0 complex af2 = 0 complex as = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*@b) - @afn1(#pi/2*@b) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*@b) - @afn2(#pi/2*@b) as = 0.25*@a*(af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - (as)) endif m_LastZ = as return d endfunc default: title = "Deltoid Catacaustic" int param v_trapshapedeltoidcatacaustic caption = "Version (Trap Shape Deltoid Catacaustic)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapedeltoidcatacaustic < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam func afn1 caption = "Function #1" default = cos() endfunc func afn2 caption = "Function #2" default = sin() endfunc bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeDevilsCurve(common.ulb:TrapShape) { ; This shape uses the devil's curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeDevilsCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = (((0.5*@a*sin(theta))^2-(0.2*@b*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Devils Curve" int param v_trapshapedevilscurve caption = "Version (Trap Shape Devils Curve)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapedevilscurve < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeArachnida1(common.ulb:TrapShape) { ; This shape uses the arachnida 1 function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeArachnida1(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = 0 float y = 0 if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 0.25*@a*sin(@pi*theta)/sin((@pi-1)*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else x = real(pz) y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Arachnida 1" int param v_trapshapearachnida1 caption = "Version (Trap Shape Arachnida 1)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapearachnida1 < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam int param pi caption = "Polar integer" default = 3 hint = "Affects shape and scale of trap." endparam bool param wave caption = "Add petal wave" default = false endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeArachnida2(common.ulb:TrapShape) { ; This shape uses the arachnida 2 function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeArachnida2(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 0.25*@a*sin(@pi*theta)/sin((@pi+1)*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Arachnida 2" int param v_trapshapearachnida2 caption = "Version (Trap Shape Arachnida 2)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapearachnida2 < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam int param pi caption = "Polar integer" default = 3 hint = "Affects shape and scale of trap." endparam bool param wave caption = "Add petal wave" default = false endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeArchimedes(common.ulb:TrapShape) { ; This shape uses the Archimedes function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeArchimedes(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = @b+@a*theta if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Archimedes" int param v_trapshapearchimedes caption = "Version (Trap Shape Archimedes)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapearchimedes < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 0.0 hint = "Affects spiral start point" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeAtzemaSpiral(common.ulb:TrapShape) { ; This shape uses the Atzema spiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeAtzemaSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif float af1 = 0.5*@a*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) float af2 = 0.05*@b*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) complex as = (af1 + sgn*flip(af2)) IF @absval d = abs(cabs(pz) - cabs(as)) ELSE d = cabs(pz - as) ENDIF m_LastZ = as return d endfunc default: title = "Atzema Spiral" int param v_trapshapeatzemaspiral caption = "Version (Trap Shape Atzema Spiral)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeatzemaspiral < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeBicorn(common.ulb:TrapShape) { ; This shape uses the bicorn function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeBicorn(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = y^2*(@aa^2-x^2)-(x^2+2*@aa*y-@aa^2)^2+cabs(pz)*@offset else d = y^2*(@aa^2-x^2)-(x^2+2*@aa*y-@aa^2)^2+@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif float af1 = @a*sin(theta) float af2 = @a*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) complex as = (af1 + sgn*flip(af2)) IF @absval d = abs(cabs(pz) - cabs(as)) ELSE d = cabs(pz - as) ENDIF m_LastZ = as endif return d endfunc default: title = "Bicorn" int param v_trapshapebicorn caption = "Version (Trap Shape Bicorn)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapebicorn < 102 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1.25 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "Bicorn parameter" default = 1.25 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeBicuspid(common.ulb:TrapShape) { ; This shape uses the bicuspid function.
;

; This variant of the function involves taking a square root ; so there are two solutions. A signed and absolute value version of ; the distance is also available. The transformed value is the ; complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeBicuspid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = (x^2-@aa^2)*(x-@aa)^2+(y^2-@aa^2)^2+cabs(pz)*@offset else d = (x^2-@aa^2)*(x-@aa)^2+(y^2-@aa^2)^2+@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else int sgn = 1 if @sgn sgn = -1 endif y = imag(pz) float qx = 0 float qb = -2*(0.05*@b)^2 float qc = (0.05*@b)^4 - (y^2 - (0.05*@b)^2)^2 if @negroot qx = ((-qb - (qb^2 - 4*qc)^0.5)/(2))^0.5 else qx = ((-qb + (qb^2 - 4*qc)^0.5)/(2))^0.5 endif if @absval d = abs(cabs(pz) - cabs(2.25*@a*(qx + sgn*flip(y)))) else d = cabs(pz - 2.25*@a*(qx + sgn*flip(y))) endif m_LastZ = 2.25*@a*(qx + sgn*flip(y)) endif return d endfunc default: title = "Bicuspid" int param v_trapshapebicuspid caption = "Version (Trap Shape Bicuspid)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapebicuspid < 101 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "parameter a" default = 1 hint = "Affects spread and scale of trap" visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam param negroot caption = "Quad Reg Root" default = false visible = !@altformula endparam } class REB_TrapShapeRhodonea(common.ulb:TrapShape) { ; This shape uses the rhodonea function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeRhodonea(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a*sin(5*@b*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Rhodonea" int param v_Rhodonea caption = "Version (Rhodonea)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Rhodonea < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param @wave caption = "Add petal wave" default = false endparam float param @wamp caption = "Wave amplitude" default = 0.05 visible = @wave endparam float param @wfreq caption = "Wave frequency" default = 20 visible = @wave endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeCircleTangent(common.ulb:TrapShape) { ; This shape uses the Circle Tangent function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCircleTangent(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 0.5*@a*(1+@b/10*sin(theta)^(8*@c)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Circle Tangent" int param v_CircleTangent caption = "Version (Circle Tangent)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_CircleTangent < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeBifolium(common.ulb:TrapShape) { ; This shape uses the bifolium function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeBifolium(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = (x^2+y^2)^2-(x-@aa*y)*x^2-cabs(pz)*@offset else d = (x^2+y^2)^2-(x-@aa*y)*x^2-@offset endif m_lastz = x-d + flip(y-d) if abs(d) < @width d =abs(d) else d = 1e20 endif else if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 4*@a*sin(theta)*sin(theta)*cos(theta) if @v_trapshapebifolium >= 102 rr = 4*@a*sin(@c*theta)^@b*cos(theta) endif if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else x = real(pz) y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Bifolium" int param v_trapshapebifolium caption = "Version (Trap Shape Bifolium)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapebifolium < 102 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.2 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "Bifolium param" default = 5.0 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." visible = !@altformula endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = @v_trapshapebifolium >= 102 && !@altformula endparam float param c caption = "Polar parameter 2" default = 1 visible = @v_trapshapebifolium >= 102 && !@altformula endparam float param b caption = "Power" default = 2 visible = @v_trapshapebifolium >= 102 && !@altformula endparam bool param @wave caption = "Add petal wave" default = false visible = @v_trapshapebifolium >= 102 && !@altformula endparam float param @wamp caption = "Wave amplitude" default = 0.05 visible = @wave && !@altformula endparam float param @wfreq caption = "Wave frequency" default = 20 visible = @wave && !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam } class REB_TrapShapeBotanicCurve(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeBotanicCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 0.5*@a*(1 + @b*sin(@c*theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Botanic Curve" int param v_BotanicCurve caption = "Version (Botanic Curve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BotanicCurve < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "Petal Sharpness" default = 1 endparam float param c caption = "Petals" default = 10 endparam bool param @wave caption = "Add petal wave" default = false endparam float param @wamp caption = "Wave amplitude" default = 0.05 visible = @wave endparam float param @wfreq caption = "Wave frequency" default = 20 visible = @wave endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeObliqueStrophoid(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeObliqueStrophoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a*sin(@b-2*theta)/sin(@b-theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Oblique Strophoid" int param v_ObliqueStrophoid caption = "Version (Obliquev Strophoid)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_ObliqueStrophoid < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "Strophoid parameter" default = 0.5 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeFermatsSpiral(common.ulb:TrapShape) { ; This shape uses the FermatsSpiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeFermatsSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 2*@a*theta^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Fermat's Spiral" int param v_trapshapeFermatsSpiral caption = "Version (Trap Shape Fermat's Spiral)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeFermatsSpiral < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeAtomSpiral(common.ulb:TrapShape) { ; This shape uses the atom spiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeAtomSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 0.5*@a*theta/(theta + @b*0.25) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Atom Spiral" int param v_AtomSpiral caption = "Version (Atom Spiral)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_AtomSpiral < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeCevasTrisectrix(common.ulb:TrapShape) { ; This shape uses the atom spiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCevasTrisectrix(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = (x^2+y^2)^3-((@aa+1)*x^2-(@aa-1)*y^2)^2-cabs(pz)*@offset else d = (x^2+y^2)^3-((@aa+1)*x^2-(@aa-1)*y^2)^2-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 2.5*@a*(1+@b*sin(2*theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else x = real(pz) y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Ceva's Trisectrix" int param v_CevasTrisectrix caption = "Version (Ceva's Trisectrix)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_CevasTrisectrix < 100 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "parameter a" default = 2 hint = "Affects spread and scale of trap" visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam } class REB_TrapShapeHyperbolicSpiral(common.ulb:TrapShape) { ; This shape uses the HyperbolicSpiralfunction.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeHyperbolicSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a/theta if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Hyperbolic Spiral" int param v_HyperbolicSpiral caption = "Version (HyperbolicSpiral)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_HyperbolicSpiral < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeNodalCurve(common.ulb:TrapShape) { ; This shape uses the NodalCurve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeNodalCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a*tan(@b*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Nodal Curve" int param v_NodalCurve caption = "Version (NodalCurve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_NodalCurve < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeGielisCurve(common.ulb:TrapShape) { ; This shape uses the Gielis curve.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeGielisCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a*(abs(cos(2*@b*theta))^@pa + abs(sin(2*@b*theta))^@pb)^@pc if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Gielis Curve" int param v_GielisCurve caption = "Version (GielisCurve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_GielisCurve < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam float param pa caption = "Power a" default = 10.0 hint = "Affects spread and scale of trap" endparam float param pb caption = "Power b" default = 10.0 hint = "Affects spread and scale of trap" endparam float param pc caption = "Power c" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param wave caption = "Add petal wave" default = false endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeSuperSpiral(common.ulb:TrapShape) { ; This shape uses the SuperSpiral curve.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeSuperSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a*exp(0.2*@c*theta)*(abs(cos(3*@b*theta))^@pa + abs(sin(3*@b*theta))^@pb)^@pc if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Super Spiral" int param v_SuperSpiral caption = "Version (Super Spiral)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_SuperSpiral < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam float param pa caption = "Power a" default = 10.0 hint = "Affects spread and scale of trap" endparam float param pb caption = "Power b" default = 10.0 hint = "Affects spread and scale of trap" endparam float param pc caption = "Power c" default = -0.2 hint = "Affects spread and scale of trap" endparam bool param @wave caption = "Add petal wave" default = false endparam float param @wamp caption = "Wave amplitude" default = 0.05 visible = @wave endparam float param @wfreq caption = "Wave frequency" default = 20 visible = @wave endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeConchoidOfDeSluze(common.ulb:TrapShape) { ; This shape uses the ConchoidOfDeSluze function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeConchoidOfDeSluze(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale if !@cmplx x = real(@fn1(pz)) y = imag(@fn2(pz)) else x = real(@fn1(pz)) y = imag(@fn1(pz)) endif if @ref == "pz" d = x^3+x*y^2-x^2-y^2-@a1^2*x^2-cabs(pz)*@offset else d = x^3+x*y^2-x^2-y^2-@a1^2*x^2-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a*(1/cos(theta) - 1.5*@b*cos(theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Conchoid of De Sluze" int param v_ConchoidOfDeSluze caption = "Version (ConchoidOfDeSluze)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_ConchoidOfDeSluze < 100 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param a1 caption = "parameter a1" default = 2 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam bool param cmplx caption = "Apply to complex" default = false visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula && !@cmplx endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam } class REB_TrapShapeEpitrochoid(common.ulb:TrapShape) { ; This shape uses the Epitrochoid function.
public: import "common.ulb" ; Constructor func REB_TrapShapeEpitrochoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@scale float x = (@a*2.5+@b*0.6)*cos(t) - 1.3*@c*cos((2.5*@a/(@b*0.6)+1)*t) float y = (@a*2.5+@b*0.6)*sin(t) - 1.3*@c*sin((2.5*@a/(@b*0.6)+1)*t) m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Epitrochoid" int param v_Epitrochoid caption = "Version (Epitrochoid)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Epitrochoid < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param scale caption = "Scale" default = 1.0 endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam } class REB_TrapShapeCornoid(common.ulb:TrapShape) { ; This shape uses the Cornoid function.
public: import "common.ulb" ; Constructor func REB_TrapShapeCornoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave && @partype == "angle" float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@b*10 float x = @a*cos(t)*(1-2*sin(t)^2) float y = @a*sin(t)*(1+2*cos(t)^2) m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Cornoid" int param v_Cornoid caption = "Version (Cornoid)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Cornoid < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam bool param wave caption = "Add petal wave" default = false visible = @partype == "angle" endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave && @partype == "angle" endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave && @partype == "angle" endparam } class REB_TrapShapeResonanceCurve(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_ResonanceCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave && @partype == "angle" float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@b*10 float x = @a*tan(t) float y = @a*cos(t)^2 m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Resonance Curve" int param v_ResonanceCurve caption = "Version (Resonance Curve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_ResonanceCurve < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam bool param wave caption = "Add petal wave" default = false visible = @partype == "angle" endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave && @partype == "angle" endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave && @partype == "angle" endparam } class REB_TrapShapeInfiniteQuadrifolium(common.ulb:TrapShape) { ; This shape uses the InfiniteQuadrifolium function.
public: import "common.ulb" ; Constructor func REB_TrapShapeInfiniteQuadrifolium(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@b*6.28 float x = 2*@a*(t^3-t)*(t-1)/(t^3+1)^2 float y = 2*@a*(t^3-t)*(t+1)/(t^3+1)^2 m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Infinite Quadrifolium" int param v_InfiniteQuadrifolium caption = "Version (Infinite Quadrifolium)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_InfiniteQuadrifolium < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam } class REB_TrapShapeLegendre(common.ulb:TrapShape) { ; This shape uses the Legendre function.
public: import "common.ulb" ; Constructor func REB_TrapShapeLegendre(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave && @partype == "angle" float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float d = 0 float t = 0 float x = 0 float y = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@b if @n == "2" y = 5*@a*(3*sin(t)^2 - 1)/2 x = 5*@a*(3*cos(t)^2 - 1)/2 elseif @n == "3" y = 5*@a*(5*sin(t)^3 - 3*sin(t))/2 x = 5*@a*(5*cos(t)^3 - 3*cos(t))/2 elseif @n == "4" y = 5*@a*(35*sin(t)^4 - 30*sin(t)^2 + 3)/8 x = 5*@a*(35*cos(t)^4 - 30*cos(t)^2 + 3)/8 elseif @n == "5" y = 5*@a*(63*sin(t)^5 - 70*sin(t)^3 + 15*sin(t))/8 x = 5*@a*(63*cos(t)^5 - 70*cos(t)^3 + 15*cos(t))/8 elseif @n == "6" y = 5*@a*(231*sin(t)^6 - 315*sin(t)^4 + 105*sin(t)^2 -5)/16 x = 5*@a*(231*cos(t)^6 - 315*cos(t)^4 + 105*cos(t)^2 -5)/16 endif m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Legendre" int param v_Legendre caption = "Version (Legendre)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Legendre < 100 endparam param n caption = "Legendre number" default = 0 enum = "2" "3" "4" "5" "6" endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam bool param wave caption = "Add petal wave" default = false visible = @partype == "angle" endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave && @partype == "angle" endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave && @partype == "angle" endparam } class REB_TrapShapeLaguerre(common.ulb:TrapShape) { ; This shape uses the Laguerre function.
public: import "common.ulb" ; Constructor func REB_TrapShapeLaguerre(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave && @partype == "angle" float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float d = 0 float t = 0 float x = 0 float y = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@b*5 if @n == "2" y = @a*(Sin(t)^2 - 4*sin(t) + 2)/2 x = @a*(cos(t)^2 - 4*cos(t) + 2)/2 elseif @n == "3" y = @a*(-sin(t)^3 + 9*sin(t)^2 - 18*sin(t) + 6)/6 x = @a*(-cos(t)^3 + 9*cos(t)^2 - 18*cos(t) + 6)/6 elseif @n == "4" y = @a*(sin(t)^4 - 16*sin(t)^3 + 72*sin(t)^2 - 96*sin(t) + 24)/24 x = @a*(cos(t)^4 - 16*cos(t)^3 + 72*cos(t)^2 - 96*cos(t) + 24)/24 elseif @n == "5" y = @a*(-sin(t)^5 + 25*sin(t)^4 - 200*sin(t)^3 + 600*sin(t)^2 - 600*sin(t) + 120)/120 x = @a*(-cos(t)^5 + 25*cos(t)^4 - 200*cos(t)^3 + 600*cos(t)^2 - 600*cos(t) + 120)/120 elseif @n == "6" y = @a*(sin(t)^6 - 36*sin(t)^5 + 450*sin(t)^4 - 2400*sin(t)^3 + 5400*sin(t)^2 \ -4320*sin(t) + 720)/720 x = @a*(cos(t)^6 - 36*cos(t)^5 + 450*cos(t)^4 - 2400*cos(t)^3 + 5400*cos(t)^2 \ -4320*cos(t) + 720)/720 endif m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Laguerre" int param v_Laguerre caption = "Version (Laguerre)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Laguerre < 100 endparam param n caption = "Laguerre number" default = 0 enum = "2" "3" "4" "5" "6" endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam bool param wave caption = "Add petal wave" default = false visible = @partype == "angle" endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave && @partype == "angle" endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave && @partype == "angle" endparam } class REB_TrapShapeHermite(common.ulb:TrapShape) { ; This shape uses the Hermite function.
public: import "common.ulb" ; Constructor func REB_TrapShapeHermite(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave && @partype == "angle" float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float d = 0 float t = 0 float x = 0 float y = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@b if @htype == 0 if @n == "2" x = @a*(cos(t)^2 - 1) y = @a*(sin(t)^2 - 1) elseif @n == "3" x = @a*(cos(t)^3 - 3*cos(t))/3 y = @a*(sin(t)^3 - 3*sin(t))/3 elseif @n == "4" x = @a*(cos(t)^4 - 6*cos(t)^2 + 3)/3 y = @a*(sin(t)^4 - 6*sin(t)^2 + 3)/3 elseif @n == "5" x = @a*(cos(t)^5 - 10*cos(t)^3 + 15*cos(t))/15 y = @a*(sin(t)^5 - 10*sin(t)^3 + 15*sin(t))/15 elseif @n == "6" x = @a*(cos(t)^6 - 15*cos(t)^4 + 45*cos(t)^2 - 15)/15 y = @a*(sin(t)^6 - 15*sin(t)^4 + 45*sin(t)^2 - 15)/15 elseif @n == "7" x = @a*(cos(t)^7 - 21*cos(t)^5 + 105*cos(t)^3 - 105*cos(t))/105 y = @a*(sin(t)^7 - 21*sin(t)^5 + 105*sin(t)^3 - 105*sin(t))/105 elseif @n == "8" x = @a*(cos(t)^8 - 28*cos(t)^6 + 210*cos(t)^4 - 420*cos(t)^2 + 105)/105 y = @a*(sin(t)^8 - 28*sin(t)^6 + 210*sin(t)^4 - 420*sin(t)^2 + 105)/105 elseif @n == "9" x = @a*(cos(t)^9 - 36*cos(t)^7 + 378*cos(t)^5 - 1260*cos(t)^3 + 945*cos(t))/945 y = @a*(sin(t)^9 - 36*sin(t)^7 + 378*sin(t)^5 - 1260*sin(t)^3 + 945*sin(t))/945 elseif @n == "10" x = @a*(cos(t)^10 - 45*cos(t)^8 + 630*cos(t)^6 - 3150*cos(t)^4 + 4275*cos(t)^2 - 945)/945 y = @a*(sin(t)^10 - 45*sin(t)^8 + 630*sin(t)^6 - 3150*sin(t)^4 + 4275*sin(t)^2 - 945)/945 endif else if @n == "2" x = @a*4*(cos(t)^2 - 2)/2 y = @a*4*(sin(t)^2 - 2)/2 elseif @n == "3" x = @a*8*(cos(t)^3 - 12*cos(t))/144 y = @a*8*(sin(t)^3 - 12*sin(t))/144 elseif @n == "4" x = @a*16*(cos(t)^4 - 48*cos(t)^2 + 12)/288 y = @a*16*(sin(t)^4 - 48*sin(t)^2 + 12)/288 elseif @n == "5" x = @a*32*(cos(t)^5 - 160*cos(t)^3 + 120*cos(t))/2880 y = @a*32*(sin(t)^5 - 160*sin(t)^3 + 120*sin(t))/2880 elseif @n == "6" x = @a*64*(cos(t)^6 - 480*cos(t)^4 + 720*cos(t)^2 - 120)/14400 y = @a*64*(sin(t)^6 - 480*sin(t)^4 + 720*sin(t)^2 - 120)/14400 elseif @n == "7" x = @a*128*(cos(t)^7 - 1344*cos(t)^5 + 3360*cos(t)^3 - 1680*cos(t))/113000 y = @a*128*(sin(t)^7 - 1344*sin(t)^5 + 3360*sin(t)^3 - 1680*sin(t))/113000 elseif @n == "8" x = @a*256*(cos(t)^8 - 3584*cos(t)^6 + 13440*cos(t)^4 - 13440*cos(t)^2 + 1680)/564480 y = @a*256*(sin(t)^8 - 3584*sin(t)^6 + 13440*sin(t)^4 - 13440*sin(t)^2 + 1680)/564480 elseif @n == "9" x = @a*512*(cos(t)^9 - 9216*cos(t)^7 + 48384*cos(t)^5 - 80640*cos(t)^3 + 30240*cos(t))/1e7 y = @a*512*(sin(t)^9 - 9216*sin(t)^7 + 48384*sin(t)^5 - 80640*sin(t)^3 + 30240*sin(t))/1e7 elseif @n == "10" x = @a*1024*(cos(t)^10 - 23040*cos(t)^8 + 161280*cos(t)^6 - 403200*cos(t)^4 + 302400*cos(t)^2 - 20340)/1e8 y = @a*1024*(sin(t)^10 - 23040*sin(t)^8 + 161280*sin(t)^6 - 403200*sin(t)^4 + 302400*sin(t)^2 - 20340)/1e8 endif endif m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Hermite" int param v_Hermite caption = "Version (Hermite)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Hermite < 100 endparam param n caption = "Hermite number" default = 0 enum = "2" "3" "4" "5" "6" "7" "8" "9" "10" endparam param htype caption = "Hermite type" default = 0 enum = "probabilist" "physicist" endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam bool param wave caption = "Add petal wave" default = false visible = @partype == "angle" endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave && @partype == "angle" endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave && @partype == "angle" endparam } class REB_TrapShapeChebychev(common.ulb:TrapShape) { ; This shape uses the Chebychev function.
public: import "common.ulb" ; Constructor func REB_TrapShapeChebychev(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = 0 float x = 0 float y = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@b*5 y = @a*cos(@n*acos(sin(t))) x = @a*cos(@n*acos(cos(t))) m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Chebychev" int param v_Chebychev caption = "Version (Chebychev)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Chebychev < 100 endparam int param n caption = "Chebychev number" default = 2 min = 2 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam } class REB_TrapShapeLissajous(common.ulb:TrapShape) { ; This shape uses the Lissajous function.
public: import "common.ulb" ; Constructor func REB_TrapShapeLissajous(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = @scale*t float x = 2.5*@a*sin(t) float y = 2.5*@a*sin(10*@b*t+@c) m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Lissajous" int param v_Lissajous caption = "Version (Lissajous)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Lissajous < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param scale caption = "Param scale" default = 1.0 endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam } class REB_TrapShapeHypotrochoid(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeHypotrochoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t *@scale float x = (@a*6-@b*0.3)*cos(t) + 1.3*@c*cos((6*@a/(@b*0.3)-1)*t) float y = (@a*6-@b*0.3)*sin(t) - 1.3*@c*sin((6*@a/(@b*0.3)-1)*t) m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Hypotrochoid" int param v_Hypotrochoid caption = "Version (Hypotrochoid)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Hypotrochoid < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param scale caption = "Scale" default = 1.0 endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam } class REB_TrapShapeHypocycloid(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeHypocycloid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave && @partype == "angle" float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t *@scale float x = @a*((1-@b*3)*cos(3*@b*t)+3*@b*@c*cos((1-3*@b)*t)) float y = @a*((1-@b*3)*sin(3*@b*t)-3*@b*@c*sin((1-3*@b)*t)) m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Hypocycloid" int param v_Hypocycloid caption = "Version (v)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Hypocycloid < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param scale caption = "Scale" default = 1.0 endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam bool param wave caption = "Add petal wave" default = false visible = @partype == "angle" endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave && @partype == "angle" endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave && @partype == "angle" endparam } class REB_TrapShapePlateauCurve(common.ulb:TrapShape) { ; This shape uses the Plateau Curve function.
public: import "common.ulb" ; Constructor func REB_TrapShapePlateauCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = 0 if @partype == "cabs(z)" t = cabs(pz) elseif @partype == "real(z)" t = real(pz) elseif @partype == "imag(z)" t = imag(pz) elseif @partype == "real(z) + imag(z)" t = real(pz) + imag(pz) elseif @partype == "real(z) * imag(z)" t = real(pz) * imag(pz) elseif @partype == "angle" t = atan2(pz) endif t = t*@scale float x = @a*sin((1+@b*1.2)*t)/sin((1-@b*1.2)*t) float y = @a*sin(t)*sin(@b*1.2*t)/sin((1-@b*1.2)*t) m_LastZ = x + flip(y) d = cabs(pz-m_LastZ) return d endfunc default: title = "Plateau Curve" int param v_PlateauCurve caption = "Version (PlateauCurve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_PlateauCurve < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam float param scale caption = "Scale" default = 1.0 endparam param partype caption = "Param Type" default = 0 enum = "cabs(z)" "real(z)" "imag(z)" "real(z) + imag(z)" "real(z) * imag(z)" \ "angle" endparam } class REB_TrapShapeEquiangularSpiral(common.ulb:TrapShape) { ; This shape uses the Equiangular Spiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeEquiangularSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a*exp(theta*cotan(@b/2)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Equiangular Spiral" int param v_EquiangularSpiral caption = "Version (Equiangular Spiral)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_EquiangularSpiral < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeFreethsNephroid(common.ulb:TrapShape) { ; This shape uses the bifolium function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeFreethsNephroid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 0.5*@a*(1+2*sin(theta/2)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Freeth's Nephroid" int param v_FreethsNephroid caption = "Version (FreethsNephroid)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_FreethsNephroid < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeSinusoidalSpiral(common.ulb:TrapShape) { ; This shape uses the Sinusoidal Spiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeSinusoidalSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = @a*(cos(2*@b*theta))^1/(2*@b) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Sinusoidal Spiral" int param v_SinusoidalSpiral caption = "Version (SinusoidalSpiral)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_SinusoidalSpiral < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeBow(common.ulb:TrapShape) { ; This shape uses the bow function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeBow(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = x^4-x^2*y+y^3-cabs(pz)*@offset else d = x^4-x^2*y+y^3-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else int sgn = 1 if @sgn sgn = -1 endif float theta = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif float af1 = 0.1*@a*(1-tan(theta)^2)*cos(theta) float af2 = 0.1*@b*(1-tan(theta)^2)*sin(theta) complex as = (af1 + sgn*flip(af2)) IF @absval d = abs(cabs(pz) - cabs(as)) ELSE d = cabs(pz - as) ENDIF m_LastZ = as endif return d endfunc default: title = "Bow" int param v_trapshapebow caption = "Version (Trap Shape Bow)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapebow < 102 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.2 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeButterfly(common.ulb:TrapShape) { ; This shape uses the butterfly function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeButterfly(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = y^6+x^6-x^2-cabs(pz)*@offset else d = y^6+x^6-x^2-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else float theta = 0 d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = 0.25*@a*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else x = real(pz) y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Butterfly" int param v_trapshapebutterfly caption = "Version (Trap Shape Butterfly)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapebutterfly < 102 endparam heading text = "The 'Alternate formula' is a sextic polynomial form while the regular form\ is exponential and uses trigometric functions." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeCapricornoid(common.ulb:TrapShape) { ; This shape uses the Capricornoid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCapricornoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = @aa^2*(x^4+x^2*y^2)-@ab*(x^4+y^4)-@ab*(2*x^2*y^2-2*@aa*y^3+@aa^2*y^2-2*@aa*x^2*y) -cabs(pz)*@offset else d = @aa^2*(x^4+x^2*y^2)-@ab*(x^4+y^4)-@ab*(2*x^2*y^2-2*@aa*y^3+@aa^2*y^2-2*@aa*x^2*y)-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = 0.5*@a*sin(theta)/(0.5*@b + 0.35*@c*cos(theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else x = real(pz) y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Capricornoid" int param v_Capricornoid caption = "Version (Trap Shape Capricornoid)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Capricornoid < 100 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "parameter a" default = 1.5 hint = "Affects spread and scale of trap" visible = @altformula endparam float param ab caption = "parameter b" default = 3 hint = "Affects spread and scale of trap" visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param c caption = "3rd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeBulletNose(common.ulb:TrapShape) { ; This shape uses the Bullet Nose function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeBulletNose(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = @aa^2*y^2-@ab^2*x^2-x^2*y^2+cabs(pz)*@offset else d = @aa^2*y^2-@ab^2*x^2-x^2*y^2+@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile x = r * cos(wtheta) y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = 0.25*@a*(@b^2*sin(theta)^2-(2*@c)^2*cos(theta)^2)^0.5/(sin(theta)*cos(theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else x = real(pz) y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Bullet Nose" int param v_BulletNose caption = "Version (Trap Shape Bullet Nose)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BulletNose < 100 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.7 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "parameter a" default = 1 visible = @altformula endparam float param ab caption = "parameter b" default = 1 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param c caption = "3rd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param wave caption = "Add petal wave" default = false visible = !@altformula endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave && !@altformula endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave && !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeTrott(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeTrott(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = 144*(x^4+y^4)-225*(x^2+y^2)+350*x^2*y^2+81-cabs(pz)*@offset else d = 144*(x^4+y^4)-225*(x^2+y^2)+350*x^2*y^2+81-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif return d endfunc default: title = "Trott" int param v_Trott caption = "Version (Trap Shape Trott)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Trott < 100 endparam float param scale caption = "scale" default = 1 endparam float param width caption = "width" default = 1 endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" endparam func fn1 caption = "Function 1" default = ident() endfunc func fn2 caption = "Function 2" default = ident() endfunc } class REB_TrapShapeWattsCurve(common.ulb:TrapShape) { ; This shape uses the Watts Curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeWattsCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = @a*(1- @b*(sin(theta) + (@c-cos(theta)^2)^0.5)^2)^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Watts Curve" int param v_WattsCurve caption = "Version (Watts Curve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_WattsCurve < 100 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeCardioid(common.ulb:TrapShape) { ; This shape uses the cardiod function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCardioid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = (x^2+y^2-2*@aa*x)^2-4*@aa^2*(x^2+y^2)-cabs(pz)*@offset else d = (x^2+y^2-2*@aa*x)^2-4*@aa^2*(x^2+y^2)-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = @a*(1-cos(theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Cardioid" int param v_trapshapecardioid caption = "Version (Trap Shape Cardioid)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecardioid < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.5 visible = @altformula endparam float param width caption = "width" default = 4 visible = @altformula endparam float param aa caption = "parameter a" default = 0.75 hint = "Affects spread and scale of trap" visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeCassiniOvals(common.ulb:TrapShape) { ; This shape uses the Cassini ovals function.
;

; This variant of the function involves taking a square root ; so there are two solutions. A signed and absolute value version of ; the distance is also available. The transformed value is the ; complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCassiniOvals(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = x^4+y^4+2*x^2*y^2-2*@aa^2*x^2+2*@aa^2*y^2+@aa^4-@ab^4-cabs(pz)*@offset else d = x^4+y^4+2*x^2*y^2-2*@aa^2*x^2+2*@aa^2*y^2+@aa^4-@ab^4-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif if @negroot rr = 0.5*@a*(cos(2*theta)-((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*@a*(cos(2*theta)+((@b*0.1/(@a*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) endif return d endfunc default: title = "Cassini Ovals" int param v_trapshapecassiniovals caption = "Version (Trap Shape Cassini Ovals)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecassiniovals < 102 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "parameter a" default = 1 hint = "Affects spread and scale of trap" visible = @altformula endparam float param ab caption = "parameter b" default = 1.0 hint = "Affects spread and scale of trap" visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam param negroot caption = "Quad Neg Root" default = false visible = !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeCayleysSextic(common.ulb:TrapShape) { ; This shape uses the Cayley's sextic function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCayleysSextic(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = -@aa^3*x^3-48*@aa*x*(x^2+y^2)^2+64*(x^2+y^2)^3-3*@aa^2*(x^2+y^2)*(5*x^2+9*y^2)-cabs(pz)*@offset else d = -@aa^3*x^3-48*@aa*x*(x^2+y^2)^2+64*(x^2+y^2)^3-3*@aa^2*(x^2+y^2)*(5*x^2+9*y^2)-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 1.5*@a*cos(theta)^3 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Cayley's Sextic" int param v_trapshapecayleyssextic caption = "Version (Trap Shape Cayley's Sextic)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecayleyssextic < 101 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "parameter a" default = 1 hint = "Affects spread and scale of trap" visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam } class REB_TrapShapeCissoidofDiocles(common.ulb:TrapShape) { ; This shape uses the cissoid of Diocles function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCissoidofDiocles(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = x*(x^2+y^2)-2*@aa*y^2-cabs(pz)*@offset else d = x*(x^2+y^2)-2*@aa*y^2-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif float rr = 0.2*@a*sin(theta)*tan(theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else x = real(pz) y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Cissoid of Diocles" int param v_trapshapecissoidofdiocles caption = "Version (Trap Shape Cissoid Of Diocles)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecissoidofdiocles < 101 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 1 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "parameter a" default = 1 hint = "Affects spread and scale of trap" visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam } class REB_TrapShapeCochleoid(common.ulb:TrapShape) { ; This shape uses the cochleoid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCochleoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = 1.25*@a*sin(theta)/theta if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Cochleoid" int param v_trapshapecochleoid caption = "Version (Trap Shape Cochleoid)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecochleoid < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeHeartCurve(common.ulb:TrapShape) { ; This shape uses the Heart Curve function.
public: import "common.ulb" ; Constructor func REB_TrapShapeHeartCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = (7.5*@a*atan2(pz))%1 float x = 0.33*@b*sin(t)*cos(t)*log(abs(t)) float y = 0.33*@b*abs(t)^0.3*cos(t)^0.5 m_lastZ = x + flip(y) d = cabs(pz-m_lastZ) return d endfunc default: title = "Heart Curve" int param v_HeartCurve caption = "Version (HeartCurve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_HeartCurve < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam } class REB_TrapShapeAtriphtaloid(common.ulb:TrapShape) { ; This shape uses the Atriphtaloid function.
public: import "common.ulb" ; Constructor func REB_TrapShapeAtriphtaloid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = x^4*(x^2+y^2)-(@ps*@aa*x^2-@ps*@ab)^2+cabs(pz)*@offset else d = x^4*(x^2+y^2)-(@ps*@aa*x^2-@ps*@ab)^2+@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else x = real(pz) y = (-x^2+(100*@b)^2-100*@b*@c/x^2+ (0.5*@c)^2/x^4)^0.5 m_lastZ = 0.005*@a*(x + flip(y)) d = cabs(pz-m_lastZ) endif return d endfunc default: title = "Atriphtaloid" int param v_Atriphtaloid caption = "Version (Atriphtaloid)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Atriphtaloid < 100 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.2 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param aa caption = "parameter a" default = 5 hint = "Affects spread and scale of trap" visible = @altformula endparam float param ab caption = "parameter b" default = 1.0 hint = "Affects spread and scale of trap" visible = @altformula endparam float param ps caption = "param scaler" default = 0.4 hint = "Affects spread and scale of trap" visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param c caption = "3rd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam } class REB_TrapShapeBurnsideCurve(common.ulb:TrapShape) { ; This shape uses the Burnside Curve function.
public: import "common.ulb" ; Constructor func REB_TrapShapeBurnsideCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale ; pz = pz*(cos(rotangle)+flip(sin(rotangle))) x = real(@fn1(pz)) y = imag(@fn2(pz)) if @ref == "pz" d = y^2-x*(x^4-@a1)-cabs(pz)*@offset else d = y^2-x*(x^4-@a1)-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else x = real(pz) y = (x^5 - x)^0.5 m_lastZ = 2*@a*(x + flip(y)) d = cabs(pz-m_lastZ) endif return d endfunc default: title = "Burnside Curve" int param v_BurnsideCurve caption = "Version (BurnsideCurve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_BurnsideCurve < 100 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.25 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam float param a1 caption = "parameter a" default = 1 visible = @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam } class REB_TrapShapeKleinQuartic(common.ulb:TrapShape) { ; This shape uses the KleinQuartic function.
public: import "common.ulb" ; Constructor func REB_TrapShapeKleinQuartic(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float x = real(pz) float y = (-x/2+(x^2/4+x^9/27)^0.5)^(1/3)+(-x/2-(x^2/4+x^9/27)^0.5)^(1/3) m_lastZ = @a*(x + flip(y)) float d = cabs(pz-m_lastZ) return d endfunc default: title = "Klein Quartic" int param v_KleinQuartic caption = "Version (Klein Quartic)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_KleinQuartic < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam } class REB_TrapShapeTrochoid(common.ulb:TrapShape) { ; This shape uses the Trochoid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeTrochoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float theta = atan2(pz) float x = @a*(@b*theta-@c*sin(theta)) float y = @a*(@b-@c*cos(theta)) m_lastZ = x + flip(y) d = cabs(pz-m_lastZ) return d endfunc default: title = "Trochoid" int param v_Trochoid caption = "Version (Trochoid)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_Trochoid < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam } class REB_TrapShapeFishCurve(common.ulb:TrapShape) { ; This shape uses the Heart Curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeFishCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float t = 5*@a*atan2(pz) float x = @b*(cos(t) - sin(t)^2/sqrt(2)) float y = @b*cos(t)*sin(t) m_lastZ = x + flip(y) d = cabs(pz-m_lastZ) return d endfunc default: title = "Fish Curve" int param v_FishCurve caption = "Version (FishCurve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_FishCurve < 100 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam } class REB_TrapShapeConchoid(common.ulb:TrapShape) { ; This shape uses the conchoid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeConchoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = 0.1*(@a + @b*cos(theta))/cos(theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Conchoid" int param v_trapshapeconchoid caption = "Version (Trap Shape Conchoid)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeconchoid < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeCotesSpiral(common.ulb:TrapShape) { ; This shape uses the Cote's spiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeCotesSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif float rr = @a/cosh(@b*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Cotes' Spiral" int param v_trapshapecotesspiral caption = "Version (Trap Shape Cotes' Spiral)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapecotesspiral < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeDiamond(common.ulb:TrapShape) { ; This shape uses the diamond function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeDiamond(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 if @absval d = abs(cabs(pz) - cabs(@a*@adfn(abs((real(pz)*@adj1))+sgn*abs((flip(imag(pz))^@adj2))-1))) else d = cabs(pz - @a*@adfn(abs((real(pz)*@adj1))+sgn*abs((flip(imag(pz))^@adj2))-1)) endif m_LastZ = (@a*@adfn(abs((real(pz)*@adj1))+sgn*abs((flip(imag(pz))^@adj2))-1)) return d endfunc default: title = "Diamond" int param v_trapshapediamond caption = "Version (Trap Shape Diamond)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapediamond < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param adj1 caption = "Adjuster 1" default = 10.0 hint = "Affects spread and scale of trap" endparam float param adj2 caption = "Adjuster 2" default = 1.0 hint = "Affects spread and scale of trap" endparam func adfn caption = "Adjuster function" default = ident() endfunc bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeDipoleCurve(common.ulb:TrapShape) { ; This shape uses the dipole function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeDipoleCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a*(cos(theta))^2 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Dipole Curve" int param v_trapshapedipolecurve caption = "Version (Trap Shape Dipole Curve)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapedipolecurve < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeDumbellCurve(common.ulb:TrapShape) { ; This shape uses the dumbell function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeDumbellCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float cx = 0 float cy = 0 float d = 0 cx = real(pz) cy = (cx^4-cx^6)^0.5 if @absval d = abs(cabs(pz) - cabs(4*@a*(cx + sgn*flip(cy)))) else d = cabs(pz - 4*@a*(cx + sgn*flip(cy))) endif m_LastZ = 4*@a*(cx + sgn*flip(cy)) return d endfunc default: title = "Dumbell Curve" int param v_trapshapedumbellcurve caption = "Version (Trap Shape Dumbell Curve)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapedumbellcurve < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeEightCurve(common.ulb:TrapShape) { ; This shape uses the eight function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeEightCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a*cos(theta)^(-2)*cos(2*theta)^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Eight Curve" int param v_trapshapeeightcurve caption = "Version (Trap Shape Eight Curve)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeeightcurve < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeEllipseCatacaustic(common.ulb:TrapShape) { ; This shape uses the ellipse catacaustic function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeEllipseCatacaustic(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif complex af1 = 4*@a*(@a-@b)*(@a*@b)*sin(theta)^3/(@a^2+@b^2+(@b^2-@a^2)*cos(2*theta)) complex af2 = 4*@b*(@b^2-@a^2)*cos(theta)^3/(@a^2+@b^2+3*(@b^2-@a^2)*cos(2*theta)) complex as = 0.1*(af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - as) endif m_LastZ = as return d endfunc default: title = "Ellipse Catacaustic" int param v_trapshapeellipsecatacaustic caption = "Version (Trap Shape Ellipse Catacaustic)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeellipsecatacaustic < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeEllipseEvolute(common.ulb:TrapShape) { ; This shape uses the ellipse evolute function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeEllipseEvolute(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif complex af1 = (@a^2-(0.7*@b)^2)/@a*@afn1(theta)^(real(@pwr)) complex af2 = ((0.7*@b)^2-@a^2)/(0.7*@b)*@afn2(theta)^(imag(@pwr)) complex as = 0.1*(af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - as) endif m_LastZ = as return d endfunc default: title = "Ellipse Evolute" int param v_trapshapeellipseevolute caption = "Version (Trap Shape Ellipse Evolute)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeellipseevolute < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam complex param pwr caption = "Power" default = (3,3) hint = "Affects shape and scale of trap." endparam func afn1 caption = "Function #1" default = cos() endfunc func afn2 caption = "Function #2" default = sin() endfunc bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeEpicycloid(common.ulb:TrapShape) { ; This shape uses the epicycloid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeEpicycloid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif complex af1 = (5*@a+@b)*@afn1(theta) - @b*@afn1((5*@a+@b)*theta/@b) complex af2 = (5*@a+@b)*@afn2(theta) - @b*@afn2((5*@a+@b)*theta/@b) complex as = 0.1*(af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - as) endif m_LastZ = as return d endfunc default: title = "Epicycloid" int param v_trapshapeepicycloid caption = "Version (Trap Shape Epicycloid)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeepicycloid < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam func afn1 caption = "Function #1" default = cos() endfunc func afn2 caption = "Function #2" default = sin() endfunc bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeEpispiral(common.ulb:TrapShape) { ; This shape uses the epispiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeEpispiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif rr = 0.25*@a/cos(@pn*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Epispiral" int param v_trapshapeepispiral caption = "Version (Trap Shape Epispiral)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeepispiral < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam int param pn caption = "Polar integer" default = 3 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeFoliumOfDescartes(common.ulb:TrapShape) { ; This shape uses the folium of Descartes function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeFoliumOfDescartes(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif rr = 0.3*@a*tan(theta)/(cos(theta)*(1+tan(theta)^3)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Folium Of Descartes" int param v_trapshapefoliumofdescartes caption = "Version (Trap Shape Folium Of Descartes)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapefoliumofdescartes < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeGearCurve(common.ulb:TrapShape) { ; This shape uses the gear curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeGearCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif complex af1 = (0.25*@a+1/(5*@b)*tanh(5*@b*sin(@pn*theta)))*cos(theta) complex af2 = (0.25*@a+1/(5*@b)*tanh(5*@b*sin(@pn*theta)))*sin(theta) complex as = (af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - as) endif m_LastZ = as return d endfunc default: title = "Gear Curve" int param v_trapshapegearcurve caption = "Version (Trap Shape Gear Curve)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapegearcurve < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam int param pn caption = "Polar integer" default = 3 hint = "Affects spread and scale of trap" endparam bool param wave caption = "Add petal wave" default = false endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeHipopede(common.ulb:TrapShape) { ; This shape uses the hipopede function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeHipopede(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = (0.5*@b*(0.5*@a-(0.5*@b)^2*cos(theta)))^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Hipopede" int param v_trapshapehipopede caption = "Version (Trap Shape Hipopede)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapehipopede < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeHyperbola(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeHyperbola(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.35*@a*(1/cos(2*theta))^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Hyperbola REB" int param v_trapshapehyperbolareb caption = "Version (Trap Shape Hyperbola REB)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapehyperbolareb < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeKampyleofEudoxus(common.ulb:TrapShape) { ; This shape uses the kampyle of Eudoxus function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeKampyleofEudoxus(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.02*@a/cos(theta)^2 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Kampyle of Eudoxus" int param v_trapshapekampyleofeudoxus caption = "Version (Trap Shape Kampyle Of Eudoxus)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapekampyleofeudoxus < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeKappaCurve(common.ulb:TrapShape) { ; This shape uses the kapp a curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeKappaCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.1*@a*tan(theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Kappa Curve" int param v_trapshapekappacurve caption = "Version (Trap Shape Kappa Curve)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapekappacurve < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeKeratoidCusp(common.ulb:TrapShape) { ; This shape uses the keratoid cusp function.
;

; This variant of the function involves taking a square root ; so there are two solutions. A signed and absolute value version of ; the distance is also available. The transformed value is the ; complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeKeratoidCusp(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float d = 0 complex cx = real(pz) complex qa = 1 complex qb = -cx^2 complex qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif if @absval == true d = abs(cabs(pz) - cabs(2.5*@a*(cx + sgn*flip(qy)))) else d = cabs(pz - 2.5*@a*(cx + sgn*flip(qy))) endif m_LastZ = 2.5*@a*(cx + sgn*flip(qy)) return d endfunc default: title = "Keratoid Cusp" int param v_trapshapekeratoidcusp caption = "Version (Trap Shape Keratoid Cusp)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapekeratoidcusp < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam param negroot caption = "Quad Neg Root" default = true endparam } class REB_TrapShapeKnotCurve(common.ulb:TrapShape) { ; This shape uses the knot curve function.
;

; This variant of the function involves taking a square root ; so there are two solutions. A signed and absolute value version of ; the distance is also available. The transformed value is the ; complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeKnotCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula x = real(@fn1(pz)) y = imag(@fn2(pz)) d = (x^2-1)^2-y^2*(2*y+3)+@offset d = abs(d) else int sgn = 1 if @sgn sgn = -1 endif complex cy = imag(pz) complex qx = 0 complex qa = 1 complex qb = -2 complex qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif if @absval == true d = abs(cabs(pz) - cabs(@a*(qx + sgn*flip(cy)))) else d = cabs(pz - @a*(qx + sgn*flip(cy))) endif m_LastZ = @a*(qx + sgn*flip(cy)) endif return d endfunc default: title = "KnotCurve" int param v_trapshapeknotcurve caption = "Version (Trap Shape Knot Curve)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeknotcurve < 101 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula endfunc float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@altformula endparam param negroot caption = "Quad Neg Root" default = true visible = !@altformula endparam } class REB_TrapShapeLemniscate(common.ulb:TrapShape) { ; This shape uses the lemniscate function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeLemniscate(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a*(cos(2*theta))^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Lemniscate" int param v_trapshapelemniscate caption = "Version (Trap Shape Lemniscate)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapelemniscate < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeArcsOfSamothrace(common.ulb:TrapShape) { ; This shape uses the lemniscate function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeArcsOfSamothrace(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float x = 0 float y = 0 if @altformula pz = pz/@scale if !@cmplx x = real(@fn1(pz)) y = imag(@fn2(pz)) else x = real(@fn1(pz)) y = imag(@fn1(pz)) endif if @ref == "pz" d = x^2*(@a1*x^2-@a2*y^2)^2-y^2*(x^2+y^2)-cabs(pz)*@offset else d = x^2*(@a1*x^2-@a2*y^2)^2-y^2*(x^2+y^2)-@offset endif if abs(d) < @width d =abs(d) else d = 1e20 endif else if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a*tan(theta)/(1+4*@b*cos(1.25*@c*theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else x = real(pz) y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif endif return d endfunc default: title = "Arcs of Samothrace" int param v_ArcsOfSamothrace caption = "Version (ArcsOfSamothrace)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_ArcsOfSamothrace < 100 endparam heading text = "The 'Alternate formula' is a polynomial form which may give a more \ accurate rendering of the trap shape." endheading bool param altformula caption = "Alternate formula" default = false endparam float param scale caption = "scale" default = 0.2 visible = @altformula endparam float param width caption = "width" default = 1 visible = @altformula endparam bool param adv caption = "advanced" default = false visible = @altformula endparam float param a1 caption = "parameter a1" default = 3 visible = @adv && @altformula endparam float param a2 caption = "parameter a2" default = 1 visible = @adv && @altformula endparam param ref caption = "offset reference" default = 0 enum = "zero" "pz" visible = @altformula endparam float param offset caption = "Offset" default = 0.0 hint = "Trap offset" visible = @altformula endparam bool param cmplx caption = "Apply to complex" default = false visible = @altformula endparam func fn1 caption = "Function 1" default = ident() visible = @altformula endfunc func fn2 caption = "Function 2" default = ident() visible = @altformula && !@cmplx endfunc bool param ptraps caption = "Use as Polar Traps" default = false visible = !@altformula endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps && !@altformula hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param b caption = "2nd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam float param c caption = "3rd polar parameter" default = 1.0 hint = "Affects spread and scale of trap" visible = !@altformula endparam bool param wave caption = "Add petal wave" default = false visible = !@altformula endparam float param wamp caption = "Wave amplitude" default = 0.05 visible = @wave && !@altformula endparam float param wfreq caption = "Wave frequency" default = 20 visible = @wave && !@altformula endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps && !@altformula endparam param absval caption = "Absolute Value" default = false visible = !@ptraps && !@altformula endparam bool param alttheta caption = "Alternate theta" default = false visible = !@altformula endparam } class REB_TrapShapeLimaconOfPascal(common.ulb:TrapShape) { ; This shape uses the limacon of Pascal function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeLimaconOfPascal(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.05*@b + @a*cos(theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Limacon Of Pascal" int param v_trapshapelimaconofpascal caption = "Version (Trap Shape Limacon Of Pascal)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapelimaconofpascal < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeLine(common.ulb:TrapShape) { ; This shape uses the ophiuride function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeLine(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 int sgn = 1 if @sgn sgn = -1 endif float cx = real(pz) float cy = cx if @absval d = abs(cabs(pz) - cabs(3*@a*(cx + sgn*flip(cy)))) else d = cabs(pz - 3*@a*(cx + sgn*flip(cy))) endif m_LastZ = 3*@a*(cx + sgn*flip(cy)) return d endfunc default: title = "Line" int param v_trapshapeline caption = "Version (Trap Shape Line)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeline < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeLinksCurve(common.ulb:TrapShape) { ; This shape uses the links curve function.
;

; This variant of the function involves taking a square root ; so there are two solutions. A signed and absolute value version of ; the distance is also available. The transformed value is the ; complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeLinksCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 int sgn = 1 if @sgn sgn = -1 endif float cx = real(pz) float qa = 1 float qb = 2*cx^2-6*cx float qc = cx^4-2*cx^3+cx^2 if @negroot qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif if @absval d = abs(cabs(pz) - cabs(@a*(cx + sgn*flip(qy)))) else d = cabs(pz - @a*(cx + sgn*flip(qy))) endif m_LastZ = @a*(cx + sgn*flip(qy)) return d endfunc default: title = "Links Curve" int param v_trapshapelinkscurve caption = "Version (Trap Shape Links Curve)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapelinkscurve < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam param negroot caption = "Quad Neg Root" default = true endparam } class REB_TrapShapeLituus(common.ulb:TrapShape) { ; This shape uses the lituus function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeLituus(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.25*@a/theta^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Lituus" int param v_trapshapelituus caption = "Version (Trap Shape Lituus)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapelituus < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeLogSpiral(common.ulb:TrapShape) { ; This shape uses the log spiral function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeLogSpiral(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = exp(@a*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Log Spiral" int param v_trapshapelogspiral caption = "Version (Trap Shape Log Spiral)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapelogspiral < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeLogSpiralCatacaustic(common.ulb:TrapShape) { ; This shape uses the log spiral catacaustic function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeLogSpiralCatacaustic(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) int sgn = 1 if @sgn sgn = -1 endif float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif complex af1 = 0.2*@b*exp(0.1*@b*theta)*(0.1*@b*cos(theta)-sin(theta))/(1+(0.1*@b)^2) complex af2 = 0.2*@b*exp(0.1*@b*theta)*(0.1*@b*cos(theta)+sin(theta))/(1+(0.1*@b)^2) complex as = @a*(af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - as) endif m_LastZ = as return d endfunc default: title = "Log Spiral Catacaustic" int param v_trapshapelogspiralcatacaustic caption = "Version (Trap Shape Log Spiral Catacaustic)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapelogspiralcatacaustic < 102 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeMalteseCross(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeMalteseCross(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.2*@a/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Maltese Cross" int param v_trapshapemaltesecross caption = "Version (Trap Shape Maltese Cross)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapemaltesecross < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeNephroid(common.ulb:TrapShape) { ; This shape uses the nephroid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeNephroid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif complex af1 = 3*@afn1(theta) - @afn1(theta/3) complex af2 = 3*@afn2(theta) - @afn2(theta/3) complex as = 0.5*@a*(af1+sgn*flip(af2)) m_LastZ = as if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - (as)) endif return d endfunc default: title = "Nephroid" int param v_trapshapenephroid caption = "Version (Trap Shape Nephroid)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapenephroid < 102 endparam float param a caption = "Polar Parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam func afn1 caption = "Function #1" default = cos() endfunc func afn2 caption = "Function #2" default = sin() endfunc bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeParabola(common.ulb:TrapShape) { ; This shape uses the parabola function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeParabola(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 int sgn = 1 if @sgn sgn = -1 endif float cy = imag(pz) float cx = 10*@b*cy^2 m_LastZ = 0.65*@a*(cx + sgn*flip(cy)) if @absval d = abs(cabs(pz) - cabs(0.65*@a*(cx + sgn*flip(cy)))) else d = cabs(pz - 0.65*@a*(cx + sgn*flip(cy))) endif return d endfunc default: title = "Parabola" int param v_trapshapeparabola caption = "Version (Trap Shape Parabola)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeparabola < 101 endparam float param a caption = "Polar Parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar Parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeTridentOfNewton(common.ulb:TrapShape) { ; This shape uses the Trident Of Newton function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeTridentOfNewton(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 int sgn = 1 if @sgn sgn = -1 endif float cx = real(pz) float cy = cx^2 + @b*cx - @c + 0.02*@d/cx m_LastZ = @a*(cx + sgn*flip(cy)) if @absval d = abs(cabs(pz) - cabs(m_LastZ)) else d = cabs(pz - m_LastZ) endif return d endfunc default: title = "Trident Of Newton" int param v_TridentOfNewton caption = "Version (Trident Of Newton)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_TridentOfNewton < 100 endparam float param a caption = "Polar Parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar Parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam float param c caption = "3rd Polar Parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam float param d caption = "4th Polar Parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeWassenaarCurve(common.ulb:TrapShape) { ; This shape uses the Wassenaar Curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeWassenaarCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 int sgn = 1 if @sgn sgn = -1 endif complex cx = real(pz) complex cy = 0 if @negroot cy = cx^2 - (1-30*@b*cx^2)^0.5 else cy = cx^2 + (1-30*@b*cx^2)^0.5 endif m_LastZ = @a*(cx + sgn*flip(cy)) if @absval d = abs(cabs(pz) - cabs(m_LastZ)) else d = cabs(pz - m_LastZ) endif return d endfunc default: title = "Wassenaar Curve" int param v_WassenaarCurve caption = "Version (Wassenaar Curve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_WassenaarCurve < 100 endparam float param a caption = "Polar Parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar Parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam param negroot caption = "Quad Neg Root" default = false endparam } class REB_TrapShapeWeibullCurve(common.ulb:TrapShape) { ; This shape uses the Weibull Curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeWeibullCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 int sgn = 1 if @sgn sgn = -1 endif complex cx = real(pz) complex cy = exp(-cx^(@b/10)) m_LastZ = @a*(cx + sgn*flip(cy)) if @absval d = abs(cabs(pz) - cabs(m_LastZ)) else d = cabs(pz - m_LastZ) endif return d endfunc default: title = "Weibull Curve" int param v_WeibullCurve caption = "Version (Weibull Curve)" default = 100 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_WeibullCurve < 100 endparam float param a caption = "Polar Parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar Parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapePiriform(common.ulb:TrapShape) { ; This shape uses the piriform function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapePiriform(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 float theta = 0 int sgn = 1 if @sgn sgn = -1 endif if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif complex af1 = 0.1*@a*(1+sin(theta)) complex af2 = 0.1*@b*cos(theta)*(1+sin(theta)) complex as = (af1 + sgn*flip(af2)) m_LastZ = as if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - as) endif return d endfunc default: title = "Piriform" int param v_trapshapepiriform caption = "Version (Trap Shape Piriform)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapepiriform < 102 endparam float param a caption = "Polar Parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar Parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapePoinsotSpiral1(common.ulb:TrapShape) { ; This shape uses the Poinsot spiral 1 function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapePoinsotSpiral1(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a/cosh(@pn*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Poinsot Spiral 1" int param v_trapshapepoinsotspiral1 caption = "Version (Trap Shape Poinsot Spiral 1)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapepoinsotspiral1 < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam int param pn caption = "Polar integer" default = 3 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapePoinsotSpiral2(common.ulb:TrapShape) { ; This shape uses the Poinsot spiral 2 function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapePoinsotSpiral2(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a/sinh(@pn*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Poinsot Spiral 2" int param v_trapshapepoinsotspiral2 caption = "Version (Trap Shape Poinsot Spiral 2)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapepoinsotspiral2 < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam int param pn caption = "Polar integer" default = 3 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapePolytrope(common.ulb:TrapShape) { ; This shape uses the polytrope function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapePolytrope(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 int sgn = 1 if @sgn sgn = -1 endif float cx = real(pz) float cy = 1/cx^@pn if @absval d = abs(cabs(pz) - cabs(0.00005*@a*(cx + sgn*flip(cy)))) else d = cabs(pz - 0.00005*@a*(cx + sgn*flip(cy))) endif m_LastZ = 0.00005*@a*(cx + sgn*flip(cy)) return d endfunc default: title = "Polytrope" int param v_trapshapepolytrope caption = "Version (Trap Shape Polytrope)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapepolytrope < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam int param pn caption = "Polar integer" default = 3 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeQuadratrixOfHippias(common.ulb:TrapShape) { ; This shape uses the quadratrix of Hippias function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeQuadratrixOfHippias(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a*theta/sin(theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Quadratrix of Hippias" int param v_trapshapequadratrixofhippias caption = "Version (Trap Shape Quadratrix Of Hippias)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapequadratrixofhippias < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeQuadrifolium(common.ulb:TrapShape) { ; This shape uses the quadrifolium function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeQuadrifolium(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a*sin(2*theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Quadrifolium" int param v_trapshapequadrifolium caption = "Version (Trap Shape Quadrifolium)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapequadrifolium < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeRose(common.ulb:TrapShape) { ; This shape uses the rose function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeRose(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif rr = @a*cos(theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Rose" int param v_trapshaperose caption = "Version (Trap Shape Rose)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshaperose < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeSuperRose(common.ulb:TrapShape) { public: import "common.ulb" ; Constructor func REB_TrapShapeSuperRose(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) if @wave float r = cabs(pz) float wtheta = atan2(pz) if wtheta < 0 wtheta = wtheta + 2 * #pi endif int iter = 0 while iter < 2 wtheta = wtheta + @wamp * cos(@wfreq * r) iter = iter + 1 endwhile float x = r * cos(wtheta) float y = r * sin(wtheta) pz = x + flip(y) endif float theta = 0 float d = 0 float rr = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif rr = @g*sin(@f*theta*(abs(cos(@d*theta))^@a + abs(sin(@d*theta))^@b)^@c) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Super Rose" int param v_trapshapeSuperRose caption = "Version (Trap Shape Super Rose)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeSuperRose < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param g caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param a caption = "Shape 1" default = 2 hint = "Affects spread and scale of trap" endparam float param b caption = "Shape 2" default = 2 hint = "Affects spread and scale of trap" endparam float param c caption = "Shape 3" default =3 hint = "Affects spread and scale of trap" endparam float param d caption = "Shape 4" default = 2 hint = "Affects spread and scale of trap" endparam float param f caption = "Shape 5" default = 5 hint = "Affects spread and scale of trap" endparam bool param @wave caption = "Add petal wave" default = false endparam float param @wamp caption = "Wave amplitude" default = 0.05 visible = @wave endparam float param @wfreq caption = "Wave frequency" default = 20 visible = @wave endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeRoseOfTroy(common.ulb:TrapShape) { ; This shape uses the rose of Troy function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeRoseOfTroy(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @c*(1+10*@a*sin(4*@b*theta)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Rose of Troy" int param v_trapshaperoseoftroy caption = "Version (Trap Shape Rose Of Troy)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshaperoseoftroy < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam float param c caption = "3rd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeScarabaeus(common.ulb:TrapShape) { ; This shape uses the scarabaeus function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeScarabaeus(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.25*@b*cos(2*theta)-0.5*@a*cos(theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Scarabaeus" int param v_trapshapescarabaeus caption = "Version (Trap Shape Scarabaeus)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapescarabaeus < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeSemicubicalParabola(common.ulb:TrapShape) { ; This shape uses the semicubical parabola function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeSemicubicalParabola(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = @a*(cos(2*@b*theta))^(1/(2*@b)) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Semicubical Parabola" int param v_trapshapesemicubicalparabola caption = "Version (Trap Shape Semicubical Parabola)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapesemicubicalparabola < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeSerpentineCurve(common.ulb:TrapShape) { ; This shape uses the serpentine curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeSerpentineCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif complex af1 = 0.2*@a*cotan(theta) complex af2 = 0.2*@b*sin(theta)*cos(theta) complex as = (af1 + sgn*flip(af2)) if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - as) endif m_LastZ = pz - as return d endfunc default: title = "Serpentine Curve" int param v_trapshapeserpentinecurve caption = "Version (Trap Shape Serpentine Curve)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeserpentinecurve < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam } class REB_TrapShapeStirrupCurve(common.ulb:TrapShape) { ; This shape uses the stirrup curve function.
;

; This variant of the function involves taking a square root ; so there are two solutions. A signed and absolute value version of ; the distance is also available. The transformed value is the ; complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeStirrupCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float d = 0 int sgn = 1 if @sgn sgn = -1 endif float cy = imag(pz) float qa = 1 float qb = -2 float qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) float qx = 0 if @negroot qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif if @absval d = abs(cabs(pz) - cabs(@a*(qx + sgn*flip(cy)))) else d = cabs(pz - @a*(qx + sgn*flip(cy))) endif m_LastZ = @a*(qx + sgn*flip(cy)) return d endfunc default: title = "Stirrup Curve" int param v_trapshapestirrupcurve caption = "Version (Trap Shape Stirrup Curve)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapestirrupcurve < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false endparam param absval caption = "Absolute Value" default = false endparam param negroot caption = "Quad Neg Root" default = true endparam } class REB_TrapShapeStrophoid(common.ulb:TrapShape) { ; This shape uses the strophoid function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeStrophoid(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 theta = atan2(pz) int sgn = 1 if @sgn sgn = -1 endif rr = 0.1*@b*sin(@a-2*theta)/sin(@a-theta) if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Strophoid" int param v_trapshapestrophoid caption = "Version (Trap Shape Strophoid)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapestrophoid < 101 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam } class REB_TrapShapeSwastikaCurve(common.ulb:TrapShape) { ; This shape uses the swastika curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate and a ; polar variant. The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeSwastikaCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 float rr = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif rr = 0.25*@a*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 if !@ptraps if @absval d = abs(cabs(pz) - cabs(rr*cos(theta)+ sgn*flip(rr*sin(theta)))) else d = cabs(pz - (rr*cos(theta) + sgn*flip(rr*sin(theta)))) endif m_LastZ = (rr*cos(theta) + sgn*flip(rr*sin(theta))) else float x = real(pz) float y = imag(pz) if @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) else d = (abs(x-rr*cos(theta)) + abs(y-rr*sin(theta))) endif m_LastZ = x-rr*cos(theta) + flip(y-rr*sin(theta)) endif return d endfunc default: title = "Swastika Curve" int param v_trapshapeswastikacurve caption = "Version (Trap Shape Swastika Curve)" default = 102 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeswastikacurve < 102 endparam bool param ptraps caption = "Use as Polar Traps" default = false endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" visible = @ptraps hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam bool param sgn caption = "Conjugate transform" default = false visible = !@ptraps endparam param absval caption = "Absolute Value" default = false visible = !@ptraps endparam bool param alttheta caption = "Alternate theta" default = false endparam } class REB_TrapShapeTeardropCurve(common.ulb:TrapShape) { ; This shape uses the teardrop curve function.
;

; This variant of the function has a signed and absolute value ; version of the distance. The function also has a complex conjugate variant. ; The transformed value is the complex return value of the function. public: import "common.ulb" ; Constructor func REB_TrapShapeTeardropCurve(Generic pparent) TrapShape.TrapShape(pparent) endfunc ; Call this for each iteration being trapped. float func Iterate(complex pz) TrapShape.Iterate(pz) float theta = 0 float d = 0 if !@alttheta theta = atan2(pz) else theta = atan(imag(pz)/real(pz)) endif int sgn = 1 if @sgn sgn = -1 endif complex af1 = @a*cos(theta) complex af2 = 0.5*@b*sin(theta)*sin(theta/2)^(@pn-1) complex as = (af1 + sgn*flip(af2)) m_LastZ = as if @absval d = abs(cabs(pz) - cabs(as)) else d = cabs(pz - (as)) endif return d endfunc default: title = "Teardrop Curve" int param v_trapshapeteardropcurve caption = "Version (Trap Shape Teardrop Curve)" default = 101 hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used." visible = @v_trapshapeteardropcurve < 101 endparam float param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam float par