|
Author |
Topic: help needed: harmonograph mess (Read 631 times) |
|
lunetta
|
help needed: harmonograph mess
« on: Nov 15th, 2004, 7:36am » |
|
Hello all community I'm posting a cry for help; I don't have a specific program question, but it's a formula implementation trouble. If you have fun getting a nice set of parametric equations and putting them to work in a sketch, this is a post for you. Ok, let's go: I'm doing a project that envolves a harmonograph; it's a special case for the lissajous curves, that feature damping and a rotational pendulum. Master Paul Bourke has a page about it: http://astronomy.swin.edu.au/~pbourke/curves/harmonograph/index.html His formula is great, but I could not sucessfully implement it in a sketch; I don't know, it just doesn't work. The reason it does not work: x and y are functions of t, time; on his formula, there's no t inside de sin(); the sin does not change with time - like Lissajous formulas, where the cos and sin calculate their values based on the t ( http://mathworld.wolfram.com/LissajousCurve.html ) I'm sure that Bourke knows what he does... I found another site with a very similar formula: http://www.tip.net.au/~apurdam/harmonograph/harmonophysics.html that included the t; I implemented this code; I simplified the damping (couldn't make the right one work). The sketch works, although: http://lunetta.com.br/newHarmono.pde It seems to me that simply adding a parameter to the x component does not really recreate the real harmonograph rotating pendulum board, but I might be wrong... it's looking like pure lissajous curves. Bourke had nice outputs with the equations, but I couldn't arrive in the values that would output a nice graph. the main difference between lissajous / harmonograph: lissajous: oscillating movement up / down and left right; harmonograph: rotatory movement to left and to right; gravity damping. I found another formula, and implemented it as well: the original site: http://www.users.globalnet.co.uk/~ngo/ast00800.htm and my implementation: http://www.lunetta.com.br/harmono9.pde This one works; the problem is: I don't know what I'm doing. It uses Euler constant, the exp() function in Java, and my limited math knowledge does not comprehend it; besides, instead of the 3 parameters for the 3 pendulums plus decay (12 parameters), I have half of them. I can't figure out what I'm controlling; The main objective of the harmonograph sketch is to visualize frequency intervals over time; like octaves, fifths, thirds. the components should oscillate in proportional frequencies; like one at 3:5 and another at 2:5. I don't have the slightest idea on how to input these parameteres with the harmono9.pde sketch. Also, this sketch does not seem to fully implement the rotatory harmonograph (and I might be wrong)... if anyone has a light, share it please; anything would help. And if you're reading up to this point in this long post, thanks for your patience and attention...
|
|
|
|
st33d
|
Re: help needed: harmonograph mess
« Reply #1 on: Dec 10th, 2004, 2:06pm » |
|
Euler's constant = 0.577215665 Euler's number = 2.71828182845904523536; Constants you can simply load into Processing as a Float or a Double and then work with them from there. exp() didnt' work in processing when I tried it. It basically is used for working out different exponents of Eulers number. NOT Euler's constant. I'd have something more to say but I've got a lecture to rush to right now. A tip on maths - I look up doctor math, the explanations are bit more low brow than mathworld. Easier on the noodle. http://mathforum.org/dr.math/faq/faq.e.html
|
« Last Edit: Dec 10th, 2004, 2:08pm by st33d » |
|
I could murder a pint.
|
|
|
fry
|
Re: help needed: harmonograph mess
« Reply #2 on: Dec 10th, 2004, 8:25pm » |
|
just regarding the first message.. in processing, you can use java's exp() function the same way you do with java: Math.exp(something); tho most things take floats in processing so you'll prolly want to cast it: float a = (float) Math.exp(something); java is running underneath processing, so you have access to all those java type of things (with the exception of the awt stuff, for the most part).
|
|
|
|
lunetta
|
Re: help needed: harmonograph mess
« Reply #3 on: Dec 10th, 2004, 10:40pm » |
|
Hey, thanks for the feedback, I haven't read it before. I ended up figuring it out, I'll publish the sketch soon...
|
|
|
|
|