## reb Class TransferDistanceVariants

```Object
common:Generic
common:Transfer
reb:TransferDistanceVariants
```

`class Transfer:TransferDistanceVariants`

This is a basic transfer function useful for trap distances.

The distance variants reproduce distance options available in my old UF4 formulas.

Ultra Fractal Source
``` class TransferDistanceVariants(common.ulb:Transfer) {
; This is a basic transfer function useful for trap distances. <br>
; <p>
; The distance variants reproduce distance options available in my old UF4 formulas.
public:
import "common.ulb"

; constructor
func TransferDistanceVariants(Generic pparent)
Transfer.Transfer(pparent)
endfunc

; call for each iterated point
float func Iterate(float pr)
Transfer.Iterate(pr)
float rt = pr*@dmod
if @trapvar == 1
rt = abs(rt*rt - rt)
elseif @trapvar == 2
rt = abs(rt*rt*rt - rt)
elseif @trapvar == 3
rt = abs(rt*rt*rt -rt*rt +rt)
elseif @trapvar == 4
rt = abs(rt - |f_p|)
elseif @trapvar == 5
rt = abs(rt - cabs(fn3(f_p)))
elseif @trapvar == 6
rt = cabs((z1-f_p)*(rt/10-f_p))
elseif @trapvar == 7
rt = cabs(fn3(f_p)*(rt/10-z1+f_p))
elseif @trapvar == 8
rt = cabs(fn3(f_p)*(rt/10-(x+y)))
elseif @trapvar == 9
rt = cabs(fn3(f_p)*(rt/10-(x*y)))
endif
return rt
endfunc

; set the transformed point value
func SetTransformed(complex tx)
f_p = tx
endfunc

; set the untransformed point value
func SetUnTransformed(complex utx)
z1 = utx
x = real(z1)
y = imag(z1)
endfunc

protected:
complex f_p
complex z1
float x
float y

default:
title = "Distance Variants"
int param v_distancevariants
caption = "Version (Distance Variants)"
default = 101
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_distancevariants < 101
endparam
float param dmod
caption = "Distance modifier"
default = 1.0
endparam
param trapvar
caption = "Variants"
default = 0
enum = "default" "1" "2" "3" "4" "5" "6" "7" "8" "9"
endparam
func fn3
caption = "Trap var function"
default = acos()
visible=@trapvar == 5||@trapvar == 7||@trapvar == 8||@trapvar == 9
endfunc
}
```

Constructor Summary
`TransferDistanceVariants()`

`TransferDistanceVariants(Generic pparent)`
constructor

Method Summary
` float` `Iterate(float pr)`
call for each iterated point
` void` `SetTransformed(complex tx)`
set the transformed point value
` void` `SetUnTransformed(complex utx)`
set the untransformed point value

Methods inherited from class common:Transfer
`Init, IterateSilent`

Methods inherited from class common:Generic
`GetParent`

Methods inherited from class Object

Constructor Detail

### TransferDistanceVariants

`public TransferDistanceVariants(Generic pparent)`
constructor

### TransferDistanceVariants

`public TransferDistanceVariants()`
Method Detail

### Iterate

`public float Iterate(float pr)`
call for each iterated point

Overrides:
`Iterate` in class `Transfer`

### SetTransformed

`public void SetTransformed(complex tx)`
set the transformed point value

### SetUnTransformed

`public void SetUnTransformed(complex utx)`
set the untransformed point value