reb
Class REB_IFSApollo

Object
  extended by common:Generic
      extended by common:Transform
          extended by common:UserTransform
              extended by reb:REB_IFSApollo

class 
UserTransform:REB_IFSApollo

3D Hyperparaboloid shape to create 3D "saddles"


Ultra Fractal Source

Toggle UF Source Code Display

 class REB_IFSApollo(common.ulb:UserTransform) {
  ; 3D Hyperparaboloid shape to create 3D "saddles" <br>
 public:
   import "common.ulb"
 
    ; constructor
    func REB_IFSApollo(Generic pparent)
      UserTransform.UserTransform(pparent)
      endfunc
 
   ; call for each iterated point
   complex func Iterate(complex pz)
     UserTransform.Iterate(pz)
     float ra = sqrt(3)
     float x = real(pz+@cen)
     float y = imag(pz+@cen)
     float aa = 0
     float a0 = 0
     float b0 = 0
     float a1 = -0.5
     float b1 = 0.5*ra
     float a2 = -0.5
     float b2 = -0.5*ra
     float x1 = 0
     float y1 = 0
     float f1x = 0
     float f1y = 0
     float s1 = @scale
     float s2 = s1
     int seed = 123456789
     int i = 0
     while i < @iter
       seed = random(seed)
       float aa = abs(seed)/#randomrange
       a0 = 3*(1 + ra - x)/((1 + ra - x)^2 + y^2) - (1 + ra)/(2 + ra)
       b0 = 3*y/((1 + ra - x)^2 + y^2)
       f1x = a0/(a0^2 + b0^2)
       f1y = -b0/(a0^2 + b0^2)
       if aa >= 0 && aa < 1/3
         x1 = 3*(1 + ra - x)/((1 + ra - x)^2 + y^2) - (1 + ra)/(2 + ra)
         y1 = 3*y/((1 + ra - x)^2 + y^2)
       elseif aa >= 1/3 && aa < 2/3
         x1 = f1x*a1 - f1y*b1
         y1 = f1x*b1 + f1y*a1
       elseif aa >= 2/3 && aa <= 1
         x1 = f1x*a2 - f1y*b2
         y1 = f1x*b2 + f1y*a2
       endif
       i = i+1
     endwhile
     return s1*x1 + flip(s2*y1)
   endfunc
 
  protected:
 
 default:
   title = "IFS Apollo"
   int param v_ifsapollo
     caption = "Version (IFS Apollo)"
     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_ifsapollo < 100
   endparam
   float param scale
     caption = "scale"
     default = 1
   endparam
   int param iter
     caption = "# of iterations"
     default = 1000
   endparam
   complex param cen
     caption = "Transform center"
     default = (0,0)
   endparam
 }
 


Constructor Summary
REB_IFSApollo()
           
REB_IFSApollo(Generic pparent)
          constructor
 
Method Summary
 complex Iterate(complex pz)
          call for each iterated point
 
Methods inherited from class common:Transform
Init, IsSolid, IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

REB_IFSApollo

public REB_IFSApollo(Generic pparent)
constructor


REB_IFSApollo

public REB_IFSApollo()
Method Detail

Iterate

public complex Iterate(complex pz)
call for each iterated point

Overrides:
Iterate in class Transform
Parameters:
pz - the complex value to be transformed
Returns:
the transformed value