On Fri, Dec 18, 2009 at 3:40 PM, Wayne Watson <sierra_mtnv...@sbcglobal.net> wrote: > Well, they aren't quite the same. If a is the length of A, and b is the > length of B, then a*b = A dot B* cos (theta). I'm still not familiar > enough with numpy or math to know if there's some function that will > produce a from A. It's easy enough to do, a = A(0)**2 + ..., but I would > like to think it's a common enough need that there would be something > available like sumsq().
In your usage, dot product and scalar product are synonymous: a = sqrt(A dot A) There are some contexts in which "scalar" product and "dot" product don't mean exactly the same thing (e.g., tensors, where "dot" is typically synonymous w/ "inner," which, in the general case, does not result in a scalar, or a multiplication-like functional where a function is mapped to a scalar, in which context we typically - but not uniformly - do not describe the product as a dot product) but unless you're working in one of those advanced contexts, scalar and dot are typically used interchangeably. In particular, IIUC, in NumPy, unless your using it to calculate a tensor product that doesn't result in a scalar, dot and scalar product are synonymous. DG > > > Keith Goodman wrote: >> On Fri, Dec 18, 2009 at 3:22 PM, Wayne Watson >> <sierra_mtnv...@sbcglobal.net> wrote: >> >>> Is there a scalar product in numpy? >>> >> >> Isn't that the same thing as a dot product? np.dot doesn't do what you want? >> _______________________________________________ >> NumPy-Discussion mailing list >> NumPy-Discussion@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/> > > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion