liveBook · Manning

Codomain

As explained in Geometry for Programmers

The codomain of a function is the specified set containing the function's possible output values.

A function assigns one output to every allowed input. Its codomain is the set where those outputs are declared to belong—much like an output type in programming. The domain and codomain together specify a function type. section 2.4.1 section 2.4.2

Do not confuse the codomain with the range. For sine, both inputs and the codomain are real numbers, ℝ, while the values sine actually reaches lie only in [-1, 1]. A codomain can therefore be larger than a function’s attained values. section 2.4.1

In geometric modeling, the codomain says what kind of result a rule produces:

  • A geometric transformation maps points in ℝN to points in the same ℝN space. section 2.4.2 section 4.1
  • A vector field maps points in ℝN to vectors in ℝM; the vector space may have different dimensionality. section 2.4.2
  • A scalar field and a signed-distance function map points in space to real numbers. section 2.4.3

From a plane to a surface

A parametric surface uses a two-dimensional input space and a three-dimensional point codomain: f(u, v) → (x, y, z). Thinking this way separates where a surface is parameterized from the 3D space where it appears. section 8.2.1

Table 2.1 Function types used in geometry (view table figure)

Name

Domain

Codomain

Geometric transformation

The whole space

The same space

Vector field

The whole space

Another space representing vectors of some dimensionality

Deformation field

The whole space

Vectors in the same space

Scalar field

The whole space

Real numbers

Signed-distance function

The whole space

Real numbers

Compare common geometry functions by the spaces they accept and the kinds of values they return. section 2.4.3

How Geometry for Programmers covers it

How deep it goes
Defines codomain through functions and works through sine, transformations, vector fields, and surface parameterizations without formal relation theory.
Examples
Uses sine, point translation, vector fields, and f(u, v) → (x, y, z) surface parameterization.
What it assumes
Builds from familiar programming functions while introducing mathematical functions, domains, and codomains in plain language.
What you can do after
Evaluate and understand what a geometric function returns by reading its declared domain and codomain.
How it connects
Connects codomain with domain, range, function types, geometric transformations, vector fields, scalar fields, and signed-distance functions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.