reb
Class InvertOctahedron

Object
  extended by common:Generic
      extended by reb:InvertSphere
          extended by reb:InvertOctahedron

class 
InvertSphere:InvertOctahedron

sphere inversions starting with a octahedral geometery
this is a child of InvertSphere


Ultra Fractal Source

Toggle UF Source Code Display

 Class InvertOctahedron(InvertSphere) {
 ; sphere inversions starting with a octahedral geometery <br>
 ; 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
 }
 


Constructor Summary
InvertOctahedron()
           
InvertOctahedron(Generic pparent)
          constructor for sphere inversions with an octahedral geometry
 
Method Summary
 void InitSpheres()
          Initializes base and generator spheres
 
Methods inherited from class reb:InvertSphere
findbound, heapify, heapifyz, heapsort, heapsortz, Inverse, Recurse, recurse2, siftdown, siftdownz, swap, vanquish
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

InvertOctahedron

public InvertOctahedron(Generic pparent)
constructor for sphere inversions with an octahedral geometry


InvertOctahedron

public InvertOctahedron()
Method Detail

InitSpheres

public void InitSpheres()
Initializes base and generator spheres

Overrides:
InitSpheres in class InvertSphere