[Numpy-discussion] dot function or dot notation, matrices, arrays?

Wayne Watson sierra_mtnview at sbcglobal.net
Sat Dec 19 00:22:02 EST 2009


Nicely done.

Alan G Isaac wrote:
> On 12/18/2009 7:12 PM, Wayne Watson wrote:
>   
>> The point of the scalar product is to produce theta.
>>     
>
> As David said, that is just NumPy's `dot`.
>
>   
>>>> a = np.array([0,2])
>>>> b = np.array([5,0])
>>>> theta = np.arccos(np.dot(a,b)/np.sqrt(np.dot(a,a)*np.dot(b,b)))
>>>> theta
>>>>         
> 1.5707963267948966
>   
>>>> theta/np.pi
>>>>         
> 0.5
>
> hth,
> Alan Isaac
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>   

-- 
           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
              Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet  
                
             "... humans'innate skills with numbers isn't much
              better than that of rats and dolphins." 
                       -- Stanislas Dehaene, neurosurgeon 
 
                    Web Page: <www.speckledwithstars.net/>




More information about the NumPy-Discussion mailing list