> 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
|