Skip to content

Functions

Every function here is Desmos’ own, written as a call: sin(x), mean(L). A function of one list may also be written after it, as a member - L.mean is mean(L).

A name that is none of these, called like one, is an error (unknown-function) rather than the product of variables Desmos would take it for.

sin(x) - Sine function

In radians, unless config { degreeMode: true } says degrees.

cos(x) - Cosine function

In radians, unless config { degreeMode: true } says degrees.

tan(x) - Tangent function

In radians, unless config { degreeMode: true } says degrees.

csc(x) - Cosecant function

The reciprocal of sin. In radians, unless config { degreeMode: true } says degrees.

sec(x) - Secant function

The reciprocal of cos. In radians, unless config { degreeMode: true } says degrees.

cot(x) - Cotangent function

The reciprocal of tan. In radians, unless config { degreeMode: true } says degrees.

arcsin(x) - Arcsine function

Answers in radians, unless config { degreeMode: true } says degrees.

arccos(x) - Arccosine function

Answers in radians, unless config { degreeMode: true } says degrees.

arctan(x) - Arctangent function

Answers in radians, unless config { degreeMode: true } says degrees.

arccsc(x) - Arccosecant function

Answers in radians, unless config { degreeMode: true } says degrees.

arcsec(x) - Arcsecant function

Answers in radians, unless config { degreeMode: true } says degrees.

arccot(x) - Arccotangent function

Answers in radians, unless config { degreeMode: true } says degrees.

sinh(x) - Hyperbolic sine

cosh(x) - Hyperbolic cosine

tanh(x) - Hyperbolic tangent

csch(x) - Hyperbolic cosecant

sech(x) - Hyperbolic secant

coth(x) - Hyperbolic cotangent

arcsinh(x) - Inverse hyperbolic sine

arccosh(x) - Inverse hyperbolic cosine

Defined from 1 up.

arctanh(x) - Inverse hyperbolic tangent

Defined between -1 and 1.

arccsch(x) - Inverse hyperbolic cosecant

arcsech(x) - Inverse hyperbolic secant

Defined above 0, up to 1.

arccoth(x) - Inverse hyperbolic cotangent

Defined outside -1 to 1.

sqrt(x) - Square root

nthroot(x, n) - Nth root

The nth root of x: nthroot(8, 3) is 2.

y = nthroot(x, 3)
Open in playground →

abs(x) - Absolute value

Also written with bars: |x|.

ln(x) - Natural logarithm

log(x) - Logarithm base 10, or to any base with a second argument

log(x, b) is the logarithm of x to the base b: log(8, 2) is 3.

y = log(x)
z = log(8, 2)
Open in playground →

sum(n = 1..10, n) - Sum of a body over a range: sum(n = 1..10, n^2)

The variable is named once, with the range it runs over - both ends included, and either end any expression - and is bound in the body alone.

a = sum(n = 1..10, n^2)
y = sum(k = 0..5, x^k / k!)
Open in playground →

prod(n = 1..10, n) - Product of a body over a range: prod(n = 1..5, n)

The variable is named once, with the range it runs over - both ends included, and either end any expression - and is bound in the body alone.

a = prod(n = 1..5, n)
y = prod(k = 1..3, x - k)
Open in playground →

int(t = 0..1, t) - Definite integral of a body: int(t = 0..1, t^2)

The variable of integration is named once, with the bounds - either of them any expression - and is bound in the body alone.

a = int(t = 0..1, t^2)
y = int(t = 0..x, cos(t))
Open in playground →

exp(x) - Exponential (e^x)

The same as e ^ x.

floor(x) - Floor function

ceil(x) - Ceiling function

round(x) - Round function

sign(x) - Sign function

-1 for a negative number, 1 for a positive one, and 0 for 0. sgn is the same function.

sgn(x) - Sign function

Another name for sign.

mod(x, y) - Modulo

The remainder of x divided by y.

gcd(x, y) - Greatest common divisor

a = gcd(12, 18)
Open in playground →

lcm(x, y) - Least common multiple

cross(u, v) - The cross product of two 3D points; for two numbers, their product

Desmos’ \times. u * v is the dot product of two 3D points, and cross(u, v) the vector at right angles to both.

u = (1, 2, 3)
v = (4, 5, 6)
n = cross(u, v)
d = u * v
Open in playground →

erf(x) - Error function

