POV-Ray : Newsgroups : povray.advanced-users : Stumped by desk lamp trig equation : Re: Stumped by desk lamp trig equation Server Time28 Jan 2023 15:32:18 EST (-0500)
 Re: Stumped by desk lamp trig equation
 From: Le Forgeron Date: 15 Aug 2022 11:04:46 Message: <62fa608e\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#62fa608e%241%40news.povray.org",
"headline": "Re: Stumped by desk lamp trig equation",
"dateCreated": "2022-08-15T15:04:46+00:00",
"datePublished": "2022-08-15T15:04:46+00:00",
"author": {
"@type": "Person",
"name": "Le Forgeron"
}
}
Le 07/08/2022 à 19:54, Cousin Ricky a écrit :
> On 2022-08-07 10:59 (-4), kurtz le pirate wrote:
>> On 06/08/2022 23:57, Cousin Ricky wrote:
>>
>>> Does this imply that I would need to program a numeric solution into my
>>> macro?
>>
>> I am afraid that it is not possible to solve literally an equation which
>> makes appear at the same time t, sin(t) and cos(t). A bit like in
>> differential equations with x and dx.
>
> Then numerical computation it will have to be, albeit in SDL.
>
>> Literal solutions never exist (except for school cases).
>
> I suspected those examples in high school were conveniently contrived.
>
>> Another trail.
>> Let sin(x) = T and cos(x) = U, the equation becomes :
>> (g - c/x)T + hU - a = 0
>>
>> Wolfram proposes a more "usable" result.
>> <https://www.wolframalpha.com/input?i=solve+%28g+-+c%2Fx%29T+%2B+hU+-+a+%3D+0>
>>
>> x = cT/(-a+gT+hU) with a!=gt+hU & cT!=0
>>
>>
>> Maybe more adapted to your needs ?
>
> I'll take a look at it.  Thanks!

If you like complexity, remember that T²+U² = 1,
so U is actually sqrt(1 - T²), reducing the number of variables.
(of course for your setting T & U > 0)

Back to original problem, why is the c part a circle ?

If it is some flexible part, we are back to the evaluation of the length
of a sphere sweep/spline for which there is no formulae, even when it's
just a part of an ellipse.

Do you really need a fixed length c part ?

Can the right angle of the picture (base of light bulb or so) be on the
y axis, with the c segment describing some S-like shape (or
interrogation dot shape )

Why do I want that point on y axis ? Because it is probably better for
the weight of the lamp to be correctly held.

Which make me wonder why there is a straight part after c, but not below it.
```