sharing: golden ratio
Hi all, I have been messing around with the golden ratio. Don't worry, I didn't change it or anything! Anyhow I have a nice little bit of code that takes a number, and returns the large and small golden proportions of that number. I created it for another patch I am working on, and thought perhaps someone else would find it handy. Cheers!
simple but thank you!
Since phi is the only number that is its own reciprocal, a string of [!/ 1.0] objects will set you up jes' fine....
pedant time
φ = 1/φ + 1
i.e. it's not its own reciprocal.
you may be thinking of Φ = 1/φ (note the case)
where Φ = φ - 1 (obvious from above and roughly 0.61803)
a side note,
2 numbers that are their own reciprocals are 1 and -1
You're right, of course. I should never post after getting home from the radio station. D'oh!
having a look at the op's patch tho' - this wont work for negative numbers, it's probably easier just setting the larger portion to
x*Φ
and the smaller portion to
x*Φ^2
Φ=0.618034.... in both cases there
end of pedant mode :)