I’ll keep this brief. I’m leaving Twitter after 16 years. A tough decision. 8000 followers. Lots of history. It was an overwhelmingly positive experience. But the platform is in a very different place now and I just don’t want to have any connection to it going forward. I’ll disable my account some time on December 13, 2022 probably.
You can now find me over at Mastodon at bit101 (@bit101@mstdn.social) – Mastodon 🐘
Read more...Chapter 7 of the Coding Curves Series
I’ll admit that when I started brainstorming this chapter, I began to second guess the decision to include it at all. The curve we’ll cover here, the parabola, is fairly simple, basic, even plain compared to the crazy curves we’ve been generating in the last three chapters. But as I got into it I realized that this curve is pretty cool and has lots of interesting properties. In fact, I was going to cover another curve, the hyperbola, in this chapter as well, but I got so deep into parabolas that I decided to save hyperbolas for another time.
Read more...Chapter 6 of the Coding Curves Series
Another physical device which renders complex curves that we can simulate!
This one is called a Pintograph, and I’ve actually built one of these myself.
We’ll start with a video – this is literally the first video that came up when I searched Youtube for “pintograph”, but it does the job.
A pintograph can be considered to be a type of harmonograph, but rather than being based on pendulums, pintographs are usually driven by electric motors (though some are hand-cranked). There are disks attached to the motors and arms attached to the disks and a pen attached to the arms. You can change the size of the disks and where the arms are attached, the length of the arms and where they pivot, and the relative speed and offset of the motors to create a bunch of different types of curves.
Read more...Chapter 5 of the Coding Curves Series
This installment builds on Chapter 4’s discussion of Lissajous curves. Actually, a harmonograph is not a type of curve, it’s a device used to draw Lissajous (and similar) curves. And when I say a device, I mean a real world physical device that has ropes or chains and levers and pen and paper or bottles of sand and pendulums or other mechanics to create these curves.
Read more...Chapter 4 in the Coding Curves Series
Make sure you are familiar with at least the first chapter, to understand how the code samples work.
Lissajous curves have always been one of my favorite techniques. They are useful for many things beyond the obvious loopy shapes they create. In this installment, we’ll cover the basics, and as usual, wander off course here and there to look at other ways they can be used.
Read more...Chapter 3 in the Coding Curves Series
In this installment we’ll look at how to draw arcs, circles and ellipses. (And wander off on some tangents before we get done.)
It’s likely that your platform’s drawing api has at least some of this built in. For example, the HTML Canvas api does not have a circle
method, but it does have an arc
method as well as an ellipse
method, either of which can be used to draw circles.
Chapter 2 in the Coding Curves Series
This is going to be a relatively simple one, but we’ll get into a few different applications. I’m not going to take a deep dive into what trigonometry is, there will be no images of triangles with the little square in the corner telling you which angle is 90°. No definitions of adjacent, opposite, hypotenuse. And NO soh-cah-toa!!!
I’m going to assume you know all that stuff. And if you don’t, a google search for basics of trigonometry
will net you about 18,800,000 results in under one second. Proof:
For a number of years, I’ve been wanting to writing a book called “Coding Curves”. There are all kinds of really fascinating curves that are fun to code and understand and create very interesting images. I’ve started this book at least three times. I’m feeling the urge to to it again, but I’m going to be more realistic about it this time. I don’t think I’m going to sit down and write a book cover to cover and get it formatted and edited and self publish it. I’ve accepted that that’s just not going to happen. But I want to write about this stuff.
Read more...Yesterday I created a little Go library to manage ANSI escape codes in Go.
I’ve been working on a command line app that will have a user selecting items from a list and asking a few questions in order to configure how the app runs. I realized that a bit of color would add a ton of context and make the experience much easier to navigate.
It turns out that there are quite a few libraries that do this kind of thing. Initially I used https://github.com/fatih/color which is pretty nice. But as always there were one or two things that didn’t work exactly the way I wanted them to. I started looking into how colors are defined in shells and just kind of wound up going down a rabbit hole on the subject.
Read more...Anyone who follows me on twitter has seen what I’ve been up to in the last month and a half or so. But to hop on a meme from last year…