Difference between revisions of "Category:MathObject Classes"
(Created the page) |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 22: | Line 22: | ||
The following links describe the various classes in more detail: |
The following links describe the various classes in more detail: |
||
− | * '''[[ |
+ | * '''[[Real_(MathObject_Class)| Real]]''' -- implements real numbers |
− | * '''[[ |
+ | * '''[[Infinity_(MathObject_Class)| Infinity]]''' -- implements infinity and negative infinity |
− | * '''[[ |
+ | * '''[[Complex_(MathObject_Class)| Complex]]''' -- implements complex numbers |
− | * '''[[ |
+ | * '''[[Point_(MathObject_Class)| Point]]''' -- implements points in <math>{\bf R}^n</math> and <math>{\bf C}^n</math> |
− | * '''[[ |
+ | * '''[[Vector_(MathObject_Class)| Vector]]''' -- implements vectors in <math>{\bf R}^n</math> and <math>{\bf C}^n</math> |
− | * '''[[ |
+ | * '''[[Matrix_(MathObject_Class)| Matrix]]''' -- implements matrices over the real and complex numbers |
− | * '''[[ |
+ | * '''[[List_(MathObject_Class)| List]]''' -- implements lists of arbitrary MathObjects |
− | * '''[[ |
+ | * '''[[Interval_(MathObject_Class)| Interval]]''' -- implements intervals of real numbers |
− | * '''[[ |
+ | * '''[[Set_(MathObject_Class)| Set]]''' -- implements finite sets of real numbers |
− | * '''[[ |
+ | * '''[[Union_(MathObject_Class)| Union]]''' -- implements unions of intervals or sets |
− | * '''[[ |
+ | * '''[[String_(MathObject_Class)| String]]''' -- implements special words like <code>NONE</code> and <code>DNE</code> |
− | * '''[[ |
+ | * '''[[Formula_(MathObject_Class)| Formula]]''' -- implements expressions involving one or more variables |
=== Other Classes === |
=== Other Classes === |
||
− | The <code>pg/macros</code> directory contains a number of extensions to MathObjects, including files that define specialized MathObject types. The ones that begin with <code>parser</code> typically define a new object class. For example, <code>parserParametricLine.pl</code> defines a constructor <code>ParametricLine()</code> for creating a special object that checks if a student's answer is a given parametric line or not, even if it is parameterized differently. These files usually contain documentation within them; see the [http://webwork.maa.org/pod/ |
+ | The <code>pg/macros</code> directory contains a number of extensions to MathObjects, including files that define specialized MathObject types. The ones that begin with <code>parser</code> typically define a new object class. For example, <code>parserParametricLine.pl</code> defines a constructor <code>ParametricLine()</code> for creating a special object that checks if a student's answer is a given parametric line or not, even if it is parameterized differently. These files usually contain documentation within them; see the [http://webwork.maa.org/pod/pg POD] documentation for versions that you can read on line. |
+ | <br> |
||
[[Category:MathObjects]] |
[[Category:MathObjects]] |
Latest revision as of 16:26, 7 April 2021
MathObject Classes
The MathObjects library defines a number of object classes for various mathematical concepts, such as real numbers, complex numbers, intervals, vectors, points, and so on. To use these objects in a problem you are writing, include MathObjects.pl
in your loadMacros()
call. For example:
loadMacros( "PGstandard.pl", "MathObjects.pl", "PGcourse.pl", );
Once this is done, there are several ways to create MathObjects in your problem:
- By calling a constructor function for the type of object you want (e.g.,
Real(3.5)
orComplex("3+4i")
) - By calling
Compute()
to parse a string and return the resulting object (e.g.,Compute("3+4i")
) - By calling a method of an existing MathObject that returns another object (e.g.,
Formula("sin(x)")->eval(x => pi/2)
) - By combining existing MathObjects via mathematical operations (e.g.,
$x = Formula("x"); $f = $x**2 + 2*$x + 1
)
The links in the next section include examples of how to create and use each MathObject class.
The Main MathObject Classes
The following links describe the various classes in more detail:
- Real -- implements real numbers
- Infinity -- implements infinity and negative infinity
- Complex -- implements complex numbers
- Point -- implements points in [math]{\bf R}^n[/math] and [math]{\bf C}^n[/math]
- Vector -- implements vectors in [math]{\bf R}^n[/math] and [math]{\bf C}^n[/math]
- Matrix -- implements matrices over the real and complex numbers
- List -- implements lists of arbitrary MathObjects
- Interval -- implements intervals of real numbers
- Set -- implements finite sets of real numbers
- Union -- implements unions of intervals or sets
- String -- implements special words like
NONE
andDNE
- Formula -- implements expressions involving one or more variables
Other Classes
The pg/macros
directory contains a number of extensions to MathObjects, including files that define specialized MathObject types. The ones that begin with parser
typically define a new object class. For example, parserParametricLine.pl
defines a constructor ParametricLine()
for creating a special object that checks if a student's answer is a given parametric line or not, even if it is parameterized differently. These files usually contain documentation within them; see the POD documentation for versions that you can read on line.
Pages in category "MathObject Classes"
The following 13 pages are in this category, out of 13 total.