Demos

This is Words and Buttons Online — a collection of interactive #tutorials, #demos, and #quizzes about #mathematics, #algorithms, and #programming.

A smooth and sharp image interpolation you probably haven't heard of

An image interpolation that gives us a continuous and smooth image, where every interpolated value only depends on the four neighboring pixel values. The image becomes smooth, but sharp features remain sharp.

Rational interpolation

Rational interpolation is a step forward from polynomial interpolation towards rational splines. With rational interpolation, you can build functions that run through a set of points and also have vertical asymptotes whenever you want. With this capability, you can now model functions like logarithms better.

A picture is worth a thousand tags

This shows how a picture can be turned into an HTML table. With this, you can not only have nicer tables or uglier pictures, but you can have something that is both at the same time.

Can we use lemniscates for ultra-cheap vector graphics?

This depicts an old idea of using multifocal lemniscates to draw arbitrary shapes. In some applications, this may be indeed an economical alternative to splines.

Bi-whatever transformations

An interactive explanation of how polynomial transformations such as trilinear or biquadratic or even linear-cubic work, and how to craft your own.

Arctangent scale. It's like the logarithmic scale but infinite

An interactive demo of how, with arctangent used as a scale, we can show any function on a screen. And not just a fragment of it but the whole function.

Image darning

A simple image processing algorithm that cleans up dirt stains from old newspapers. I called it “darning” because of how it works.

Error codes are not numbers. But they are. Can we exploit that?

An interactive explanation of how we can use floating-point NaNs as error code holders in C++.

Honeycomb texture generator

This generates honeycomb textures of a special quasi-irrational form. Explanation included.

SWInE: Simplicial Weight Interpolation and Extrapolation

An alternative to splines nobody knows about. The localization of Shepard's method for a simplicial complex.

Quadratic splines are useful too

This explains simple quadratic splines, how to craft one yourself, and why.

Circles and lines vs. polynomial splines

An alternative to polynomial splines. Smooth parametric curves made from arcs and line segments.

Lexical differential highlighting instead of syntax highlighting

This type of highlighting is ideal for assembly. With it, the things that shouldn't seem similar usually don't.

Simple image vectorization

This is an example of an image vectorization algorithm. It shows the bilinear interpolation, polynomial approximation, differential analysis, and iterative algorithms working together to solve a practical problem

The simplest possible smooth contouring algorithm

A 3-part smooth contouring algorithm that shows partial derivatives, gradients, and parametric polynomials working together.

A cheap trick to speed up recursion in C++

More often than not, recursion is not your performance problem, to begin with. But even if it is, you can often avoid recursion altogether. When for some reason you can't, this trick helps.

Estimating floating-point error the easy way

An explanation of how to measure computational error while working with floating-point numbers, and why.

Outperforming everything with anything

A 100 lines of Python code that substitute the compiler front-end for a specific computation. This shows that you don't need a “fast” compiling language to write efficient code. In fact, a compilation is only one of the multiple ways to achieve speed.

Vastly outperforming LAPACK with C++ metaprogramming

Still not really about LAPACK. It's a second part of the “outperforming” series explaining how the C++ metaprogramming can appear useful for efficient code generation.

Outperforming LAPACK with C metaprogramming

Ok, it's not really about LAPACK. You can consider it clickbait if you wish. It's about how to tell a compiler to write the code you want with a limited arsenal of tools the C language provides.

An interactive introduction to iterative algorithms

An interactive explanation of how iterative algorithms work. This explains convergence and the exit condition problem on an oversimplified linear system solver.