Ford gets Complex!

    Not too complicated and just a different view of Ford’s circles and a way of morphing them along with a bit of animation. It’s a continuation of the previous post and there are two parts to it – the real bit and the imaginary part. The Real Part To start with we take fractions not between 0 and 1 but rather between -n and n. A rough and ready way is

where we take all possible pairs and reduce them. Note we allow 0 as a denominator so as to be consistent with the Farey sequence. For Read More

Ford and his Circles.

      A Ford circle is a circle derived from a pair of numbers that are co-prime, i.e. they have no common factors. For a pair of co-prime integers p and q the Ford circle has radius r and centre at a point P(x, y) where r = 1/(2q^2) and P = (p/q, r) No matter what co-prime numbers, p and q, are used to create Ford circles the circles never intersect and they are all tangential to the horizontal axis. Now, we could generate ‘random’ Ford circles by picking any old co-prime pair (p, q). However, the Farey Read More

Haskell, Vectors and Simple Mechanics – part 4.

I think this post will wrap up the series on Vectors and Simple Mechanics and we’ll look at Simple Harmonic Motion (SHM) and compare the numerical solutions to SHM using the naive step function from the previous post – aka the ‘Euler‘ step and the more accurate ‘Euler-Cromer‘ method. Here’s the Euler Step from last time.

a very simple change to the above yields the ‘Euler-Cromer‘ step where the ‘new velocity‘ rather than the ‘old‘ is used to determine the ‘new‘ position.

These two functions have the same signature, Accnf -> Float -> State -> State which allows us to generalise a solution based Read More

Haskell, Vectors and Simple Mechanics – part 3.

In this post we’ll continue the previous one about vectors and take a look at calculating the path of a projectile and rendering that path to the screen. Imagine a single particle in three dimensional space, we can characterise a state for it as its position and velocity at some instant in time. type State = (Time, Displacement, Velocity) From basic mechanics and Newtons laws we know that if no forces act on it then not a lot happens really! Time will increase and depending on your point of view, not much else will change. However, if some forces are acting then things become more Read More

Haskell, Vectors and Simple Mechanics – part 2.

Here we will continue the previous ideas about vectors and take a look at basic rendering of Vectors – for which we will use the Haskell Gloss package at Gloss claims that “Gloss hides the pain of drawing simple vector graphics behind a nice data type and a few display functions. Gloss uses OpenGL under the hood, but you won’t need to worry about any of that. Get something cool on the screen in under 10 minutes.” and to be fair I found it very easy to use but not without problems when installing. However I believe these problems Read More

ˆ Back To Top