Graphing a Circle

You can express a unit circle centered at origin in many ways:

  • Implicit relation

    x^2 + y^2 = 1
  • Polar equation

    r = 1
  • Combinations of explicit relations

    y = sqrt(1 − x^2) ∨ y = −sqrt(1 − x^2)
    x = sqrt(1 − y^2) ∨ x = −sqrt(1 − y^2)
  • Parametric equation

    x = cos(t) ∧ y = sin(t)
  • Complex function

    x + i y = exp(i t)

In Graphest, each of the above formulae is called a relation.

Entering a Relation

  • A relation must contain at least one of =, <, , >, or , as in y = sin(x) or sin(x) < cos(y).

  • Enter the product of x and y as x y, instead of xy.

    • You don’t need a space around parentheses or in a expression like 2x.

  • Enter the sine of \(x\) as sin(x), instead of sinx or sin x.

  • Use parentheses ( ) to group a part of a relation, as in 1 / (x + 3).

    • Other kinds of brackets such as [ ] or { } cannot be used for this purpose.

  • You can use x, y, r and θ as coordinate variables.

    • Each point in Cartesian coordinates has infinitely many counterparts in polar coordinates. For example, \((x, y) = (1, 0)\) is identical to \((r, θ) = (1, 0), (1, ±2π), (1, ±4π), …; (−1, ±π), (−1, ±3π), …\)

    • You can restrict the range of r or θ, as in r = θ ∧ 0 ≤ θ < 2π.

  • You can use t as a real parameter. Example:

    x = t cos(t) ∧ y = t sin(t) ∧ 0 ≤ t < 2π
  • You can use m and n as independent integer parameters. Example:

    (x − 0.3m)^2 + (y − 0.3n)^2 < 0.1^2 ∧ |n| ≤ 5 ∧ mod(m + n, 3) = 0

Reading a Graph

Each pixel of a graph is painted based on whether it contains a solution of the relation or not.

Pixel Color Meaning

Opaque

The pixel contains a solution.

Translucent

The pixel may or may not contain a solution.

Transparent

The pixel does not contain a solution.

Built-in Definitions

Constants

Input Interpreted as Notes Links

Real Numbers

123
123.5
.5

123
123.5
0.5

e

\(e ≈ 2.71828\)

The base of natural logarithms.

MW WFS

pi or π

\(π ≈ 3.14159\)

MW WFS

gamma or γ

\(γ ≈ 0.577216\)

The Euler–Mascheroni constant.

MW WFS

Complex Numbers

i

\(i = \sqrt{−1}\)

The imaginary unit.

MW WFS

Variables

Input Interpreted as Notes

Cartesian Coordinate System

x

\(x\)

The horizontal coordinate.

y

\(y\)

The vertical coordinate.

Polar Coordinate System

r

\(r\)

The radial coordinate.

theta or θ

\(θ\)

The angular coordinate.

Integer Parameters

m

\(m\)

A parameter that spans all integers.

n

\(n\)

A parameter that spans all integers.

Real Parameter

t

\(t\)

A parameter that spans all real numbers.

A relation \(R\) that contains parameters is interpreted as \(∃m, n ∈ ℤ, ∃t ∈ ℝ : R\).

Real Functions

Arithmetic

Input Interpreted as Notes

−x

\(−x\)

x + y

\(x + y\)

x − y

\(x − y\)

x y or x * y

\(xy = x ⋅ y\)

x / y

\(\dfrac{x}{y}\)

Undefined for \(y = 0\).

Number Parts

Input Interpreted as Notes Links

abs(x) or |x|

\(|x|\)

The absolute value of \(x\).

MW WFS

sign(x) or sgn(x)

\(\sgn x = \begin{cases} -1 & \if x < 0, \\ 0 & \if x = 0, \\ 1 & \if x > 0 \end{cases}\)

The sign function.

MW WFS

Exponentiation and Logarithm

Input Interpreted as Notes Links

sqrt(x)

\(\sqrt{x} = x^{1/2}\)

Undefined for \(x < 0\).

MW WFS

x^y

\(x^y\)

x^y^z is equivalent to x^(y^z).

MW WFS

x^^y

\(x^y\) with some extension

The cube root of \(x\) can be entered as x^^(1/3).
x^^y^^z is equivalent to x^^(y^^z).

exp(x)

\(\exp x = e^x\)

MW WFS

