Hacker News new | past | comments | ask | show | jobs | submit login

The length l of the Christmas lights is the hypothenuse of a rectangular triangle of height h, the height of the column. So, if the slope angle is α, we have sin(α) = h/l, or α = arcsin(h/l).

Soundness check: that doesn’t have a solution if h > l. Looks good.




does this assume the xmas tree is shaped like a column or a cone?

edit: ah, i re-read the original problem and it does mention column. i thought it was a xmas tree that was being wrapped.


That would be harder, yes. Reading https://en.wikipedia.org/wiki/Conical_spiral#Slope, you want a logarithmic spiral (you need a constant angle to make the problem make sense)

Luckily, arc length isn’t too gnarly for those (same Wikipedia page), but you still have one equation with two variables.

I would have to think hard about whether those give you a unique solution.

I also doubt that spiral would give you uniform coverage of the cone (and that probably, is the real requirement, not constant angles), but again, I would have to do some thinking.


oh, interesting variation for uniform coverage! that is indeed what i'd want for the tree. in building a road around a cone, a constant angle would be more desirable.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: