POV-Ray : Newsgroups : povray.binaries.images : Stumped by desk lamp trig equation Server Time
16 Apr 2024 06:22:09 EDT (-0400)
  Stumped by desk lamp trig equation (Message 1 to 1 of 1)  
From: Cousin Ricky
Subject: Stumped by desk lamp trig equation
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-2023 Persistence of Vision Raytracer Pty. Ltd.