[Numpy-discussion] dot function or dot notation, matrices, arrays?
Wayne Watson
sierra_mtnview@sbcglobal....
Fri Dec 18 18:12:38 CST 2009
Not quite. The point of the scalar product is to produce theta. My
intended use is that found in calculus. Nevertheless, my question is how
to produce the result in some set of functions that are close to
minimal. I could finish this off by using the common definition found in
a calculus book (sum of squares, loop, etc.), but, from where I
stand--just getting into numpy, this is about discovering more about
numpy, and math. However, it's not just an example. I''m working on a
task in celestial computations that has a definite goal. The dot product
is very useful to it, since the work is very oriented towards vectors
and matrices. Surprisingly it doesn't seem to be available in numpy's
bag of tricks.
David Goldsmith wrote:
> On Fri, Dec 18, 2009 at 3:40 PM, Wayne Watson
> <sierra_mtnview@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_mtnview@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
>
>
--
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