{{ tocSubheader }}
| {{ 'ml-lesson-number-slides' | message : article.intro.bblockCount }} |
| {{ 'ml-lesson-number-exercises' | message : article.intro.exerciseCount }} |
| {{ 'ml-lesson-time-estimation' | message }} |
Estellecapor1@gmail.com (Diskussion | bidrag) (Den här versionen är märkt för översättning) | Jonas (Diskussion | bidrag) | ||
Rad 29: | Rad 29: | ||
− | / | + | /* b.board.options.layer['angle'] = 8; */ |
− | / | + | /* Vilken funktion som ska visas lagras i x-koordinaten */ |
var whichFunction = b.node(1,20); | var whichFunction = b.node(1,20); | ||
− | / | + | /* Definiera funktionen */ |
var f1 = b.board.create('functiongraph', [function(x) { | var f1 = b.board.create('functiongraph', [function(x) { | ||
if (whichFunction.X() === 0) { | if (whichFunction.X() === 0) { | ||
Rad 47: | Rad 47: | ||
}, -5, 5], {strokeWidth:2, strokeColor:'blue'}); | }, -5, 5], {strokeWidth:2, strokeColor:'blue'}); | ||
− | / | + | /* Drag mig! för funktionerna */ |
var dragMe2 = b.textA(1.9,0.6, string.move_me); | var dragMe2 = b.textA(1.9,0.6, string.move_me); | ||
var dragMeE = b.textA(1.3,1.1, string.move_me,{opacity:0, transitionDuration:0}); | var dragMeE = b.textA(1.3,1.1, string.move_me,{opacity:0, transitionDuration:0}); | ||
var dragMeS = b.textA(0.75,-0.35, string.move_me,{opacity:0, transitionDuration:0}); | var dragMeS = b.textA(0.75,-0.35, string.move_me,{opacity:0, transitionDuration:0}); | ||
− | / | + | /* b.hide([dragMeE, dragMeS]); */ |
− | / | + | /* Skapa en tangentpunkt och tangenten */ |
var tangentPoint = b.glider(1, 1, f1, {fixed:false}); | var tangentPoint = b.glider(1, 1, f1, {fixed:false}); | ||
var tangent1 = b.board.create('<translate><!--T:13--> tangent</translate>', [tangentPoint], {strokeColor:'red'}); | var tangent1 = b.board.create('<translate><!--T:13--> tangent</translate>', [tangentPoint], {strokeColor:'red'}); | ||
− | // | + | /* Funktionsbeskrivningar */ |
var lf1 = b.func('-0.75', 'blue', {xMin:-3, xMax:-3, opacity:0}); | var lf1 = b.func('-0.75', 'blue', {xMin:-3, xMax:-3, opacity:0}); | ||
var polyLegend = b.legend(lf1, -3,'y=x^2'); | var polyLegend = b.legend(lf1, -3,'y=x^2'); | ||
Rad 68: | Rad 68: | ||
var expLegend = b.legend(lf3, -2.25,'y=2^x',{opacity:0, transitionDuration:0}); | var expLegend = b.legend(lf3, -2.25,'y=2^x',{opacity:0, transitionDuration:0}); | ||
− | / | + | /* b.hide([sinLegend, expLegend]); */ |
− | / | + | /* Skapa cirkel långt borta från resten av plottarna */ |
− | circleNode1 = b.node(20, 20); | + | var circleNode1 = b.node(20, 20); |
− | circleNode2 = b.node(22.5, 20); | + | var circleNode2 = b.node(22.5, 20); |
var tCircle = b.circle(circleNode1, circleNode2, {strokeWidth:2}); | var tCircle = b.circle(circleNode1, circleNode2, {strokeWidth:2}); | ||
− | / | + | /* Med en tangeringspunkt och tangent, samt radie med rät vinkel */ |
− | circleTangentPoint = b.glider(24,16, tCircle, {fixed:false}); | + | var circleTangentPoint = b.glider(24,16, tCircle, {fixed:false}); |
var circleRadius = b.segment(circleTangentPoint, circleNode1, {layer:8}); | var circleRadius = b.segment(circleTangentPoint, circleNode1, {layer:8}); | ||
− | helpPoint = b.Tpoint(circleRadius, circleTangentPoint, 1); | + | var helpPoint = b.Tpoint(circleRadius, circleTangentPoint, 1); |
b.hide(helpPoint); | b.hide(helpPoint); | ||
var circleAngle = b.angle(circleNode1, circleTangentPoint, helpPoint, {radius:0.4, orthoType:'square', layer:7, fillOpacity:1.0, strokeColor:'#666666', fillColor:'#B2B2B2'}); | var circleAngle = b.angle(circleNode1, circleTangentPoint, helpPoint, {radius:0.4, orthoType:'square', layer:7, fillOpacity:1.0, strokeColor:'#666666', fillColor:'#B2B2B2'}); | ||
Rad 87: | Rad 87: | ||
− | / | + | /* Dra mig! för cirkeln */ |
var dragMeC = b.textA(22.2,17.8, string.move_me); | var dragMeC = b.textA(22.2,17.8, string.move_me); | ||
− | / | + | /* Förbered för visning */ |
− | / | + | /* b.hide(tangent2); */ |
− | / | + | /* Sätt gränser för var punkten får vara */ |
tangentPoint.on('drag', function () { | tangentPoint.on('drag', function () { | ||
b.hide([dragMeE, dragMe2, dragMeS],0); | b.hide([dragMeE, dragMe2, dragMeS],0); | ||
Rad 111: | Rad 111: | ||
}); | }); | ||
− | / | + | /* Inställningar för de olika graferna */ |
− | // | + | /* Sinuskurva */ |
mlg.af("tangent_illustration_1.sinus", function(){ | mlg.af("tangent_illustration_1.sinus", function(){ | ||
b.hide([dragMeE, dragMeC, dragMe2, expLegend, polyLegend, tangent2],1); | b.hide([dragMeE, dragMeC, dragMe2, expLegend, polyLegend, tangent2],1); | ||
Rad 125: | Rad 125: | ||
− | // | + | /* Andragradsfunktion */ |
mlg.af("tangent_illustration_1.seconddeg", function(){ | mlg.af("tangent_illustration_1.seconddeg", function(){ | ||
b.hide([dragMeE, dragMeS, dragMeC, expLegend, sinLegend, tangent2],1); | b.hide([dragMeE, dragMeS, dragMeC, expLegend, sinLegend, tangent2],1); | ||
Rad 137: | Rad 137: | ||
− | // | + | /* Exponentialfunktion */ |
mlg.af("tangent_illustration_1.exponential", function(){ | mlg.af("tangent_illustration_1.exponential", function(){ | ||
b.hide([dragMeC, dragMeS, dragMe2, polyLegend, sinLegend, tangent2],1); | b.hide([dragMeC, dragMeS, dragMe2, polyLegend, sinLegend, tangent2],1); | ||
Rad 149: | Rad 149: | ||
− | // | + | /* Cirkel */ |
mlg.af("tangent_illustration_1.circle", function(){ | mlg.af("tangent_illustration_1.circle", function(){ | ||
b.hide([dragMeE, dragMeS, dragMe2, tangent1],1); | b.hide([dragMeE, dragMeS, dragMe2, tangent1],1); |
Man kan därför använda tangenter för att illustrera en kurvas lutning i en viss punkt på grafen.
Lägg märke till att en tangent till en cirkel skapar en rät vinkel med cirkelns radie.