Formula plotting-drawings

From Algebra.Com's Help
Revision as of 13:29, 28 June 2005 by (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Drawings are useful in a variety of mathematical contexts. For example, they are useful in geometry or solving various word problems. They are indispensable in physics.

Conceptually, a drawing as it could be done on this site is a picture with defined dimensions, virtual coordinate system, and one or more elements placed on the virtual coordinates.

Drawings are defined as a drawing() function:

 drawing( 300, 300, 
          0, 10,
          0, 10,
          red( circle( 5, 5, 3 ) ),
          locate( 5, 5, X )

The arguments to drawing() are:

  • x and y dimensions in pixels
  • xmin, xmax, ymin and ymax coordinates of the virtual coordinate system. Point (xmin, ymin) is the left lower corner, and point (xmax, ymax) is the right upper corner.
  • one or (usually) several graphical elements.

The following elements are defined now:

  • line( x1, y1, x2, y2 ) -- draws a line
  • circle( x1, y1, r ) -- draws a circle

You can also place elements such as Sprite (picture), as well as regular math formulae onto the coordinate system. The two functions for doing so are:

  • locate( x, y, expression ) -- locates the left upper corner of expression in point x, y
  • locate_center( x, y, expression ) - locates center of the expression in point x, y.