MARC FORNES & THEVERYMANY™

PRACTICING AT THE INTERSECTION OF ART + ARCHITECTURE ^ COMPUTATION

Rh4_LorenzAttractor_v.060221


Option Explicit
Sub LorenzAttractor()

Dim MaxPuntos : MaxPuntos = 100000
Dim arrPt
Dim x,y,z
x = 1 : y = 1 : z = 1
Dim arrPtPrevious : arrPtPrevious = Array(x,y,z)
Dim h : h = 0.001
Dim nPuntos : nPuntos = 0

Do While (nPuntos < MaxPuntos)
x = x + h * dx(x,y,z)
y = y + h * dy(x,y,z)
z = z + h * dz(x,y,z)
arrPt = Array(x,y,z)
‘Rhino.addPoint arrPt
Rhino.addLine arrPtPrevious, arrPt
arrPtPrevious = arrPt
nPuntos = nPuntos + 1
Loop

End Sub
LorenzAttractor

Function dx (x,y,z)
dx = 10 * ( y – x )
End Function
Function dy (x,y,z)
dy = -x * z + 28 * x – y
End Function
Function dz (x,y,z)
dz = x * y – ( 8 / 3 ) * z
End Function

Advertisements

No comments yet»

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s