A Trickier Curve

Yesterday’s parametric curve was a warm up for another I wanted to draw. I’ve played with it a little bit, in the same spirit as yesterday’s, but haven’t gotten an answer yet. It looks sufficiently more complicated, so I thought I’d just go ahead and post my work so far up here, and see if anybody else was interested. Here’s a picture, explanation follows:

dscn0347The curve I want is the one in the upper left. I’ve decided to base this on the graph of cosine again, so I am thinking

\begin{array}{rcl}x(t) &=& t+o_x(t)\\ y(t) &=& \cos(t)+o_y(t) \end{array}

The two other graphs in the picture, on the right, are approximations to o_y(t) (on top) and o_x(t) (on the bottom).

While o_y(t) scares me a bit, I’ve got an idea for finding a formula for o_x(t). Near multiples of \pi, the curve looks vaguely like a sine curve with small amplitude and period \pi/6 (so, c_1\cdot \sin(12t)). Near odd multiples of \pi/2, the curve looks more like the curve from yesterday, c_2\cdot \sin(2t). So we want to sort of mix these curves, more of the first near \pi-s, and more of the second near \pi/2-s.

A decent way to mix two functions, f_1(t),f_2(t) is to use what I’ll call a mixing function \mu(t) (probably other people have a name for it, and probably it’s something I should know, but whatever). The only requirement I have for a function to be a mixing function is that it takes values between 0 and 1 (and continuity is preferred). I’ll mix the two functions as f(t)=\mu(t)f_1(t)+(1-\mu(t))f_2(t). Notice that when \mu(t) is near 1, the mixed function is near f_1(t), and when \mu(t) is closer to 0, the mixed function is near f_2(t).

It’s not too hard to determine that to mix my two sine curves like I want, my \mu will be based on \cos(2t), namely \mu(t)=(1/2)(1+\cos(2t)). You can make the mixing ‘quicker’ (more time near each curve, and quick transitions to the other function) via \mu_p(t)=(1/2)(1+\cos^{p}(2t)) for small positive values of p (I’m thinking p=1/n for some positive odd integer n). To get some idea how this looks, here’s a graph mixing (.2)\sin(12t) with (1)\sin(2t), using \mu_1 (the basic \mu, fooplot doesn’t seem to want to take odd roots of negative values):


I think that by modifying the various parameters (c_1,c_2,p), one could get a pretty decent function for the o_x(t) I was looking for. Like I said, though, o_y(t) looks a bit harder. Perhaps you’ve got a suggestion? I’m tempted to believe you could base it off of -\cos(t)… It might almost be a mixing of -\cos(t) with (1/2)\cos(t) (or various other amplitudes on both).

I feel like maybe I should mention why I was thinking these curves, and why I want to draw that parametric curve. When I was playing with my quadric polynomials a while ago, I wanted to draw animations, but I had two parameters floating around. So I thought that if I made a parametric curve that occupied ‘most’ of some square region in the plane, then I could use just one parameter, and make a nice animation. Probably I’m not explaining that too well, but it also isn’t entirely worth it. My goal was to draw a curve that occupied ‘lots’ of the region -1\leq y\leq 1 in the plane, and the curve I came up with is the one I’ve been trying to draw in this post.


Tags: ,

One Response to “A Trickier Curve”

  1. sumidiot Says:

    This post inspired tjmeister on twitter to go and play with more curves. He came up with a nice collection, and posted some graphs on flickr. Check them out. He’s got Christmas Trees and New Years Champagne up there!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: