Oops, one more thing. In reference to:<br><span style="font-family: courier new,monospace;">vec = array([[0,0,0],[0,1,0],[0,0,3]])</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">pos = array([0,4,0])</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sqrt(((vec - pos)**2).sum(1))</span><span style="font-family: courier new,monospace;"> -> array([ 4., 3., 5.])</span><br><br>Can I make "vec" an array of class instances? I tried:<br>
<span style="font-family: courier new,monospace;">class c:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> def __init__(self):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> self.position = [0,0,0]</span><br><span style="font-family: courier new,monospace;">vec = array([c(),</span><span style="font-family: courier new,monospace;">c()</span><span style="font-family: courier new,monospace;">,</span><span style="font-family: courier new,monospace;">c()</span><span style="font-family: courier new,monospace;">])</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">pos = array([0,4,0])</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sqrt(((vec.position - pos)**2).sum(1))<br><br></span>Which doesn't work. I'm not familiar with class objects in arrays--how should they be referenced?<br><br>Thanks again,<br>
Ian<br>