MCPcopy Create free account
hub / github.com/ActiveState/code / FracDown

Function FracDown

recipes/Python/578044_Fractal_painter/recipe-578044.py:165–229  ·  view source on GitHub ↗
(aGrid, nX1, nY1, nX2, nY2, nTL, nTR, nBL, nBR, nLim, nRecursive, nCR, nCG, nCB)

Source from the content-addressed store, hash-verified

163
164
165def FracDown(aGrid, nX1, nY1, nX2, nY2, nTL, nTR, nBL, nBR, nLim, nRecursive, nCR, nCG, nCB):
166
167 # fractal lanscape grenerator
168
169 dx = nX2 - nX1
170
171 dy = nY2 - nY1
172
173 nS = aScale[nRecursive]
174
175 nT = dist((nTL + nTR) / 2, nS * nHorizFactor)
176
177 nL = dist((nTL + nBL) / 2, nS)
178
179 nR = dist((nTR + nBR) / 2, nS)
180
181 nB = dist((nBL + nBR) / 2, nS * nHorizFactor)
182
183 nM = dist((nTL + nTR + nBL + nBR) / 4, nS * nDiagFactor)
184
185 nSC = aColour[nRecursive]
186
187 nCR = dist(nCR, nSC)
188
189 nCG = dist(nCG, nSC)
190
191 nCB = dist(nCB, nSC)
192
193 nXm = mid(nX1, nX2)
194
195 nYm = mid(nY1, nY2)
196
197
198
199 if dx <= nLow and dy <= nLow:
200
201 if ZeroToOne(nM, nMSpan) > nLim:
202
203 DrawSplash(nXm, nYm, AutumnPastels(nCR, nCG, nCB))
204
205 return
206
207 nTL = Load(aGrid, nX1, nY2, nTL)
208
209 nTR = Load(aGrid, nX2, nY2, nTR)
210
211 nBL = Load(aGrid, nX1, nY1, nBL)
212
213 nBR = Load(aGrid, nX1, nY1, nBR)
214
215 t1 = (aGrid, nX1, nYm, nXm, nY2, nTL, nT, nL, nM, nLim, nRecursive + 1, nCR, nCG, nCB)
216
217 t2 = (aGrid, nXm, nYm, nX2, nY2, nT, nTR, nM, nR, nLim, nRecursive + 1, nCR, nCG, nCB)
218
219 t3 = (aGrid, nX1, nY1, nXm, nYm, nL, nM, nBL, nB, nLim, nRecursive + 1, nCR, nCG, nCB)
220
221 t4 = (aGrid, nXm, nY1, nX2, nYm, nM, nR, nB, nBR, nLim, nRecursive + 1, nCR, nCG, nCB)
222

Callers 1

FracFunction · 0.70

Calls 8

DrawSplashFunction · 0.85
AutumnPastelsFunction · 0.85
distFunction · 0.70
midFunction · 0.70
ZeroToOneFunction · 0.70
LoadFunction · 0.70
shuffleFunction · 0.50
applyFunction · 0.50

Tested by

no test coverage detected