Unfortunately, VTK's array calculator does not support true cross product computation.&nbsp; I have a patch in bug 2903 ( <a href="http://www.vtk.org/Bug/bug.php?op=show&amp;bugid=2903&amp;pos=19">http://www.vtk.org/Bug/bug.php?op=show&amp;bugid=2903&amp;pos=19
</a> ) that adds a &quot;cross(X,Y)&quot; function, but it hasn't been integrated yet.&nbsp; You can probably grab it &amp; replace your vtkFunctionParser with it and it'll work.<br><br>In the meantime, you've got 2 options:<br>
&nbsp;&nbsp; 1) Load your vectors in a 3-scalars, and then perform the cross product yourself as you've shown.<br>&nbsp;&nbsp; 2) Use V.ihat, V.jhat, and V.khat to access the 3 components (read: Vector dot i-unit vector, etc)<br><br>also, you can't directly write back the results into components.. So you'll have to compute each component &amp; multiply by ihat/jhat/khat and then add the 3 parts together... It's gonna be one massive &amp; messy function line.&nbsp; And slow to run......
<br><br><div><span class="gmail_quote">On 4/14/06, <b class="gmail_sendername">W.T. Bridgman</b> &lt;<a href="mailto:William.T.Bridgman.1@gsfc.nasa.gov">William.T.Bridgman.1@gsfc.nasa.gov</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I want to do a cross product of two vector datasets.<br><br>I&nbsp;&nbsp;can't find any documentation (both the vtk list &amp; Google) on<br>vtkArrayCalculator or vtkFunctionParser to implement this.<br><br>How would I code the SetFunction for this?&nbsp;&nbsp;Does the parser recognize
<br>vector components?<br><br>E[3]=V[2]*B[1]-V[1]*B[2], etc.<br><br>Thanks,<br>Tom<br>--<br>Dr. William T.&quot;Tom&quot; Bridgman&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Scientific Visualization<br>Studio<br>Global Science &amp; Technology, Inc.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NASA/Goddard Space Flight
<br>Center<br>Email: <a href="mailto:William.T.Bridgman.1@gsfc.nasa.gov">William.T.Bridgman.1@gsfc.nasa.gov</a>&nbsp;&nbsp;Code 610.3<br>Phone: 301-286-1346&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Greenbelt, MD 20771<br>FAX:&nbsp;&nbsp; 301-286-1634&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://svs.gsfc.nasa.gov/">http://svs.gsfc.nasa.gov/</a><br><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></blockquote></div><br>