Permalink
Browse files

adding function labels on graphie

  • Loading branch information...
1 parent 3c227db commit 7ca1505118ab82083aaa65df2cc78275247e12da @yunfangjuan yunfangjuan committed Oct 10, 2012
Showing with 17 additions and 0 deletions.
  1. +7 −0 exercises/function_transformations_1.html
  2. +10 −0 exercises/function_transformations_2.html
@@ -78,6 +78,9 @@
return UP_ORIG * pow(x + X_ORIG, 2) + Y_ORIG;
}, [-20, 20]);
+ label([-X_ORIG, Y_ORIG], "\\red{f(x)}",
+ UP_ORIG > 0 ? "below" : "above");
+
style({
stroke: BLUE
});
@@ -87,6 +90,10 @@
(UP_ORIG * pow(x + X_SHIFT + X_ORIG, 2) + Y_ORIG)
+ Y_SHIFT);
}, [-20, 20]);
+
+ label([-X_ORIG - X_SHIFT,
+ Y_SCALE * Y_ORIG + Y_SHIFT], "\\blue{g(x)}",
+ UP_ORIG * Y_SCALE > 0 ? "below" : "above");
</div>
<p class="solution" data-type="multiple">
<span class="sol" data-type="rational">
@@ -81,6 +81,10 @@
labelStep: 2,
axisArrows: "<->"
})
+ var labelPosition = "below";
+ if (UP_ORIG < 0) {
+ labelPosition = "above";
+ }
style({
stroke: RED,
@@ -92,6 +96,8 @@
return UP_ORIG * pow(x + X_ORIG, 2 ) + Y_ORIG;
}, [-20, 20]);
+ label([-X_ORIG, Y_ORIG], "\\red{f(x)}", labelPosition);
+
style({
stroke: BLUE
});
@@ -101,6 +107,10 @@
pow( X_SCALE * x + X_SHIFT + X_ORIG, 2) +
Y_ORIG + Y_SHIFT);
}, [-20, 20]);
+
+ label([GX_VERTEX_X, GX_VERTEX_Y], "\\blue{g(x)}",
+ labelPosition);
+
</div>
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">

0 comments on commit 7ca1505

Please sign in to comment.