POV-Ray : Newsgroups : povray.general : math help Server Time
25 Dec 2024 14:01:38 EST (-0500)
  math help (Message 1 to 2 of 2)  
From: Kevin Loney
Subject: math help
Date: 29 Apr 2003 00:29:22
Message: <3eadffa2$1@news.povray.org>
Anyone have any idea how to solve for x if

f(x) = (r1+d+x)*sin(atan(r2/(x+r1)))-r2
where r2>r1 & d > 0
r1, r2, and d are all constants

I've tried implementing Newtons method for approximating the answer with no
luck, I've check my work at least 3 times and can't figure out why it's not
working, any help would be greatly appreciated.

thanks

--
Kevin
http://www.geocities.com/qsquared_1999/
#macro _(r)#if(r<12)#local i=asc(substr("oqshilacefg"
,r,1))-97;disc{<mod(i,7)-3,div(i,7)-1,6>,z,.4
pigment{rgb 10}}_(r+1)#end#end _(1)//KL


Post a reply to this message

From: Mark Weyer
Subject: Re: math help
Date: 29 Apr 2003 03:04:07
Message: <3EAE23DF.7080907@informatik.uni-freiburg.de>
> f(x) = (r1+d+x)*sin(atan(r2/(x+r1)))-r2

I do not think that you need approximation.
First note, that
   tan(t)=sin(t)/cos(t)=sin(t)/sqrt(1-sin^2(t))
hence
   tan^2(t)-tan^2(t)*sin^2(t)=sin^2(t)
and then
   sin(t)=tan(t)/sqrt(1+tan^2(t)).
With that you can substitute
   sin(atan(y))
by
   y/sqrt(1+y^2).
Above y=r2/(x+r1), so you are left with a formula of the form
   (a+b*x)/(c+d*x)/sqrt(1+1/(c+d*x)^2)-e
   = (a+b*x)/sqrt((c+d*x)^2+1)-e.
So you have to solve
   f(x)-e = (a+b*x)/sqrt((c+d*x)+1)
or
   (f(x)-e)^2*((c+d*x)^2+1) = (a+b*x),
which is only a quadratic equation.

You may have to check for signs when you work that out.


-- 
merge{#local i=-11;#while(i<11)#local
i=i+.1;sphere{<i*(i*i*(.05-i*i*(4e-7*i*i+3e-4))-3)10*sin(i)30>.5}#end
pigment{rgbt 1}interior{media{emission x}}hollow}//  Mark Weyer


Post a reply to this message

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