Elektrine lite

← Feed

@loke@functional.cafe

Post #1646925

2026-04-22 13:25 UTC

This post by @jonocarroll got me thinking. https://fosstodon.org/@jonocarroll/116418569123722577 It should be possible to reproduce this (well, mostly) using very little code in an array language. Kap was missing a simple way to draw lines and boxes, so it was clearly time to remediate this. It's a very simple API that allows you to draw lines, boxes and ellipses in different colours. This is what I came up with. The editor window at the bottom is the full code. The code declares a few functions: R creates a rotation matrix with the given angle, T creates a translation matrix, and S creates a scaling matrix. The API already has built-in rotation and scaling, but I thought it was neater to do it with proper matrix operations.

Replies (1)