The integral of 2 / sqrt(pi) exp(-t^2) from 0 to x, which has no closed form.

total(list) - Sum of list

L = [3, 1, 4, 1, 5]
s = total(L)
Open in playground →

length(list) - Length of list

L = [3, 1, 4, 1, 5]
n = length(L)
Open in playground →

count(list) - Number of elements in a list; also written list.count

Like every function of one list, it may be written after the list as a member: L.count.

L = [3, 1, 4, 1, 5]
n = count(L)
m = L.count
Open in playground →

mean(list) - Mean of list

L = [3, 1, 4, 1, 5]
m = mean(L)
Open in playground →

median(list) - Median of list

L = [3, 1, 4, 1, 5]
m = median(L)
Open in playground →

min(list) - Minimum of list

L = [3, 1, 4, 1, 5]
m = min(L)
Open in playground →

max(list) - Maximum of list

L = [3, 1, 4, 1, 5]
m = max(L)
Open in playground →

stdev(list) - Standard deviation

The sample standard deviation. stdevp is the population one.

L = [3, 1, 4, 1, 5]
s = stdev(L)
Open in playground →

stdevp(list) - Population standard deviation

L = [3, 1, 4, 1, 5]
s = stdevp(L)
Open in playground →

mad(list) - Mean absolute deviation

L = [3, 1, 4, 1, 5]
d = mad(L)
Open in playground →

var(list) - Variance

The sample variance. varp is the population one.

L = [3, 1, 4, 1, 5]
v = var(L)
Open in playground →

varp(list) - Population variance

L = [3, 1, 4, 1, 5]
v = varp(L)
Open in playground →

quantile(list, p) - The value a fraction p of the way through a list

quantile(L, 0.5) is the median. p runs from 0 to 1, and the answer is interpolated between the two values it falls between.

L = [3, 1, 4, 1, 5]
q = quantile(L, 0.9)
Open in playground →

quartile(list, n) - The first, second or third quartile of a list

quartile(L, 2) is the median; 0 and 4 are the minimum and maximum.

L = [3, 1, 4, 1, 5]
q = quartile(L, 1)
Open in playground →

cov(xs, ys) - Covariance of two lists

The sample covariance. covp is the population one.

xs = [1, 2, 3, 4]
ys = [2, 4, 5, 9]
c = cov(xs, ys)
Open in playground →

covp(xs, ys) - Population covariance of two lists

xs = [1, 2, 3, 4]
ys = [2, 4, 5, 9]
c = covp(xs, ys)
Open in playground →

corr(xs, ys) - Correlation coefficient of two lists

Pearson’s r, from -1 to 1.

xs = [1, 2, 3, 4]
ys = [2, 4, 5, 9]
r = corr(xs, ys)
Open in playground →

spearman(xs, ys) - Rank correlation of two lists

Spearman’s rho: the correlation of the two lists’ ranks, so any rising relationship scores 1.

xs = [1, 2, 3, 4]
ys = [2, 4, 5, 9]
r = spearman(xs, ys)
Open in playground →

tscore(list, mu) - The t-score of a list’s mean against a value

(mean(L) - mu) / (stdev(L) / sqrt(length(L))).

L = [3, 1, 4, 1, 5]
t = tscore(L, 2)
Open in playground →

discretedist(values, weights) - Discrete distribution over values with optional weights (new in Desmos v1.12)

Without weights, every value is equally likely.

D = discretedist([1, 2, 3], [0.2, 0.3, 0.5])
Open in playground →

random() - Random number in [0, 1); random(n) gives a list of n, random(list) shuffles it

The numbers stay put until the graph is reseeded; config { randomSeed: "…" } fixes the seed.

a = random()
L = random(5)
Open in playground →

normaldist(mean, stdev) - Normal distribution with a mean and a standard deviation

With no arguments, the standard normal: mean 0, standard deviation 1. Evaluate one with .pdf(x), .cdf(x) or .random(n).

D = normaldist(0, 1)
y = D.pdf(x)
Open in playground →

tdist(dof) - Student’s t-distribution with some degrees of freedom

T = tdist(4)
y = T.pdf(x)
Open in playground →

chisqdist(dof) - Chi-squared distribution with some degrees of freedom

C = chisqdist(3)
y = C.pdf(x)
Open in playground →

uniformdist(min, max) - Uniform distribution between two values

With no arguments, between 0 and 1.

