ck
Class TrapShapeSuperShape
Object
common:Generic
common:TrapShape
ck:TrapShapeSuperShape
class
- TrapShape:TrapShapeSuperShape
Super Shape UF5 Implementation
c.kleinhuis 2008
Formula Taken from Paul Bourke's Website:
http://local.wasp.uwa.edu.au/~pbourke/surfaces_curves/supershape/
visit fractalforums.com or fractalmovies.com
for example usage of this formula
Ultra Fractal Source
Toggle UF Source Code Display
class TrapShapeSuperShape(common.ulb:TrapShape) {
; Super Shape UF5 Implementation
; c.kleinhuis 2008
;
; Formula Taken from Paul Bourke's Website:
; http://local.wasp.uwa.edu.au/~pbourke/surfaces_curves/supershape/
;
; visit fractalforums.com or fractalmovies.com
; for example usage of this formula
;
public:
func TrapShapeSuperShape(Generic pparent)
TrapShape.TrapShape(pparent)
endfunc
float func Iterate(complex pz)
TrapShape.Iterate(pz)
float theta = atan2(pz);
float res = TrapShapeSuperShape.super(theta, @a, @b, @n1, @n2, @n3, @m);
float r = cabs(pz);
float real=res*cos(theta)*r
float imag=res*sin(theta)*r
return sqrt(real*real+imag*imag)
endfunc
float func super(float theta, float a, float b, float n1, float n2, float n3, float m)
float one = abs(cabs(cos(m * theta / 4.0) / a)^ n2)
float two = abs(cabs(sin(m * theta / 4.0) / b)^ n3)
return ((one + two)^ -1.0 / n1);
endfunc
default:
title = "Super Shape"
param n1 ; Overrides p_power from Formula
caption = "n1"
default = 3.0
hint = "n1 Variable from the SuperShape Formula."
endparam
param n2 ; Overrides p_power from Formula
caption = "n2"
default = 2.0
hint = "n1 Variable from the SuperShape Formula."
endparam
param n3 ; Overrides p_power from Formula
caption = "n3"
default = 0.1
hint = "n1 Variable from the SuperShape Formula."
endparam
param a ; Overrides p_power from Formula
caption = "a"
default = 1.0
hint = "a Variable from the SuperShape Formula."
visible = false
endparam
param b ; Overrides p_power from Formula
caption = "b"
default = 1.0
hint = "b Variable from the SuperShape Formula."
visible = false
endparam
param m ; Overrides p_power from Formula
caption = "Number of Turns"
default = 6.0
hint = "Number of Turns \n Even Numbers generate Closed Shapes\n "
endparam
}
Method Summary |
float |
Iterate(complex pz)
call this for each iteration being trapped |
float |
super1(float theta,
float a,
float b,
float n1,
float n2,
float n3,
float m)
|
Methods inherited from class Object |
|
TrapShapeSuperShape
public TrapShapeSuperShape(Generic pparent)
TrapShapeSuperShape
public TrapShapeSuperShape()
Iterate
public float Iterate(complex pz)
- Description copied from class:
TrapShape
- call this for each iteration being trapped
- Overrides:
Iterate
in class TrapShape
super1
public float super1(float theta,
float a,
float b,
float n1,
float n2,
float n3,
float m)