(Mathematica would do this symbolically, but LiveGraphics3D converts all numbers to a decimal format.)Ĭommon functions such as Sin, Cos, Exp and Abs should all be recognizable in context. For example, the following input would compute the square root of 5. Mathematica's functions are always capitalized and use square brackets around their arguments. This statement returns 0 if x 1, and x otherwise. Here test is a condition such as x => 0, x 1, 1, x] ] The If statement in Mathematica has the following syntax. Within Mathematica there are significant differences between = and ->, but these are not important for the scope of this article. LiveGraphics3D's parameters use a slightly different construction known as a rule, written a -> 2. In LiveGraphics3D, these are all treated as (double precision) floating point numbers. It is not necessary to declare the data type of a variable before assigning it a value, and Mathematica does automatic conversion between the various types of numbers. Assignments and RulesĪs with most languages, you can assign a value to a variable using an equal sign, as in a = 2. It is defined to be Pi/180 so that, for example, 270*Degree evaluates to 3*Pi/2. (The capitalization is important.) The constant Degree might also be useful to convert from degrees to radians. The most recognizable of these are Pi and E. Mathematica and LiveGraphics3D recognize a number of mathematical constants. Is essentially invisible to either Mathematica or LiveGraphics3D. If you wish, you may jump directly to one of the following topics by clicking on the link.Īny expression delineated by (* and *), such as The Document Center also has a searchable index of Mathematica functions with examples. Their Documentation Center currently offers free access to The Mathematica Book ( Wolfram, 2003) which describes all aspects of the program. Further information can be found at Wolfram Research's website. This page contains a very brief overview of the syntax used throughout the rest of the article.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |