{{ tocSubheader }}
| {{ 'ml-lesson-number-slides' | message : article.intro.bblockCount}} |
| {{ 'ml-lesson-number-exercises' | message : article.intro.exerciseCount}} |
| {{ 'ml-lesson-time-estimation' | message }} |
Viktor (Diskussion | bidrag) m (Textersättning - "Pq-formeln *Rules*" till "Rules:Pq-formeln") | Appe (Diskussion | bidrag) (Redigerar graf Antal_losningar_till_en_andragradsekvation_anim_1 via JXMagician.) | ||
Rad 13: | Rad 13: | ||
var xax = b.xaxis(25,0); | var xax = b.xaxis(25,0); | ||
var yax = b.yaxis(25,0); | var yax = b.yaxis(25,0); | ||
− | var p1 = b.point(15,2,{fixed:false, fillcolor: | + | var p1 = b.point(15,2,{fixed:false, fillcolor:'blue'}); |
− | var p2 = b.point(10,-3,{fixed:false, fillcolor: | + | var p2 = b.point(10,-3,{fixed:false, fillcolor:'blue'}); |
var xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | var xdist = Math.sqrt(-p2.Y() * Math.pow(p1.X() - p2.X(), 2) / (p1.Y() - p2.Y())); | ||
var p3 = b.point(p2.X() + xdist,0); | var p3 = b.point(p2.X() + xdist,0); | ||
Rad 43: | Rad 43: | ||
/* graph.updateCurve(); */ | /* graph.updateCurve(); */ | ||
− | var flyttaMig = b.textA(-1.6,0.85,' | + | var flyttaMig = b.textA(-1.6,0.85,'<!--T:36--> Dra mig!',{anchor:p1}); |
− | var flyttaMig2 = b.textA(0,-1,' | + | var flyttaMig2 = b.textA(0,-1,'<!--T:37--> Dra mig!',{anchor:p2}); |
− | var calc = b.textA(9,10,' | + | var calc = b.textA(9,10,'<!--T:38--> Två nollställen',{flag:true, fontsize:1.1}); |
$(b.getId(calc)).css({ | $(b.getId(calc)).css({ | ||
Rad 53: | Rad 53: | ||
}); | }); | ||
− | b.changeText(calc,' | + | b.changeText(calc,'<!--T:53--> Två nollställen'); |
//Begränsningar för var punkterna får vara. | //Begränsningar för var punkterna får vara. | ||
Rad 96: | Rad 96: | ||
if (Math.abs(p2.Y()) < 0.25) { | if (Math.abs(p2.Y()) < 0.25) { | ||
− | b.changeText(calc, ' | + | b.changeText(calc, '<!--T:39--> Ett nollställe'); |
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
p2.moveTo([p2.X(), 0]); | p2.moveTo([p2.X(), 0]); | ||
Rad 109: | Rad 109: | ||
} | } | ||
else if (p2.Y() < 0) { | else if (p2.Y() < 0) { | ||
− | p2.setAttribute({fillcolor: | + | p2.setAttribute({fillcolor:'blue'}); |
if (p1.Y() > p2.Y()) { | if (p1.Y() > p2.Y()) { | ||
− | b.changeText(calc, ' | + | b.changeText(calc, '<!--T:40--> 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 118: | Rad 118: | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc, ' | + | b.changeText(calc, '<!--T:41--> Inga nollställen'); |
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
} | } | ||
else if (p2.Y() > 0) { | else if (p2.Y() > 0) { | ||
− | p2.setAttribute({fillcolor: | + | p2.setAttribute({fillcolor:'blue'}); |
if (p1.Y() < p2.Y()) { | if (p1.Y() < p2.Y()) { | ||
− | b.changeText(calc,' | + | b.changeText(calc,'<!--T:42--> 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 132: | Rad 132: | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc, ' | + | b.changeText(calc, '<!--T:43--> Inga nollställen'); |
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
} | } | ||
else { | else { | ||
− | p2.setAttribute({fillcolor: | + | p2.setAttribute({fillcolor:'blue'}); |
− | b.changeText(calc,' | + | b.changeText(calc,'<!--T:44--> Inga nollställen'); |
} | } | ||
}); | }); | ||
Rad 185: | Rad 185: | ||
if (Math.round(p2.Y()*5)/5 == 0) { | if (Math.round(p2.Y()*5)/5 == 0) { | ||
− | b.changeText(calc,' | + | b.changeText(calc,'<!--T:45--> 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,'<!--T:46--> 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 197: | Rad 197: | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc,' | + | b.changeText(calc,'<!--T:47--> Inga nollställen'); |
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
Rad 203: | Rad 203: | ||
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,'<!--T:48--> 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 210: | Rad 210: | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc,' | + | b.changeText(calc,'<!--T:54--> Inga nollställen'); |
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
} | } | ||
} | } | ||
else { | else { | ||
− | b.changeText(calc,' | + | b.changeText(calc,'<!--T:55--> Inga nollställen'); |
} | } | ||
}); | }); | ||
Rad 222: | Rad 222: | ||
mlg.af("antallosningar_1.tvaLosningar", function(){ | mlg.af("antallosningar_1.tvaLosningar", function(){ | ||
b.hide([flyttaMig, flyttaMig2]); | b.hide([flyttaMig, flyttaMig2]); | ||
− | p2.setAttribute({fillcolor: | + | p2.setAttribute({fillcolor:'blue'}); |
var randY2 = Math.floor(Math.random()*9 + 1); | var randY2 = Math.floor(Math.random()*9 + 1); | ||
var randY1 = Math.floor(Math.random()*(randY2 + 9) - 10); | var randY1 = Math.floor(Math.random()*(randY2 + 9) - 10); | ||
Rad 253: | Rad 253: | ||
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, '<!--T:49--> Två nollställen'); |
}); | }); | ||
Rad 271: | Rad 271: | ||
p2.moveTo([randX2,0]); | p2.moveTo([randX2,0]); | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
− | b.changeText(calc, ' | + | b.changeText(calc, '<!--T:50--> Ett nollställe'); |
}); | }); | ||
mlg.af("antallosningar_1.ingenLosning", function(){ | mlg.af("antallosningar_1.ingenLosning", function(){ | ||
b.hide([flyttaMig, flyttaMig2]); | b.hide([flyttaMig, flyttaMig2]); | ||
− | p2.setAttribute({fillcolor: | + | p2.setAttribute({fillcolor:'blue'}); |
var randY2 = Math.floor(Math.random()*8 + 1); | var randY2 = Math.floor(Math.random()*8 + 1); | ||
var randY1 = Math.floor(Math.random()*(9-randY2) + 1) + randY2; | var randY1 = Math.floor(Math.random()*(9-randY2) + 1) + randY2; | ||
Rad 291: | Rad 291: | ||
p2.moveTo([randX2,randY2]); | p2.moveTo([randX2,randY2]); | ||
b.hide([p3,p4]); | b.hide([p3,p4]); | ||
− | b.changeText(calc, ' | + | b.changeText(calc, '<!--T:51--> Inga nollställen'); |
}); | }); | ||
</jsxgpre> | </jsxgpre> |