Class myphysicslab.sims.experimental.GraphCalcApp

Provided By

GraphCalcApp is a simple graphing calculator demonstration using myphysicslab.

Recipe for Graphing

  • make a LabCanvas with a SimView, connected to an HTML canvas
  • make a VarsList with 2 variables.
  • make a GraphLine which collects data from the VarsList
  • make a DisplayGraph to show the GraphLine
  • add DisplayGraph to SimView
  • add DisplayAxes to SimView
  • put the expression you want to graph into a string variable, it is a function of x.
  • in a loop, from x=0 to 10, by increment of 0.05: put x into vars[0]; evaluate the expression to get y, put it into vars[1]; call graph.memorize()
  • call canvas.paint()

new GraphCalcApp( elem_ids )

elem_ids{graph_div: string, term_input: string, term_output: string}

specifies the names of the HTML elementId's to look for in the HTML document; these elements are where the user interface of the simulation is created.

Instance Methods

Static Functions

Type Definitions