|
|
Thomas Willhalm wrote:
> As Peter already pointed out, you need to integrate your function f. So
> give us f and we'll see what we can do about it.
My function is rather hard to integrate, but easy to differentiate.
That's why I wanted to use dfdt: It contains information of how far
apart the points are so it should be possible..
For now I have created a very crude numerical integration routine.
Since the function behaves so badly at t=x0, I guess I'll be better
off making a spline.
%S=4.168; //curve length from summing the "arc"s below
%d=S/13;
%W=2.5;
%R=3;
%b0=R/sqrt(2);
%x0=R*cos(W/2/R);
%y0=R*sin(W/2/R);
#macro p(T) (y0-b0)/x0*T+b0 #end
#macro Z(T) sqrt( sqr(R)-sqr(T)-sqr(p(T)) ) #end
%splitt=.04;
%lengde=.39;
%arc=0;
%eigth=union{
%i=0;
%ant=104;
#while (i<ant)
%X=i/ant*x0;
%Xn=(i+1)/ant*x0;
cylinder {<X, p(X), Z(X)> , <Xn,p(Xn),Z(Xn)>, splitt pigment {colour rgb .5}}
%arc=arc+vlength(<X, p(X), Z(X)> - <Xn,p(Xn),Z(Xn)>);
#if (arc>d)
object {Thing_to_place_on_curve}
%arc=0;
#end
%i=i+1;
#end
}
Post a reply to this message
|
|