Difference between revisions of "Common Contexts"

From WeBWorK_wiki
Jump to navigation Jump to search
(Added Context category)
m (Add complex contexts)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
The main pre-defined contexts are the following:
 
The main pre-defined contexts are the following:
   
* <code>Numeric</code>: no points, vectors, matrices, complex numbers, or intervals are allowed.
 
  +
{| class="wikitable"
* <code>Complex</code>: no points, vectors, matrices, or intervals are allowed.
 
  +
! Name !! Description
* <code>Point</code>: Nearly the same as the Vector Context below, but the angle bracket and <code>ijk</code> notation is not allowed, and vector operations on points are not defined.
 
  +
* <code>Vector</code>: <code>i</code>, <code>j</code>, and <code>k</code> are defined as coordinate unit vectors, and vector cross and dot produces are allowed. No complex numbers, matrices, or intervals are allowed.
 
  +
|- style="vertical-align:top"
* <code>Vector2D</code>: same as Vector above, but <code>i</code> and <code>j</code> are defined as coordinate unit vectors in <math>{\bf R}^2</math>, and <code>k</code> is not defined.
 
  +
| style="padding:5px" | <code>Numeric</code>
* <code>Matrix</code>: same as Vector above, but square brackets define matrices instead of points or intervals.
 
  +
| style="padding:5px" | No points, vectors, matrices, complex numbers, or intervals are allowed.
* <code>Interval</code>: similar to Numeric context, but <code>(a,b)</code>, <code>(a,b]</code>, <code>[a,b)</code>, and <code>[a,b]</code> create real Intervals rather than lists or errors. Finite sets of reals are created using <code>{a,b,c}</code> (with as many or as few numbers are needed).
 
  +
* <code>Full</code>: For internal use. This context is used to seed the others.
 
  +
|- style="vertical-align:top"
** <code>pi</code> is defined
+
| style="padding:5px" | <code>Complex</code>
** <code>i</code> is square root of minus one, but <code>j</code> and <code>k</code> are unit Vectors
+
| style="padding:5px" | No points, vectors, matrices, or intervals are allowed.
** Matrix, Vector, Point, Intervals, and Complex are all defined
+
** <code>x</code> is a variable
+
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Point</code>
  +
| style="padding:5px" | Nearly the same as the <code>Vector</code> below, but the angle bracket and <code>ijk</code> notation is not allowed, and vector operations on points are not defined.
  +
  +
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Vector</code>
  +
| style="padding:5px" | The constants <code>i</code>, <code>j</code>, and <code>k</code> are defined as coordinate unit vectors, and vector cross and dot products are allowed. No complex numbers, matrices, or intervals are allowed.
  +
  +
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Vector2D</code>
  +
| style="padding:5px" | Same as <code>Vector</code> above, but <code>i</code> and <code>j</code> are defined as coordinate unit vectors in <math>{\bf R}^2</math>, and <code>k</code> is not defined.
  +
  +
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Matrix</code>
  +
| style="padding:5px" | Same as <code>Vector</code> above, but square brackets define matrices instead of points or intervals.
  +
  +
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Interval</code>
  +
| style="padding:5px" | Similar to <code>Numeric</code> context, but <code>(a,b)</code>, <code>(a,b]</code>, <code>[a,b)</code>, and <code>[a,b]</code> create real Intervals rather than lists or errors. Finite sets of reals are created using <code>{a,b,c}</code> (with as many or as few numbers are needed).
  +
  +
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Complex-Point</code>
  +
| style="padding:5px" | Similar to <code>Point</code> context, but allows coordinates to be complex numbers (i.e., <code>i</code> is defined, and the complex functions are enabled).
  +
  +
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Complex-Vector</code>
  +
| style="padding:5px" | Similar to <code>Vector</code> context, but allows coordinates to be complex numbers (i.e., <code>i</code> is defined, and the complex functions are enabled).
  +
  +
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Complex-Matrix</code>
  +
| style="padding:5px" | Similar to <code>Matrix</code> context, but allows entries to be complex numbers (i.e., <code>i</code> is defined, and the complex functions are enabled).
  +
  +
|- style="vertical-align:top"
  +
| style="padding:5px" | <code>Full</code>
  +
| style="padding:5px" | This context is used to seed the others, and is only intended for internal use. Matrix, vector, point, intervals, and complex numbers all can be created in this context; <code>i</code> is the complex <math>i</math> equal to <math>\sqrt{-1}</math>. The variables are <code>x</code>, <code>y</code>, and <code>z</code>.
  +
  +
|}
   
 
<br>
 
<br>
Line 18: Line 18:
 
[[Category:Contexts]]
 
[[Category:Contexts]]
 
[[Category:MathObjects]]
 
[[Category:MathObjects]]
  +
[[Category:Reference Tables]]

Latest revision as of 08:57, 7 May 2015

The main pre-defined contexts are the following:

Name Description
Numeric No points, vectors, matrices, complex numbers, or intervals are allowed.
Complex No points, vectors, matrices, or intervals are allowed.
Point Nearly the same as the Vector below, but the angle bracket and ijk notation is not allowed, and vector operations on points are not defined.
Vector The constants i, j, and k are defined as coordinate unit vectors, and vector cross and dot products are allowed. No complex numbers, matrices, or intervals are allowed.
Vector2D Same as Vector above, but i and j are defined as coordinate unit vectors in [math]{\bf R}^2[/math], and k is not defined.
Matrix Same as Vector above, but square brackets define matrices instead of points or intervals.
Interval Similar to Numeric context, but (a,b), (a,b], [a,b), and [a,b] create real Intervals rather than lists or errors. Finite sets of reals are created using {a,b,c} (with as many or as few numbers are needed).
Complex-Point Similar to Point context, but allows coordinates to be complex numbers (i.e., i is defined, and the complex functions are enabled).
Complex-Vector Similar to Vector context, but allows coordinates to be complex numbers (i.e., i is defined, and the complex functions are enabled).
Complex-Matrix Similar to Matrix context, but allows entries to be complex numbers (i.e., i is defined, and the complex functions are enabled).
Full This context is used to seed the others, and is only intended for internal use. Matrix, vector, point, intervals, and complex numbers all can be created in this context; i is the complex [math]i[/math] equal to [math]\sqrt{-1}[/math]. The variables are x, y, and z.