POV-Ray : Newsgroups : povray.binaries.images : Stumped by desk lamp trig equation : Stumped by desk lamp trig equation Server Time
30 Nov 2022 22:23:39 EST (-0500)
  Stumped by desk lamp trig equation  
From: Cousin Ricky
Date: 10 Aug 2022 23:59:29
Message: <62f47ea1$1@news.povray.org>
See thread in p.advanced-users.

I tried sin(x) = T and cos(x) = U, but it did not converge on a
solution.  My next plan was to convert the original equation to a
function and write a solver, and once I got the algorithm to choose
proper intervals, it worked beautifully.

For the test cases in these images, I plugged the coordinates of the
maroon dot into the algorithm, and flexed the lamp according to the
angle returned.  The graph on the right is of the function: the x-axis
goes from -pi to +pi/2, and the black dot is the calculated angle.
(This angle is the negative of the angle in the p.a-u thread.)  The
algorithm automatically determined that the bottom test case has no
solution.

Thanks again, Kurtz le pirate!


Post a reply to this message


Attachments:
Download 'test_lamp_flex-pbi.png' (67 KB)

Preview of image 'test_lamp_flex-pbi.png'
test_lamp_flex-pbi.png


 

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.