ln(x)

\(\ln x = \log_e x\)

Undefined for \(x ≤ 0\).

MW WFS

log(b, x)

\(\log_b x = \dfrac{\ln x}{\ln b}\)

Undefined for \(x ≤ 0\), \(b ≤ 0\), and \(b = 1\).

MW WFS

Comparison of x^y and x^^y

For \(x ≥ 0\), both x^y and x^^y gives the same value, \(x^y\). For \(x < 0\), x^y is only defined for integer exponents, while x^^y is also defined for rational number exponents with odd denominators. The exact definition of these operators are as follows.

  • For an integer \(n\), both x^n and x^^n gives:

    \(x^n = \begin{cases} \overbrace{x × ⋯ × x}^{(n \text{ copies})} & \if n > 0, \\ 1 & \if n = 0 ∧ x ≠ 0, \\ 1 / x^{-n} & \if n < 0. \end{cases}\)

    \(0^0\) is left undefined.

  • For a non-integer \(y\), they can give different results:

    • x^y gives the principal value of \(e^{y \ln x}\) or its limit as \(x → 0\):

      \(x^y = \begin{cases} 0 & \if x = 0 ∧ y > 0, \\ e^{y \ln x} & \otherwise. \end{cases}\)

    • If \(y\) is a rational number \(p/q\) with odd \(q\), assuming \(p\) and \(q\) \((> 0)\) be coprime integers, x^^y gives \((\sqrt[q]{x})^p\), where \(\sqrt[q]{x}\) is the real-valued \(q\)th root of \(x\).

    • Otherwise, x^^y gives the same result as x^y described above.

Trigonometry

Input Interpreted as Notes Links

Trigonometric Functions

sin(x)

\(\sin x\)

MW WFS

cos(x)

\(\cos x\)

MW WFS

tan(x)

\(\tan x\)

MW WFS

Inverse Trigonometric Functions

asin(x)

\(\sin^{−1} x\)

The range is \([−π/2, π/2]\).

MW WFS

acos(x)

\(\cos^{−1} x\)

The range is \([0, π]\).

MW WFS

atan(x)

\(\tan^{−1} x\)

The range is \((−π/2, π/2)\).

MW WFS

atan2(y, x)

The two-argument arctangent.
Undefined for \((x, y) = (0, 0)\).
The range is \((−π, π]\).

MW WFS

Hyperbolic Functions

sinh(x)

\(\sinh x\)

MW WFS

cosh(x)

\(\cosh x\)

MW WFS

tanh(x)

\(\tanh x\)

MW WFS

Inverse Hyperbolic Functions

asinh(x)

\(\sinh^{−1} x\)

MW WFS

acosh(x)

\(\cosh^{−1} x\)

MW WFS

atanh(x)

\(\tanh^{−1} x\)

MW WFS

Divisibility

Input Interpreted as Notes Links

mod(x, y)

\(x \bmod y = x - y \left⌊ \dfrac{x}{y} \right⌋\)

The remainder of \(x/y\) (modulo operation).
Undefined for \(y = 0\).
The range for a fixed \(y\) is \(\begin{cases} (y, 0] & \if y < 0, \\ [0, y) & \if y > 0. \end{cases}\)

MW WFS

gcd(x1, …, xn)

\(\gcd \set{x_1, …, x_n}\)

The greatest common divisor of the numbers in the set \(\set{x_1, …, x_n}\).
\(\gcd \set{x, 0}\) is defined to be \(|x|\) for any rational number \(x\).
Undefined if any of the numbers is irrational.

MW WFS

lcm(x1, …, xn)

\(\lcm \set{x_1, …, x_n}\)

The least common multiple of the numbers in the set \(\set{x_1, …, x_n}\).
\(\lcm \set{x, 0}\) is defined to be 0 for any rational number \(x\).
Undefined if any of the numbers is irrational.

MW WFS

Ordering

Input Interpreted as Notes Links

max(x1, …, xn)
min(x1, …, xn)

\(\max \set{x_1, …, x_n}\)
\(\min \set{x_1, …, x_n}\)

The largest and the smallest elements of the set \(\set{x_1, …, x_n}\), respectively.

MW WFS
MW WFS

rankedMax([x1, …, xn], k) rankedMin([x1, …, xn], k)

The \(k\)th largest and the \(k\)th smallest elements of the list \(\list{x_1, …, x_n}\), respectively.

