Skip to content
Snippets Groups Projects
Commit 02a723c8 authored by pregmodfan's avatar pregmodfan
Browse files

actualization of variables names

parent 8b231f64
No related branches found
No related tags found
No related merge requests found
...@@ -205,7 +205,7 @@ window.WombGetVolume = function(actor) { //most legacy code from pregJS.tw with ...@@ -205,7 +205,7 @@ window.WombGetVolume = function(actor) { //most legacy code from pregJS.tw with
function getCurData(actor, age) function getCurData(actor, age)
{ {
let i = 0; let i = 0;
let min, max, ageMin, ageMax, ctrMin, ctrMax, one, ctrOne, ctr, cage, csize; let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cage, csize;
let data = {}; let data = {};
while (actor.pregData.fetusWeek[i+1] < age && i < actor.pregData.fetusWeek.length-1) while (actor.pregData.fetusWeek[i+1] < age && i < actor.pregData.fetusWeek.length-1)
...@@ -215,23 +215,23 @@ window.WombGetVolume = function(actor) { //most legacy code from pregJS.tw with ...@@ -215,23 +215,23 @@ window.WombGetVolume = function(actor) { //most legacy code from pregJS.tw with
max = actor.pregData.fetusSize[i+1]; max = actor.pregData.fetusSize[i+1];
ageMin = actor.pregData.fetusWeek[i]; ageMin = actor.pregData.fetusWeek[i];
ageMax = actor.pregData.fetusWeek[i+1]; ageMax = actor.pregData.fetusWeek[i+1];
ctrMin = actor.pregData.fetusRate[i]; rateMin = actor.pregData.fetusRate[i];
ctrMax = actor.pregData.fetusRate[i+1]; rateMax = actor.pregData.fetusRate[i+1];
cage = age - ageMin; cage = age - ageMin;
one = (max - min) / (ageMax - ageMin); one = (max - min) / (ageMax - ageMin);
ctrOne = (ctrMax - ctrMin) / (ageMax - ageMin); rateOne = (rateMax - rateMin) / (ageMax - ageMin);
ctr = ctrMin + (ctrOne * cage); rate = rateMin + (rateOne * cage);
csize = (min + (one * cage)); csize = (min + (one * cage));
console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" ctrOne:"+ctrOne+" cage:"+cage+" ctr:"+ctr+" csize:"+csize+" final size:"+csize*ctr); console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" rateOne:"+rateOne+" cage:"+cage+" rate:"+rate+" csize:"+csize+" final size:"+csize*rate);
data.size = csize; data.size = csize;
data.rate = ctr; data.rate = rate;
return data; //csize * ctr; return data; //csize * rate;
//maybe not very effective code, but simple and easy to debug. May be optimized more in future. //maybe not very effective code, but simple and easy to debug. May be optimized more in future.
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment