{{ tocSubheader }}
| {{ 'ml-lesson-number-slides' | message : article.intro.bblockCount}} |
| {{ 'ml-lesson-number-exercises' | message : article.intro.exerciseCount}} |
| {{ 'ml-lesson-time-estimation' | message }} |
Moa (Diskussion | bidrag) | Karin.hedin@osteraker.se (Diskussion | bidrag) | ||
Rad 22: | Rad 22: | ||
//graph.updateCurve(); | //graph.updateCurve(); | ||
− | var flyttaMig = b.textA(-1.5,0.75,' | + | var flyttaMig = b.textA(-1.5,0.75,'Dra mig!',{anchor:p1}); |
− | Dra mig! | + | var flyttaMig2 = b.textA(0,-1,'Dra mig!',{anchor:p2}); |
− | var flyttaMig2 = b.textA(0,-1,' | ||
− | Dra mig! | ||
− | var calc = b.textA(9,10,' | + | var calc = b.textA(9,10,'Två nollställen',{flag:true, fontsize:1.1}); |
− | Två nollställen | ||
$(b.getId(calc)).css({ | $(b.getId(calc)).css({ | ||
Rad 35: | Rad 32: | ||
}); | }); | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Två nollställen'); |
− | Två nollställen | ||
//Begränsningar för var punkterna får vara. | //Begränsningar för var punkterna får vara. | ||
Rad 79: | Rad 75: | ||
if (Math.abs(p2.Y()) < 0.25) { | if (Math.abs(p2.Y()) < 0.25) { | ||
− | b.changeText(calc, ' | + | b.changeText(calc, 'Ett nollställe'); |
− | Ett nollställe | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
p2.moveTo([p2.X(), 0]); | p2.moveTo([p2.X(), 0]); | ||
Rad 95: | Rad 90: | ||
p2.setAttribute({fillcolor:mlg.blue}); | p2.setAttribute({fillcolor:mlg.blue}); | ||
if (p1.Y() > p2.Y()) { | if (p1.Y() > p2.Y()) { | ||
− | b.changeText(calc, ' | + | b.changeText(calc, 'Två nollställen'); |
− | Två nollställen | ||
xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | ||
p3.moveTo([p2.X() + xdist, 0]); | p3.moveTo([p2.X() + xdist, 0]); | ||
Rad 103: | Rad 97: | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc, ' | + | b.changeText(calc, 'Inga nollställen'); |
− | Inga nollställen | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
Rad 111: | Rad 104: | ||
p2.setAttribute({fillcolor:mlg.blue}); | p2.setAttribute({fillcolor:mlg.blue}); | ||
if (p1.Y() < p2.Y()) { | if (p1.Y() < p2.Y()) { | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Två nollställen'); |
− | Två nollställen | ||
xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | ||
p3.moveTo([p2.X() + xdist, 0]); | p3.moveTo([p2.X() + xdist, 0]); | ||
Rad 119: | Rad 111: | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc, ' | + | b.changeText(calc, 'Inga nollställen'); |
− | Inga nollställen | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
Rad 126: | Rad 117: | ||
else { | else { | ||
p2.setAttribute({fillcolor:mlg.blue}); | p2.setAttribute({fillcolor:mlg.blue}); | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Inga nollställen'); |
− | Inga nollställen | ||
} | } | ||
}); | }); | ||
Rad 174: | Rad 164: | ||
if (Math.round(p2.Y()*5)/5 == 0) { | if (Math.round(p2.Y()*5)/5 == 0) { | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Ett nollställe'); |
− | Ett nollställe | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
else if (p2.Y() < 0) { | else if (p2.Y() < 0) { | ||
if (p1.Y() > p2.Y()) { | if (p1.Y() > p2.Y()) { | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Två nollställen'); |
− | Två nollställen | ||
xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | ||
p3.moveTo([p2.X() + xdist, 0]); | p3.moveTo([p2.X() + xdist, 0]); | ||
Rad 188: | Rad 176: | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Inga nollställen'); |
− | Inga nollställen | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
Rad 195: | Rad 182: | ||
else if (p2.Y() > 0) { | else if (p2.Y() > 0) { | ||
if (p1.Y() < p2.Y()) { | if (p1.Y() < p2.Y()) { | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Två nollställen'); |
− | Två nollställen | ||
xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | ||
p3.moveTo([p2.X() + xdist, 0]); | p3.moveTo([p2.X() + xdist, 0]); | ||
Rad 203: | Rad 189: | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Inga nollställen'); |
− | Inga nollställen | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc, ' | + | b.changeText(calc,'Inga nollställen'); |
− | Inga nollställen | ||
} | } | ||
}); | }); | ||
Rad 248: | Rad 232: | ||
p4.moveTo([p2.X() - xdist, 0]); | p4.moveTo([p2.X() - xdist, 0]); | ||
b.show([p3,p4]); | b.show([p3,p4]); | ||
− | b.changeText(calc, ' | + | b.changeText(calc, 'Två nollställen'); |
− | Två nollställen | ||
}); | }); | ||
Rad 267: | Rad 250: | ||
p2.moveTo([randX2,0]); | p2.moveTo([randX2,0]); | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
− | b.changeText(calc, ' | + | b.changeText(calc, 'Ett nollställe'); |
− | Ett nollställe | ||
}); | }); | ||
Rad 288: | Rad 270: | ||
p2.moveTo([randX2,randY2]); | p2.moveTo([randX2,randY2]); | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
− | b.changeText(calc, ' | + | b.changeText(calc, 'Inga nollställen'); |
− | Inga nollställen | ||
}); | }); | ||
</jsxgpre> | </jsxgpre> |