Rounding

Input Interpreted as Notes Links

floor(x) or ⌊x⌋

\(⌊x⌋\)

The floor function.

MW WFS

ceil(x) or ⌈x⌉

\(⌈x⌉\)

The ceiling function.

MW WFS

Complex Functions

To use a complex function when all arguments are real, add a dummy imaginary part to one of them as x + 0i.

Arithmetic

Input Interpreted as Notes

−z

\(−z\)

z + w

\(z + w\)

z − w

\(z − w\)

z w or z * w

\(zw = z ⋅ w\)

z / w

\(\dfrac{z}{w}\)

Undefined for \(w = 0\).

Number Parts

Input Interpreted as Notes Links

Real-Valued

Re(z)

\(\Re z\)

The real part of \(z\).

MW WFS

Im(z)

\(\Im z\)

The imaginary part of \(z\).

MW WFS

abs(z) or |z|

\(|z|\)

The absolute value of \(z\).

MW WFS

arg(z)

\(\arg z\)

The argument of \(z\).
Undefined for \(z = 0\).

MW WFS

Complex-Valued

~z

\(\bar z\)

The complex conjugate of \(z\).

MW WFS

sgn(z) or sign(z)

\(\sgn z = \begin{cases} 0 & \if z = 0, \\ \dfrac{z}{|z|} & \if z ≠ 0 \end{cases}\)

The complex sign of \(z\).

MW WFS

Exponentiation and Logarithm

Input Interpreted as Notes Links

sqrt(z)

\(\sqrt{z} = z^{1/2}\)

Branch cuts: \((−∞, 0)\), continuous from above.

MW WFS

z^w

\(z^w = \begin{cases} 0 & \if z = 0 ∧ \Re w > 0, \\ e^{w \ln z} & \if z ≠ 0 \end{cases}\)

Undefined for \((z, w)\) if \(z = 0 ∧ \Re w ≤ 0\).
Branch cuts for a fixed non-integer \(w\): \((−∞, 0)\), continuous from above.

MW WFS

exp(z)

\(\exp z = e^z\)

MW WFS

ln(z)

\(\ln z = \log_e z\)

Undefined for \(z = 0\).
Branch cuts: (−∞, 0), continuous from above.

MW WFS

log(b, z)

\(\log_b z = \dfrac{\ln z}{\ln b}\)

Undefined for \(z = 0\), \(b = 0\), and \(b = 1\).
Branch cuts for a fixed \(b\): \((−∞, 0)\), continuous from above.
Branch cuts for a fixed \(z\): \((−∞, 0)\), continuous from above.

MW WFS

Trigonometry

Input Interpreted as Notes Links

Trigonometric Functions

sin(z)

\(\sin z\)

MW WFS

cos(z)

\(\cos z\)

MW WFS

tan(z)

\(\tan z\)

MW WFS

Inverse Trigonometric Functions

asin(z)

\(\sin^{−1} z\)

Branch cuts: \((−∞, −1)\), continuous from above; \((1, ∞)\), continuous from below.

MW WFS

acos(z)

\(\cos^{−1} z\)

Branch cuts: \((−∞, −1)\), continuous from above; \((1, ∞)\), continuous from below.

MW WFS

atan(z)

\(\tan^{−1} z\)

Branch cuts: \((−i∞, −i)\), continuous from the left; \((i, i∞)\), continuous from the right.

MW WFS

Hyperbolic Functions

sinh(z)

\(\sinh z\)

MW WFS

cosh(z)

\(\cosh z\)

MW WFS

tanh(z)

\(\tanh z\)

MW WFS

Inverse Hyperbolic Functions

asinh(z)

\(\sinh^{−1} z\)

Branch cuts: \((−i∞, −i)\), continuous from the left; \((i, i∞)\), continuous from the right.

MW WFS

acosh(z)

\(\cosh^{−1} z\)

Branch cuts: \((−∞, 1)\), continuous from above.

MW WFS

atanh(z)

\(\tanh^{−1} z\)

Branch cuts: \((−∞, −1)\), continuous from above; \((1, ∞)\), continuous from below.

MW WFS

Formulae

Equations and Inequalities

Input Interpreted as Notes

x = y

\(x = y\)

\(x\) and/or \(y\) can be either real or complex.

x < y

\(x < y\)

\(x\) and \(y\) must be real.

x <= y or x ≤ y