U = uniformdist(0, 4)
p = U.cdf(1)
Open in playground →

binomialdist(trials, p) - Binomial distribution: successes in some trials, each with a probability

B = binomialdist(10, 0.5)
p = B.pdf(5)
Open in playground →

poissondist(mean) - Poisson distribution with a mean

P = poissondist(3)
p = P.pdf(2)
Open in playground →

geodist(p) - Geometric distribution: trials until the first success

G = geodist(0.3)
p = G.cdf(4)
Open in playground →

pdf(dist, x) - A distribution’s probability density (or mass) at a value; usually written D.pdf(x)

D = normaldist(0, 1)
y = D.pdf(x)
Open in playground →

cdf(dist, x) - The probability a distribution’s value is at most x, or between two values; usually written D.cdf(x)

D.cdf(x) is the probability of a value up to x, and D.cdf(a, b) of one between a and b.

D = normaldist(0, 1)
p = D.cdf(1)
q = D.cdf(-1, 1)
Open in playground →

ttest(list) - t-test of one list against a mean, or of two lists against each other

With one list, it tests its mean against 0 - .null(mu) changes that. With two, it tests the difference of their means. Read the result with its members: .score, .pleft, .pright, .dof, .estimate, .stderr, .conf(level).

before = [12, 15, 11, 14]
after = [14, 17, 13, 15]
p = ttest(before, after).pleft
Open in playground →

ztest(list, sigma) - z-test of a list’s mean, given the population standard deviation

L = [12, 15, 11, 14]
z = ztest(L, 2).score
Open in playground →

zproptest(successes, count) - z-test of a proportion: successes out of a count, or two of them compared

p = zproptest(40, 100).pleft
q = zproptest(40, 100, 70, 100).score
Open in playground →

chisqtest(column, column) - Chi-squared test for independence of the columns of a two-way table

c = chisqtest([10, 20], [30, 25]).score
Open in playground →

chisqgof(observed, expected) - Chi-squared goodness-of-fit test of observed counts against expected ones

g = chisqgof([10, 20, 30], [20, 20, 20]).score
Open in playground →

score(test) - A test’s statistic: its t, z or chi-squared score; usually written T.score

L = [12, 15, 11, 14]
T = ttest(L)
s = T.score
Open in playground →

pleft(test) - A test’s p-value for the alternative that the true value is less; usually written T.pleft

L = [12, 15, 11, 14]
T = ttest(L)
p = T.pleft
Open in playground →

pright(test) - A test’s p-value for the alternative that the true value is greater; usually written T.pright

L = [12, 15, 11, 14]
T = ttest(L)
p = T.pright
Open in playground →

dof(test) - A test’s degrees of freedom; usually written T.dof

L = [12, 15, 11, 14]
T = ttest(L)
d = T.dof
Open in playground →

estimate(test) - The value a test estimates, such as a sample mean; usually written T.estimate

L = [12, 15, 11, 14]
T = ttest(L)
m = T.estimate
Open in playground →

stderr(test) - A test’s standard error; usually written T.stderr

L = [12, 15, 11, 14]
T = ttest(L)
se = T.stderr
Open in playground →

conf(test, level) - A confidence interval at a level; usually written T.conf(0.95)

Its ends are read with .lower and .upper.

L = [12, 15, 11, 14]
T = ttest(L)
C = T.conf(0.95)
lo = C.lower
hi = C.upper
Open in playground →

null(test, value) - The same test against another null value; usually written T.null(mu)

L = [12, 15, 11, 14]
T = ttest(L)
p = T.null(12).pright
Open in playground →

lower(interval) - The lower end of a confidence interval; usually written C.lower

L = [12, 15, 11, 14]
T = ttest(L)
lo = T.conf(0.95).lower
Open in playground →

upper(interval) - The upper end of a confidence interval; usually written C.upper

L = [12, 15, 11, 14]
T = ttest(L)
hi = T.conf(0.95).upper
Open in playground →

histogram(list, width) - Histogram of a list, with an optional bin width

A statement of its own: it draws the chart, and cannot be assigned or used in an expression. binAlignment and histogramMode set it up.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
histogram(L, 2) @ binAlignment: left
Open in playground →

dotplot(list) - Dot plot of a list, with an optional bin width

