/* Recursive definition for tetration */ COMPLEX ComplexTetration(COMPLEX a,int n) { COMPLEX b,unity = {1,0,1,0}; if (n < 0) // Actually this is improper, tetration is only defined for n >= 0 n = -n; if (n == 0) return(unity); b = ComplexPower(a,ComplexTetration(a,n-1)); return(b); } /* Iterative definition for tetration */ COMPLEX ComplexTetration2(COMPLEX a,int n) { int i; COMPLEX b,unity = {1,0,1,0}; if (n < 0) // Actually this is improper, tetration is only defined for n >= 0 n = -n; if (n == 0) return(unity); b = a; for (i=0;ir = sqrt(a->x*a->x + a->y*a->y); a->t = atan2(a->y,a->x); } void Complex2Cart(COMPLEX *a) { a->x = a->r * cos(a->t); a->y = a->r * sin(a->t); } /* Recursive definition for tetration */ double RealTetration(double a,int n) { double b; if (n < 0) // Actually this is improper, tetration is only value for n >= 0 n = -n; if (n == 0) return(1); b = pow(a,RealTetration(a,n-1)); return(b); } double ComplexModulus(COMPLEX z) { double m; m = sqrt(z.x*z.x + z.y*z.y); return(m); }