Scalar (mathematics)
Introduction
In mathematics, a scalar is a type of quantity that is fully described by a single element of a number field such as a real number, often accompanied by units of measurement. A scalar is usually said to be a quantity that only has magnitude and no direction, unlike vectors, matrices, and tensors.
Definition
Formally, a scalar is a value that doesn't change with a change of coordinate system. In other words, it is invariant under coordinate transformations. This is in contrast to quantities such as vectors and tensors, which transform in a specific way under coordinate transformations.
Scalar Fields
A scalar field associates a scalar value to every point in a space. The scalar may either be a mathematical number or a physical quantity. Scalar fields are required to be coordinate-independent, meaning that any two observers using the same units will agree on the value of the scalar field at the same absolute point in space (or spacetime) regardless of their respective points of origin.
Scalars in Physics
In physics, scalar quantities are those that can be described by a single number, giving their magnitude but not direction. Examples of scalar quantities in physics include time, temperature, volume, energy, mass, and charge.
Scalars in Computer Science
In computer science, a scalar is a variable that can hold only one value at a time. It is the simplest data type and includes integers, floating point numbers, and characters.
Scalars in Linear Algebra
In linear algebra, a scalar is often used to define a scalar multiplication operation, which takes a vector and a scalar and produces another vector. In this context, a scalar is a single number, typically a real number.