A statement of its own: it draws the chart, and cannot be assigned or used in an expression. dotplotXMode says whether a dot stands at its value or its bin.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
dotplot(L) @ dotplotXMode: bin
Open in playground →

boxplot(list) - Box-and-whisker plot of a list

A statement of its own: it draws the chart, and cannot be assigned or used in an expression. axisOffset and breadth place and size it; showBoxplotOutliers: false draws the whiskers to the extremes.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
boxplot(L) @ axisOffset: 2, breadth: 1
Open in playground →

stats(list) - A row of summary statistics for a list: min, quartiles, max

A statement of its own, shown in the expression list; it cannot be assigned or used in an expression.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
stats(L)
Open in playground →

repeat(value, n) - Repeat a value or list n times (new in Desmos v1.12)

L = repeat(2, 3)
Open in playground →

join(a, b) - Concatenate lists or values into one list

L = join([1, 2], [3, 4])
Open in playground →

sort(list) - Sort a list, optionally by a second list

Given a second list, sorts the first by it.

L = sort([3, 1, 2])
M = sort([10, 20, 30], [3, 1, 2])
Open in playground →

unique(list) - The distinct values of a list, in the order they first appear

L = unique([1, 2, 2, 3, 1])
Open in playground →

shuffle(list) - A list in random order

L = shuffle([1, 2, 3, 4, 5])
Open in playground →

polygon(points) - Polygon from points or a point list

Takes the vertices as separate points, or one list of points.

polygon((0, 0), (4, 0), (2, 3))
Open in playground →

polygonGlider(polygon, t) - The point a fraction of the way around a polygon’s perimeter

T = polygon((0, 0), (4, 0), (2, 3))
polygonGlider(T, 0.5)
Open in playground →

polygonInteriorDirectedAngles(polygon, n) - The signed interior angles of a polygon

T = polygon((0, 0), (4, 0), (2, 3))
A = polygonInteriorDirectedAngles(T, 1)
Open in playground →

distance(A, B) - Distance between two points

d = distance((0, 0), (3, 4))
Open in playground →

midpoint(A, B) - Midpoint of two points

midpoint((0, 0), (4, 2))
Open in playground →

segment(A, B) - The segment between two points

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
s = segment(A, B)
Open in playground →

line(A, B) - The line through two points

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
line(A, B)
Open in playground →

ray(A, B) - The ray from one point through another

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
ray(A, B)
Open in playground →

vector(A, B) - The vector from one point to another

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
v = vector(A, B)
Open in playground →

circle(center, radius) - A circle about a centre, through a point or with a radius

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
circle(A, B)
circle(B, 2)
Open in playground →

arc(A, B, C) - The arc through three points, from the first to the last

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
arc(A, C, B)
Open in playground →

glider(path, t) - A point a fraction of the way along a path, which the viewer can slide

The path is a segment, a line, a circle, an arc or a polygon; t from 0 to 1 goes once along it.

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
s = segment(A, B)
P = glider(s, 0.25)
Open in playground →

parallel(line, point) - The line through a point parallel to a line

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
parallel(line(A, B), C)
Open in playground →

perpendicular(line, point) - The line through a point perpendicular to a line

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
perpendicular(line(A, B), C)
Open in playground →

intersection(a, b) - Where two lines, circles or arcs cross

Where two objects cross more than once, it is a list of the points.

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
P = intersection(circle(A, B), line(B, C))
Open in playground →

strictintersection(a, b) - Where two objects cross, only within their extents

A segment, a ray or an arc stops where it ends here, where intersection treats it as the whole line or circle.

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
P = strictintersection(segment(A, B), segment(C, (2, -2)))
Open in playground →

angle(A, vertex, C) - The angle at the middle of three points

Always the smaller way round; directedangle keeps the direction.

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
a = angle(A, B, C)
Open in playground →

directedangle(A, vertex, C) - The angle turned from the first point to the last about the middle one

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
a = directedangle(A, B, C)
Open in playground →

angles(polygon) - The interior angles of a polygon

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
T = polygon(A, B, C)
angles(T)
Open in playground →

directedangles(polygon) - The signed interior angles of a polygon

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
T = polygon(A, B, C)
directedangles(T)
Open in playground →

anglebisector(angle) - The ray that bisects an angle

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
anglebisector(angle(A, B, C))
Open in playground →

coterminal(angle) - The other way round an angle

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
coterminal(angle(A, B, C))
Open in playground →

