Grapher

From Mac Guides

Jump to: navigation, search

Grapher is a graphing calculator application included with Mac OS X 10.4 (Tiger) and later. Originally named Curvus Pro X, it was purchased by Apple from Arizona Software in 2004. Grapher is able to draw both 2D and 3D graphs.

Contents

Using Grapher

Image:Equation_pop-up.png is the "equation pop-up" and is located on the far right of the equation field. To show the equation palette:

  • Window → Show Equation Palette, or
  • Image:Equation_pop-up.png → Show Equation Palette, or
  • shift-⌘-E

Some commonly used items (eg π, √ ) can be entered with a single keystroke when combined with the "option" modifier key. To view these special characters, open the keyboard viewer and hold down "option" or "option+shift".

Values & Definitions

Every Grapher expression has a value type: scalar, multi-valued, a range, or a 2D or 3D vector.

Types
TypeSyntax ExampleNotes
scalar 1.5numeric constant
π Built-in constant. You can type out the constant name ("pi"), and Grapher will replace it with the symbol ("π")
multi-valued{0, π, 2π} When used in an expression, the expression is evaluated for each value. The expression is then multi-valued. For example, {0,1,2} * π is equivalent to {0,π,2π}. For another example, with a:={0,π/2,π}, we have cos(a)={cos(0),cos(π/2),cos(π)}={1,0,-1}
range0..1 The number of dots, as long as there are at least 2, does not seem to matter.
vector Image:Vect_x_y.png

Image:Vector_3D.png

Use equation palette → Operators to enter vectors. A vector whose elements are the axes variables (e.g. Image:Vect_x_y.png) is called an "axis vector".

Some operators and functions can take more than 1 type for an argument. For example, you can add a range and a scalar. The types of the arguments determines the type of the expression.

Equations in Grapher are either definitions or graph equations. Definitions let you define your own constants and expressions. To define a symbol, create a new equation, then enter the symbol name (and argument if it's a function), followed by "=" or ":=" and an expression. When defining a symbol, Grapher may misinterpret "=" and give syntax errors. You can also define a symbol inline at the end of a graph equation by appending a comma followed by the definition. Example definitions:

  • scalar constant:φ := (1+5)/2
  • function:f(t) := t sin(t)
  • inline:y=mx+b,m=2,b=-1

Operators

Grapher has the standard arithmetic operators you find on calculators: ^ (power), *, /, + and -/. In addition are operators found on graphing calculators.

Operators
CategoryPriorityOperatorsInputNameNotes
Boolean 1 ==equal Comparison operators.
!=, <>not equal
<<less than
>>greater than
<=less than or equal
>=greater than or equal
2!
¬
!
equation palette → Symbols → ¬
not Boolean negation.
3&
&
equation palette → Symbols → ∧
and Conjunction. "a & b" is true if both "a" and "b" are true. You can also enter "∧" by turning off shortcuts in the equation palette and typing "^".
4 |
|
equation palette → Symbols → ∨
or Disjunction. "a | b" is true if at least one of "a" or "b" are true.
equation palette → Symbols → ⊗xor, either-or, exclusive-or "a ⊗ b" is true if either "a" or "b" is true (not both).
equation palette → Symbols → ∈element of, is-in "x ∈ [-1,5]" is true if x is in the interval "[-1, 5]"
equation palette → Symbols → ∉not an element of, not-in "x ∉ [-1,5]" is true if x is not in the interval "[-1, 5]"
CategoryPriorityOperatorsInputNameNotes
Arithmetic

sqrt(▯)
option-v, equation palette → Standard → 

sqrt()

square root
equation palette → Standard →  n-th root
^

equation palette → Standard → ▯

power
Combinatorics Image:NCk.png equation palette → Operators → Image:Combination.png choose Number of ways of choosing k items from n items.
nCk = n! / k!(n-k)!
Interval
1~~complement
2*
*
equation palette → Symbols → ∩
intersection
3+
+
equation palette → Symbols → ∪
union
difference
Piecewise Image:Piecewise.pngImage:Equation_pop-up.png → Image:Piecewise_x_neg_0_pos.png Left column is for values, right column is for tests.
?
:
?
:
if-then Value of "a?b" is "b" if "a" is true, undefined otherwise. "a:b" is equivalent to "a?b".
?:
::
?:
::
if-then-else Value of "a?b:c" is "b" if "a" is true, "c" otherwise. "a:b:c" is equivalent to "a?b:c".
CategoryPriorityOperatorsInputNameNotes
Series Image:Sum.png option-s
Image:Equation_pop-up.png → ∑
equation palette → Operators → ∑
Sum
Image:Product.png option-shift-P
Image:Equation_pop-up.png → ∏
equation palette → Operators → ∏
Product
Calculusoption-d, Image:Equation_pop-up.png → ∂partial differential
Image:Partial_wrt_t.png ∂ / ∂ t
equation palette → Operators → Image:Partial_wrt_t.png
partial derivative wrt t Leibniz's notation. If you use the equation palette to enter the derivative operator, you can change the differential 't' in the normal way (selecting it & typing a replacement).
Image:Nth_partial_wrt_t.png ∂ ^ n / ∂ t ^ n
equation palette → Operators → Image:Nth_partial_wrt_t.png
nth partial derivative wrt t You can change the differential 't' and degree 'n' in the normal way.
'
̇
'
Image:Equation_pop-up.png → Image:X_dot.png
derivative Derivative, using Lagrange's and Newton's notation, respectively. Repeat n times for the nth derivative.
Image:Integral.png option-b
Image:Equation_pop-up.png → ∫
equation palette → Operators → ∫
integral Performs numeric, rather than symbolic, integration
CategoryPriorityOperatorsInputNameNotes

Parametric equations

Parametric equations are based on vectors and ranges. Rather than setting the default dependent variable "y" equal to an expression, you set an axis vector (eg Image:Vect_x_y.png) equal to a vector expression. Independent variables can have any name but must have a range value. The independent variable can be defined inline or separately from the parametric equation. See examples below.

Examples

Function Graph Output
y=sin(x)
Enlarge
y=sqrt(1+x^2)
Enlarge
Image:ConditionInput.png
Enlarge
y=x>-1?x
Enlarge
Image:Parametric_circle_equation.png Image:Circle_graph.png
Image:U=0..2pi.png


Image:Cos5u,sin4u.png

Image:Cos5u,sin4u_graph.png
Image:Mulit-range eqn.png Image:Mulit-range graph.png

Screenshots

See also