Hello,

I am doing a vector calculus problem that uses:

$VForm = Formula("(x^2/2) + (y^2/2) + (z^2/2)");

However, I want to evaluate this at two different points (it's used as an antiderivative). Is there a way of essentially doing the following:

$Pt1 = Point(1,2,3);

$Pt2 = Point(4,5,6);

$Antider = ($VectForm->eval((x,y,z)=>$Pt1)) - ($VectForm->eval((x,y,z)=>$Pt2));

-----------------------------------------------------

If not, how can I get the first, second, and third coordinates from a Point object?

Also, what is the syntax for evaluating a vector field at a point using the vector object?

Thank you,

Spyro Roubos

The first is to deconstruct the points first, and then use `eval`

:

($x1,$y1,$z1) = $Pt1->value; ($x2,$y2,$z2) = $Pt2->value; $AntiDir = $VectForm->eval(x=>$x2,y=>$y2,z=>$z2) - $VectForm->eval(x=>$x1,y=>$y1,z=>$z1);It's somewhat awkward, but works.

Alternatively, you can create a perl function and pass the coordinates of the point. (Note that the perlFunction's parameters are in alphabetical order unless otherwise specificied.)

$vf = $VectForm->perlFunction; $AntiDir = &$vf($Pt2->value) - &$vf($Pt1->value);Finally, you could make a named function:

$VectForm->perlFunction('VF'); $AntiDir = VF($Pt2->value) - VF($Pt1->value);Hope one of these works for you.

Davide

($x,$y,$z) = $v->value;

as in the example above, or you can get individual coordinates (by number) as

$x = $v->extract(1); $y = $v->extract(2); $z = $v->extract(3);Davide