In the mathematics of physics and engineering, the term field is used for a function of three real numbers, the latter of which can be the coordinates of a position in space. Such fields can be used to mathematically model physical fields, physical phenomena which vary over space. A scalar field is a function over space that maps to a scalar (single number) and a physical phenomenon it might represent is temperature throughout some space (e.g., a precise temperature throughout every point in a room of some house). A vector field is a function over space that maps to a vector, such as could represent the air-movement velocity at every point in such a room. Such mathematical fields are ubiquitous in physics and astrophysics models, and a type of calculus (vector calculus) deals with them, using such operators as gradient, curl, and divergence.
Characteristics of fields are often explained and/or illustrated using two dimensions since many characteristics of three dimensions will hold. An example of a scalar function on two dimensions is the altitude of each point on some plot of land. The gradient of this function results in a vector function of the same two dimensions indicating the direction "most upward" traveling across a point on the plot of land, with a vector magnitude indicating its steepness. The identical principle applies to the scalar field cited above: the three-dimensional case of temperature throughout a room: the gradient of the scalar field yields a vector field indicating direction over which temperature rises most rapidly with distance and how rapid it rises in that direction.
Among the applications are gravitational fields, electric fields, and magnetic fields (vector fields), and gravitational potential and electric potential (scalar fields). Maxwell's equations are generally represented as equations of fields, incorporating vector calculus.
Such three dimensional fields are well-adapted to non-relativistic physics, describing the state of things at a particular instant. Dealing with fields in light of relativity requires some adaptation, dealing with four dimensions (e.g., Einstein's Einstein's field equation), or with the three dimensions of some well-defined slice of spacetime, etc.
The term field has other uses in mathematics, for other meanings, including abstract algebra, where it is a type of group with additional characteristics (also qualifying as a ring and an algebra). This usage may well also arise in astrophysics since abstract algebra has found applications in physics.