|
From: <pl...@pi...> - 2007-05-08 21:30:46
|
On Tue, 08 May 2007 17:57:54 +0200, Ethan A Merritt =
<merritt@u.washington.edu> wrote:
>
> Please continue to play with it. We need to discover what limitations=
=
> and
> drawbacks this simple implementation may have before seriously =
> considering
> to add some variant to the program.
area=3D0; started=3D0;prev_x=3D0;prev_y=3D0;
add_aug(x,y)=3Dassign("area",(started)?area+(x-prev_x)*(y-prev_y)/2.+0.*=
assign("prev_x",x)+0.*assign("prev_y",y):(0.*assign("started",1)+0.*assi=
gn("prev_x",x)+0.*assign("prev_y",y)));
This should do a trapezoidal area under graph but I have not been able t=
o =
check it's result because of time trunkage.
Anyway, plotting the return value it seems to be doing the right thing.
;)
|