HTML and CSS Reference
In-Depth Information
Figure 1-2. Graphing calculator interface in Safari for Mac
<input type="button" id="y_equals_two_x" value="y = 2x" style="color: blue;"/>
<input type="button" id="y_equals_one_half_x" value="y = 0.5x" style="color: brown"/>
<input type="button" id="reset_grid" value="Reset Grid"/>
</form>
</div>
</body>
</html>
To construct the grid on the
<canvas>
and graph lines, we'll make use of a few new
Canvas API functions:
moveTo(
x
,
y
)
Move the Canvas “cursor” to the (
x
,
y
) location specified. Subsequent drawing
operations you perform will use this location as the starting point.