mmf
Class MMF_TrapShapeTriangleInequality

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by mmf:MMF_TrapShapeTriangleInequality

class 
TrapShape:MMF_TrapShapeTriangleInequality

Based on Triangle Inequality by Damien Jones.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_TrapShapeTriangleInequality(common.ulb:TrapShape) {
 ; Based on Triangle Inequality by Damien Jones.<br>
 public:
   import "common.ulb"
 
   func MMF_TrapShapeTriangleInequality(Generic pparent)
     TrapShape.TrapShape(pparent)
     tcentre = @p_tcentre
     fAC = cabs(@p_tcentre)
   endfunc
 
   ; <p>Here note the search loop to find a parent that is a Coloring object
   ; in order to get the ppixel value<br>
   ; @param pz the z value
   func Init(complex pz)
     TrapShape.Init(pz)
     if @p_usepixel
       Generic obj = Generic(GetParent())
       if obj
         repeat
           if Coloring(obj)
             tcentre = Coloring(obj).GetPixel() + @p_tcentre
             obj = 0
           else
             obj = Generic(obj.GetParent())
             if obj==0
               tcentre = pz + @p_tcentre
             endif
           endif
         until obj==0
       else
         tcentre = pz + @p_tcentre
       endif
       fAC = cabs(tcentre)
     endif
   endfunc
 
   float func Iterate(complex pz)
     TrapShape.Iterate(pz)
     float az2 = cabs(pz - tcentre)
     float lowbound = abs(az2 - fAC)
     if abs(az2 = az2 + fAC - lowbound)>1e-100
       return (cabs(pz) - lowbound) / az2
     else
       return (cabs(pz) - lowbound)*1e100
     endif
   endfunc
 
 private:
   complex tcentre
   float fAC
 
 default:
   title = "Triangle Inequality"
   heading
     text = "Intended for use with 'MMF Smooth Orbit Traps (Gradient)' or \
             similar smoothing formulas since smoothing is usually required."
   endheading
   bool param p_usepixel
     caption = "Use Location/Initial Z ?"
     default = true
     hint = "The original Triangle Inequality Average used #pixel as the \
             base point, enabling this option normally replicates that. \
             However in some cases the location value equivalent to #pixel \
             may not be available and in such cases when this option is \
             enabled then the start z value will be used instead i.e. if \
             used with Julia formulas the location value will be used \
             since start z is the location in a Julia formula but when \
             used with Mandelbrot formulas the start z is not the location."
   endparam
   complex param p_tcentre
     caption = "Base Point or Offset"
     default = (1,0)
     hint = "If you choose to use initial z as the base point then this value \
             is applied as an offset, otherwise it's used as the actual \
             base point value. Note that to closely replicate standard \
             Triangle Inequality Average colouring on a Julia Set then have \
             'Use Initial z ?' enabled, set 'Base Point or Offset' to (0,0) \
             and use 'Smooth Average' from mmf.ulb as the Trap Mode."
   endparam
 }
 


Constructor Summary
MMF_TrapShapeTriangleInequality()
           
MMF_TrapShapeTriangleInequality(Generic pparent)
           
 
Method Summary
 void Init(complex pz)
          Here note the search loop to find a parent that is a Coloring object in order to get the ppixel value
 float Iterate(complex pz)
          call this for each iteration being trapped
 
Methods inherited from class common:TrapShape
GetColorChannel, GetTextureValue, GetTransformedPoint, IterateSilent, SetThreshold
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_TrapShapeTriangleInequality

public MMF_TrapShapeTriangleInequality(Generic pparent)

MMF_TrapShapeTriangleInequality

public MMF_TrapShapeTriangleInequality()
Method Detail

Init

public void Init(complex pz)

Here note the search loop to find a parent that is a Coloring object in order to get the ppixel value

Overrides:
Init in class TrapShape
Parameters:
pz - the z value

Iterate

public float Iterate(complex pz)
Description copied from class: TrapShape
call this for each iteration being trapped

Overrides:
Iterate in class TrapShape