Magnoquill

Just a humble attempt at translating a Magnoquill animation from Yuruyurau’s artwork into C.

Stale Pure Nim score 23/100 · last commit 2025-08-14 · 1 stars · tests present · no docs generated

Summary

Latest Version Unknown
License Unknown
CI Status Failing
Stars 1
Forks 0
Open Issues 0
Last Commit 2025-08-14
Downloads 0
Last Indexed 2026-09-06 07:35

Tags

Installation

nimble install Magnoquill
choosenim install Magnoquill
git clone https://gitlab.com/francescopaololezza-group/magnoquill

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
Magnoquill - - - - - - -

README

Magnoquill

Recently, I came across this post on LinkedIn. It refers to a Wolfram Community post that explains where the name "Magnoquill Driftflare Quiverbloom" came from. That post presents a Mathematica translation of an animation originally created in p5.js -- is a useful tool for learning to code and make art (I had never heard of it before, sorry!) by yuruyurau.

Specifically, it uses these formulas $$\sin(x), \cos(x), \sqrt{x} \text{ and } x^2$$ combined in a way that they gradually generate points during calculation.

a=(x,y,d=mag(k=(4+sin(x/11+t*8))*cos(x/14),e=y/8-19)+sin(y/9+t*2))=>
  point((q=2*sin(k*2)+sin(y/17)*k*(9+2*sin(y-d*3)))+50*cos(c=d*d/49-t)+200,
        q*sin(c)+d*39-440)

t=0,draw=$=>{
  t||createCanvas(w=400,w);
  background(9).stroke(w,96);
  for(t+=PI/240,i=1e4;i--;)a(i,i/235)
}

When these points are calculated and drawn one after another, they create shapes that move and look interesting. The cool thing is that simple math formulas can make these rich and surprising pictures.

That's my attempt to reproduce it in C.

We chose the PPM format (Portable Pixel Map) because it is simple. In a nutshell, this format stores color images by saving the RGB values for each pixel. The file starts: - with a header that specifies the format (in our case, P6, which is binary and faster to read), - the image size, and - the type.

After the header, the pixel data is stored from left to right and top to bottom, with the origin (0,0) at the top-left corner.

To speed up the process, I used ffmpeg because I’m not yet ready to write all the code needed to create MP4 files from scratch.

Animation preview

Development Environment

  • OS: Linux 6.1.0-37-amd64 Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux
  • Compiler: gcc 12.2.0 (Debian 12.2.0-14+deb12u1)
  • FFmpeg: 5.1.6-0+deb12u1

Build

Run:

make

Run

 ./bin/magnoquill