init({ range: [[0, 2.4], [-1, 2]], scale: [200, 40] });
rectchart([N1, D1 - N1], [BLUE, "#999"], 0);
var chart2 = rectchart([N2, D2 - N2], [GREEN, "#999"], 0);
chart2.translate(240, 0);
label([0.5, 1], "\\blue{\\dfrac{" + N1 + "}{" + D1 + "}}", "above");
label([1.7, 1], "\\green{\\dfrac{" + N2 + "}{" + D2 + "}}", "above");
label([1.1, 1], "+", "above");
init({ range: [[0, 2.4], [0, 2]], scale: [200, 40] });
rectchart([N1 * F1, LCM - N1 * F1], [BLUE, "#999"], 0);
var chart2 = rectchart([N2 * F2, LCM - N2 * F2], [GREEN, "#999"], 0);
chart2.translate(240, 0);
label([0.5, 1], "\\blue{\\dfrac{" + N1 + " \\times " + F1 + "}{" + D1 + " \\times " + F1 + "}}", "above");
label([1.7, 1], "\\green{\\dfrac{" + N2 + " \\times " + F2 + "}{" + D2 + " \\times " + F2 + "}}", "above");
label([1.1, 1], "+", "above");
init({ range: [[0, 2.4], [0, 1.5]], scale: [200, 40] });
label([0.5, 0], "\\blue{\\dfrac{" + (N1 * F1) + "}{" + LCM + "}}", "above");
label([1.7, 0], "\\green{\\dfrac{" + (N2 * F2) + "}{" + LCM + "}}", "above");
label([1.1, 0], "+", "above");
init({ range: [[0, 2.4], [0, 2]], scale: [200, 40] });
if (N1 / D1 + N2 / D2 > 1) {
var part1 = LCM - N1 * F1;
var part2 = N2 * F2 - part1;
rectchart([N1 * F1, part1], [BLUE, GREEN], 0);
var chart2 = rectchart([part2, LCM - part2], [GREEN, "#999"], 0);
chart2.translate(240, 0);
} else {
rectchart([N1 * F1, N2 * F2, LCM - N1 * F1 - N2 * F2], [BLUE, GREEN, "#999"], 0);
}
\qquad = \dfrac{\blue{N1 * F1} +
\green{N2 * F2}}{LCM}
\qquad = fraction(F1 * N1 + F2 * N2, LCM)
\qquad = fractionReduce(F1 * N1 + F2 * N2, LCM)