supplement(angle) - The supplement of a directed angle

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
supplement(directedangle(A, B, C))
Open in playground →

center(circle) - The centre of a circle or an arc

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
c = circle(A, B)
O = center(c)
Open in playground →

radius(circle) - The radius of a circle or an arc

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
c = circle(A, B)
r = radius(c)
Open in playground →

area(polygon) - The area of a polygon

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
a = area(polygon(A, B, C))
Open in playground →

perimeter(polygon) - The perimeter of a polygon

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
p = perimeter(polygon(A, B, C))
Open in playground →

start(vector) - The point a vector starts at

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
v = vector(A, B)
start(v)
Open in playground →

end(vector) - The point a vector ends at

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
v = vector(A, B)
end(v)
Open in playground →

vertices(polygon) - The corners of a polygon, as a list of points

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
vertices(polygon(A, B, C))
Open in playground →

segments(polygon) - The sides of a polygon, as a list of segments

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
segments(polygon(A, B, C))
Open in playground →

translate(object, from, to) - An object moved by a vector, or from one point to another

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
T = polygon(A, B, C)
translate(T, A, (2, 2))
Open in playground →

rotate(object, center, angle) - An object turned about a point by an angle

The angle is a number, or an angle made with angle.

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
T = polygon(A, B, C)
rotate(T, A, pi / 2)
Open in playground →

dilate(object, center, factor) - An object scaled about a point by a factor

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
T = polygon(A, B, C)
dilate(T, A, 2)
Open in playground →

reflect(object, line) - An object reflected in a line

config { calculator: GEOMETRY }
A = (0, 0)
B = (4, 1)
C = (1, 3)
T = polygon(A, B, C)
reflect(T, line(A, B))
Open in playground →

triangle(A, B, C) - The triangle with three 3D points as corners

config { calculator: GRAPHING_3D }
triangle((0, 0, 0), (1, 0, 0), (0, 1, 1))
Open in playground →

sphere(center, radius) - The sphere about a 3D point with a radius

config { calculator: GRAPHING_3D }
sphere((0, 0, 0), 2)
Open in playground →

rgb(r, g, b) - Color from red, green, blue (0-255)

Each channel runs from 0 to 255. A colour is a value like any other, so it may be stored in a variable and given to color:.

y = sin(x) @ color: rgb(255, 128, 0)
Open in playground →

hsv(h, s, v) - Color from hue, saturation, value

Hue in degrees, 0 to 360; saturation and value from 0 to 1.

y = sin(x) @ color: hsv(200, 0.8, 0.9)
Open in playground →

okhsv(h, s, v) - Perceptually uniform color from hue, saturation, value (new in Desmos v1.12)

y = sin(x) @ color: okhsv(200, 0.8, 0.9)
Open in playground →

oklab(l, a, b) - Perceptually uniform color from lightness, a, b (new in Desmos v1.12)

y = sin(x) @ color: oklab(0.6, 0.1, -0.1)
Open in playground →

oklch(l, c, h) - Perceptually uniform color from lightness, chroma, hue (new in Desmos v1.12)

y = sin(x) @ color: oklch(0.6, 0.15, 30)
Open in playground →

nCr(n, r) - Combinations

How many ways to choose r of n things, order not counting.

nPr(n, r) - Permutations

How many ways to arrange r of n things, order counting.

factorial(n) - Factorial

Also written postfix: 5!.

a = factorial(5)
b = 5!
Open in playground →

real(z) - Real part of a complex number

Only in complex mode, which config { allowComplex: true } turns on.

config { allowComplex: true }
z = 3 + 4i
a = real(z)
Open in playground →

imag(z) - Imaginary part of a complex number

Only in complex mode, which config { allowComplex: true } turns on.

config { allowComplex: true }
z = 3 + 4i
b = imag(z)
Open in playground →

conj(z) - Complex conjugate

Only in complex mode, which config { allowComplex: true } turns on.

config { allowComplex: true }
z = 3 + 4i
w = conj(z)
Open in playground →

arg(z) - Argument (angle) of a complex number

The angle from the positive real axis, from -π to π. Only in complex mode, which config { allowComplex: true } turns on.

config { allowComplex: true }
z = 3 + 4i
m = arg(z)
Open in playground →

tone(frequency, volume) - Play a tone at a frequency in hertz, at a volume of 0-1

Desmos shows a button to play it.