Skip to content

Commit 3a72d69

Browse files
committed
removed some commented-out code
1 parent 2f8016e commit 3a72d69

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

cell.lua

+2-27
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ function newCell(x, y)
2020
for i = 1,13 do
2121
cell.membrane[i] = {x=x+50*math.cos(math.rad(15*i)),y=y+50*math.sin(math.rad(15*i)),vx=0,vy=0,ax=0,ay=0,spring=0}
2222
cell.membrane[i].spring = fNucSpringLength(cell)
23-
--cell.membrane[i] = x+50*math.cos(math.rad(15*i))
24-
--cell.membrane[i+1] = y+50*math.sin(math.rad(15*i))
2523
end
26-
--cell.mbsize = table.getn(cell.membrane)
27-
28-
--cell.springs = {}
29-
--for i = 1,13 do cell.springs[i] = fNucSpringLength(cell) end
3024

3125
cell.genes = {}
3226
cell.genes.growtime = 2 --1 --time to grow a new node, in seconds
@@ -74,10 +68,6 @@ function grow(c)
7468
local noday = (c.membrane[idx2].ay+c.membrane[idx].ay)/2 -- " " ay coords
7569

7670
table.insert(c.membrane,idx,{x=nx,y=ny,vx=nvx,vy=nvy,ax=nodax,ay=noday,spring=fNucSpringLength(c)})
77-
78-
--add spring to nucleus:
79-
--table.insert(c.springs,idx,fNucSpringLength(c))
80-
--c.mbsize = table.getn(c.membrane)
8171
end
8272

8373
function mitosis(_n)
@@ -88,24 +78,20 @@ function mitosis(_n)
8878
c = {}
8979
c.membrane = {}
9080
c.nucleus = {}
91-
--c.springs = {}
9281

9382
local newcell = {}
9483
newcell.membrane = {}
9584
newcell.nucleus = {}
96-
--newcell.springs = {}
9785

9886
for i = 1,split-1 do
9987
c.membrane[i] = table.copy(oldc.membrane[i])
100-
--c.springs[i] = oldc.springs[i]
10188
end
10289
local nucCopy = table.copy(oldc.nucleus)
10390
nucCopy.spring = fNucSpringLength(c)
10491
table.insert(c.membrane,nucCopy)
10592

10693
for i = split,oldsize do
10794
newcell.membrane[i+1-split] = table.copy(oldc.membrane[i])
108-
--newcell.springs[i+1-split] = oldc.springs[i]
10995
end
11096

11197
local nucCopy = table.copy(oldc.nucleus)
@@ -220,13 +206,7 @@ function updateCell(_n,dt)
220206

221207
table.remove(bullets,j)
222208
table.remove(c.membrane,i)
223-
--[[table.remove(c.membrane,i)
224-
table.remove(c.membraneVel,i)
225-
table.remove(c.membraneVel,i)
226-
table.remove(c.membraneAcc,i)
227-
table.remove(c.membraneAcc,i)
228-
table.remove(c.springs,(i+1)/2)
229-
c.mbsize = table.getn(c.membrane)]]
209+
230210
continue = true
231211
break
232212
else
@@ -235,7 +215,6 @@ function updateCell(_n,dt)
235215
end
236216
if not continue then
237217
--update position:
238-
--print(i,c.mbsize)
239218
c.membrane[i].x = c.membrane[i].x + c.membrane[i].vx*dt + 0.5*c.membrane[i].ax*dt*dt --update x
240219
c.membrane[i].y = c.membrane[i].y + c.membrane[i].vy*dt + 0.5*c.membrane[i].ay*dt*dt --update y
241220
--boundaries:
@@ -249,12 +228,9 @@ function updateCell(_n,dt)
249228
newax = newax + accn*math.cos(dir)
250229
neway = neway + accn*math.sin(dir)
251230

252-
--print(c.springs[(i+1)/2])
253-
254231
--Hooke's law for spring connecting c.membrane point to c.nucleus:
255232
local distance = math.sqrt((c.membrane[i].x-c.nucleus.x)^2 + (c.membrane[i].y-c.nucleus.y)^2)
256-
local force = -kNucSpring*(distance-c.membrane[i].spring) -- -kNucSpring*(distance-nucSpringLength)
257-
--if 1 == i or 13 == i then force = -kNucSpring*(distance-nucSpringLength*1.75) end
233+
local force = -kNucSpring*(distance-c.membrane[i].spring)
258234
local theta = math.atan2(c.membrane[i].y-c.nucleus.y,c.membrane[i].x-c.nucleus.x)
259235
newax = newax + (force/distance)*math.cos(theta)
260236
neway = neway + (force/distance)*math.sin(theta)
@@ -265,7 +241,6 @@ function updateCell(_n,dt)
265241
--preceding:
266242
local otherx = 0
267243
local othery = 0
268-
--print(i,c.mbsize)
269244
if 1 == i then
270245
otherx = c.membrane[table.getn(c.membrane)].x
271246
othery = c.membrane[table.getn(c.membrane)].y

0 commit comments

Comments
 (0)