Skip to content
Oakfield Operator Calculus Function Reference Site

Rotated Gaussian

A rotated Gaussian is an anisotropic Gaussian whose principal axes are oriented by a rotation matrix. In Rd\mathbb{R}^d, a common unnormalized form is

g(x)=exp ⁣(12(xμ)TΣ1(xμ))g(x) = \exp\!\left(-\tfrac{1}{2}(x-\mu)^{\mathsf T}\Sigma^{-1}(x-\mu)\right)

where μRd\mu\in\mathbb{R}^d is the center and Σ\Sigma is a symmetric positive-definite covariance matrix.

Writing Σ\Sigma via an eigen/rotation decomposition,

Σ=RΛRT,Λ=diag(σ12,,σd2)\Sigma = R \Lambda R^{\mathsf T}, \qquad \Lambda = \operatorname{diag}(\sigma_1^2,\dots,\sigma_d^2)

the level sets are ellipsoids aligned with the columns of RR (the principal axes), with widths set by σi\sigma_i.

Defined for xRdx\in\mathbb{R}^d (often d=2d=2 or 33). Outputs are strictly positive real values. When multiplied by the normalization constant, it becomes a probability density or a normalized smoothing kernel.


In rotated coordinates y=RT(xμ)y = R^{\mathsf T}(x-\mu),

g(x)=exp ⁣(12i=1dyi2σi2)g(x) = \exp\!\left(-\tfrac{1}{2}\sum_{i=1}^d \frac{y_i^2}{\sigma_i^2}\right)

The normalized Gaussian density (or convolution kernel) is

G(x)=1(2π)d/2detΣexp ⁣(12(xμ)TΣ1(xμ))G(x) = \frac{1}{(2\pi)^{d/2}\sqrt{\det\Sigma}}\, \exp\!\left(-\tfrac{1}{2}(x-\mu)^{\mathsf T}\Sigma^{-1}(x-\mu)\right)

Up to conventions, the Fourier transform of a Gaussian is another Gaussian; for a centered kernel the covariance transforms inversely (precision becomes covariance in frequency space).


  • Isotropic case: Σ=σ2I\Sigma=\sigma^2 I yields a circular/spherical Gaussian.
  • Degenerate widths: as some σi0+\sigma_i\to 0^+ the mass concentrates near lower-dimensional structures (in the unnormalized form).
  • Broad widths: as some σi\sigma_i\to\infty the function flattens along those directions; for normalized kernels, amplitude decreases to preserve total mass.

Gaussian convolution kernels specialize to isotropic Σ\Sigma; rotated Gaussian windows taper signals along oriented axes; Gabor functions add sinusoidal modulation to the same Gaussian envelope.


Oakfield does not currently expose a first-class “rotated anisotropic Gaussian” spatial kernel (e.g. a 2D/3D covariance-driven oriented blur) in the built-in operator set.

Closest related features in the current codebase:

  • Gaussian filtering: sieve provides an isotropic 1D Gaussian-like convolution kernel (set by sigma and taps).
  • Gabor-style oriented structure (1D): stimulus_gabor combines a Gaussian envelope with a carrier (wavenumber), producing directionality in the sense of a chosen spatial frequency.
  • Phase “rotation” parameters in some complex stimuli refer to complex phase rotation of the written output, not a spatial rotation of an anisotropic Gaussian covariance.

Gaussian quadratic forms are central in probability and error theory. The rotated (anisotropic) case follows naturally from linear changes of variables that diagonalize a positive-definite quadratic form.

Oriented Gaussian kernels are widely used in imaging, signal processing, and PDE regularization as a smooth, analytically tractable way to encode directionality.


  • NIST Digital Library of Mathematical Functions (DLMF), §7
  • Adler & Taylor, Random Fields and Geometry