\(x ≤ y\)

\(x\) and \(y\) must be real.

x > y

\(x > y\)

\(x\) and \(y\) must be real.

x >= y or x ≥ y

\(x ≥ y\)

\(x\) and \(y\) must be real.

These operators can be chained. For example, 0 ≤ θ < 2π is equivalent to 0 ≤ θ ∧ θ < 2π.

Logical Connectives

Input Interpreted as Notes

P && Q or P ∧ Q

\(P ∧ Q\)

Logical conjunction (logical AND).

P || Q or P ∨ Q

\(P ∨ Q\)

Logical disjunction (logical OR).

!P or ¬P

\(¬P\)

Negation (logical NOT).

\(P\) and \(Q\) must be formulae.

Conditional Expressions

Input Interpreted as Notes

if(P, x, y)

\(\begin{cases} x & \if P, \\ y & \otherwise \end{cases}\)

\(P\) must be a formula.
\(x\) and/or \(y\) can be either real or complex.

Special Functions

All functions accept only real inputs at the moment.

Input Interpreted as Notes Links

W(x)
W(k, x)

\(W(x) = W_0(x)\)
\(W_k(x)\)

The Lambert W function.
\(k\) must be either 0 or −1.

MW WFS
MW WFS

Gamma(x) or Γ(x)

\(Γ(x)\)

The gamma function.

MW WFS

Gamma(a, x) or Γ(a, x)

\(Γ(a, x)\)

The upper incomplete gamma function.
\(a\) must be an exact number[1].

MW WFS

lnGamma(x) or lnΓ(x)

\(\ln Γ(x)\)

The log-gamma function.

MW WFS

psi(x) or ψ(x)

\(ψ(x)\)

The digamma function.

MW WFS

erf(x)

\(\operatorname{erf}(x)\)

The error function.

MW WFS

erfc(x)

\(\operatorname{erfc}(x)\)

The complementary error function.

MW WFS

erfi(x)

\(\operatorname{erfi}(x)\)

The imaginary error function.

MW WFS

erfinv(x)

\(\operatorname{erf}^{-1}(x)\)

The inverse error function.

MW WFS

erfcinv(x)

\(\operatorname{erfc}^{-1}(x)\)

The inverse complementary error function.

MW WFS

Ei(x)

\(\operatorname{Ei}(x)\)

The exponential integral.

MW WFS

li(x)

\(\operatorname{li}(x)\)

The logarithmic integral.

MW WFS

Si(x)

\(\operatorname{Si}(x)\)

The sine integral.

MW WFS

Ci(x)

\(\operatorname{Ci}(x)\)

The cosine integral.

MW WFS

Shi(x)

\(\operatorname{Shi}(x)\)

The hyperbolic sine integral.

MW WFS

Chi(x)

\(\operatorname{Chi}(x)\)

The hyperbolic cosine integral.

MW WFS

S(x)
C(x)

\(S(x)\)
\(C(x)\)

The Fresnel integrals.

MW WFS
MW WFS

J(n, x)
Y(n, x)

\(J_n(x)\)
\(Y_n(x)\)

The Bessel functions.
\(n\) must be an integer or a half-integer.

MW WFS
MW WFS

I(n, x)
K(n, x)

\(I_n(x)\)
\(K_n(x)\)

The modified Bessel functions.
\(n\) must be an integer or a half-integer.

MW WFS
MW WFS

Ai(x)
Bi(x)
Ai'(x)
Bi'(x)

\(\operatorname{Ai}(x)\)
\(\operatorname{Bi}(x)\)
\(\operatorname{Ai'}(x)\)
\(\operatorname{Bi'}(x)\)

The Airy functions and their derivatives.

MW WFS
MW WFS
MW WFS
MW WFS

sinc(x)

\(\operatorname{sinc}(x) = \begin{cases} 1 & \if x = 0, \\ \dfrac{\sin x}{x} & \if x ≠ 0 \end{cases}\)

The (unnormalized) sinc function.

MW WFS

K(m)

\(K(m)\)

The complete elliptic integral of the first kind.

MW WFS

E(m)

\(E(m)\)

The complete elliptic integral of the second kind.

MW WFS

zeta(s) or ζ(s)

\(ζ(s)\)

The Riemann zeta function.

MW WFS


1. A number that can be represented as a double-precision floating-point number, such as 1.5 or −3.0625.