Complex Mapping and Vibration

Overview

Complex transformations mapping overview

Visualizing complex functions is inherently challenging: the complex plane is already two-dimensional, so a function f:CCf: \mathbb{C} \to \mathbb{C} requires four dimensions for a complete Cartesian graph. To overcome this, colour-coded points in 2D space represent different complex numbers, and a transformation is animated as points smoothly interpolating from the domain to the image of the function.

This project explores various complex transformations — including powers, reciprocals, and combinations — and their geometric effects on grids and scattered point clouds. Two coordinate systems are used: Cartesian grids (colour based on the real coordinate) and Polar grids (colour based on magnitude), each rendered as either discrete dots or continuous lines.

Controls: left click to trigger the animation, scroll to zoom, and middle button to pan the viewport.

Mathematical Background

Complex Transformations

A complex transformation is a function f:CCf: \mathbb{C} \to \mathbb{C} that maps each point z=x+iyz = x + iy in the domain to a new point w=f(z)w = f(z) in the image. The geometric effect — rotation, scaling, inversion, or distortion — depends on the algebraic form of ff.

The functions implemented in this project include:

f(z)=zn(power, e.g. z2,z5.35)f(z)=1z(reciprocal / inversion)f(z)=iz(90° rotation)f(z)=(z+1)2(shifted reciprocal squared)f(z)=1z2+5z(combination)f(z)=3z3(scaled cubic)\begin{aligned} f(z) &= z^n \quad \text{(power, e.g. } z^2,\, z^{5.35}\text{)} \\ f(z) &= \frac{1}{z} \quad \text{(reciprocal / inversion)} \\ f(z) &= iz \quad \text{(90° rotation)} \\ f(z) &= (z+1)^{-2} \quad \text{(shifted reciprocal squared)} \\ f(z) &= \frac{1}{z^2} + 5z \quad \text{(combination)} \\ f(z) &= 3z^3 \quad \text{(scaled cubic)} \end{aligned}

Each function produces a distinct geometric signature: the power map znz^n multiplies the argument by nn and raises the modulus to the nn-th power, while the reciprocal 1/z1/z performs a circle inversion combined with a conjugation.

Visualization Methods

Four visualization modes are available, combining two coordinate systems with two rendering styles. Each mode colours points differently: Cartesian modes map the xx-coordinate to a colour gradient, while Polar modes map the magnitude z|z| to colour. The animation interpolates each point from its original position to its transformed position under f(z)f(z).

Cartesian Dots

Thousands of randomly scattered dots fill the complex plane, each coloured by its real coordinate. When the transformation is applied, the cloud of dots flows to new positions, revealing how the function stretches, compresses, and rotates different regions of the plane.

Cartesian Lines

A regular Cartesian grid of horizontal and vertical lines is drawn, with colour varying along the xx-axis. Under the transformation, straight lines warp into curves, making it easy to identify conformal properties — angles between grid lines are preserved by analytic functions.

Polar Dots

Dots are distributed across the plane and coloured by their magnitude z|z|. This highlights how the transformation affects distance from the origin — inversions swap near and far points, while power maps expand or compress radial distances non-linearly.

Polar Lines

Concentric circles and radial rays form the polar grid, with colour encoding magnitude. The transformation bends circles into new curves and redirects rays, visually demonstrating how f(z)f(z) distorts the polar structure of the plane.

The images below show the before (domain) and after (image) states for various transformations applied to both Cartesian and Polar grids. Each pair demonstrates how a specific function reshapes the geometry of the complex plane.

Cartesian Dots — Power Mapping

Applying a power function such as f(z)=z2f(z) = z^2 to scattered Cartesian dots. The squaring map doubles angles and squares magnitudes, causing the dot cloud to wrap around the origin. Points near the unit circle remain relatively stable while those far away are flung outward.

Cartesian Grid — Reciprocal Mapping

A Cartesian grid transformed by a reciprocal-type mapping such as f(z)=1/zf(z) = 1/z. The inversion maps the interior of the unit circle to the exterior and vice versa. Horizontal and vertical grid lines are mapped to families of circles passing through the origin.

Cartesian Grid — Combination Function

A more exotic transformation such as f(z)=1/z2+5zf(z) = 1/z^2 + 5z applied to the Cartesian grid. The interplay between the singular term 1/z21/z^2 and the linear term 5z5z creates intricate swirling patterns with a rich mix of expansion, contraction, and rotation in different regions of the plane.

Polar Dots — Domain

The initial distribution of dots in polar colouring, with colour proportional to z|z|. Inner dots appear in one hue while outer dots transition to another, creating a clear radial gradient.

Polar Dots — Image

After the transformation, the radial colour gradient is redistributed. Under an inversion like f(z)=1/zf(z) = 1/z, formerly outer (far) dots now cluster near the origin and vice versa, visually inverting the colour pattern.

Polar Lines — Domain

The polar grid before transformation: concentric circles and equally spaced radial lines. The magnitude-based colouring shows a smooth gradient from the centre outward.

Polar Lines — Image

After the transformation, the circles and rays have been warped into new curve families. A power map like z3z^3 triples the angular spacing of rays and cubes the radial distances, creating a visually striking pattern.

Additional Examples

The following videos demonstrate additional transformations on Cartesian dot grids with varied functions, showcasing the range of geometric effects achievable with different complex mappings.

f(z)=z5.35f(z) = z^{5.35}

A fractional power map produces a complex multi-sheeted structure. The non-integer exponent creates overlapping folds as points wrap around the origin more than once.

f(z)=(z+1)2f(z) = (z+1)^{-2}

A shifted reciprocal squared map. The pole at z=1z = -1 creates a singularity that pulls nearby points to infinity while distant points collapse toward the origin.

f(z)=3z3f(z) = 3z^3

A scaled cubic map triples arguments and cubes magnitudes, amplified by a factor of 3. The three-fold symmetry is clearly visible as the dot cloud wraps around the origin three times.

Technology Stack

This project was built using Processing (Java-based creative coding framework), leveraging its real-time rendering pipeline for smooth animations of thousands of points. A custom Complex class implements arithmetic operations (addition, subtraction, multiplication, power, reciprocal, polar conversion) used to evaluate transformations at each point.

ProcessingJavaComplex AnalysisReal-time RenderingInteractive VisualizationColor Mapping

Nuwantha Kumara

Mechanical Engineering student passionate about software development, simulations, and creating impactful solutions.

Connect

© 2026 Nuwantha Kumara. All rights reserved.

Built withNext.js