init({
range: [ [-1, 11], [-1, 1] ]
});
var start = 0;
var end = 10;
var originX = 0;
var x = abs( INT ) + FRAC;
if ( SIGN === "-" ) {
start = -10;
end = 0;
originX = 10;
x = 10 - x;
}
numberLine( start, end );
style({ stroke: "#6495ED", fill: "#6495ED" });
graph.pt = circle( [ x, 0 ], 0.15 );
style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" });
path( [ [ originX, 0 ], [ x, 0 ] ] );
circle( [ originX, 0 ], 0.10 );
graph.pt.toFront();
The distance from 0
to SIGN + INT + FRAC
is INT + FRAC
, which equals the absolute value.
In other words, INT + FRAC
is the non-negative version of SIGN + INT + FRAC
.