Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python': 0.09; '1.0)': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'angle': 0.16; 'numpy': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'mon,': 0.16; 'jan': 0.18; 'saying': 0.18; '>>>': 0.18; 'code.': 0.20; 'import': 0.21; 'subject:problem': 0.22; 'tells': 0.22; 'header:X-Complaints- To:1': 0.28; 'vector': 0.29; 'convert': 0.29; 'url:home': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'updated': 0.34; 'needed': 0.35; 'something': 0.35; 'received:org': 0.36; 'subject:with': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'perform': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; '2013': 0.84; 'multiply': 0.84; 'email addr:hotmail.com': 0.88; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: problem with exam task for college Date: Mon, 14 Jan 2013 13:54:59 -0500 Organization: > Bestiaria Support Staff < References: <6f3c7fdf-7439-43b1-b3a2-da9da019b1ec@googlegroups.com> <54dc9b58-8a7b-4a7a-a6d1-8d9a02a0477c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-253-108-225.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358189680 news.xs4all.nl 6969 [2001:888:2000:d::a6]:33827 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36810 On Mon, 14 Jan 2013 08:01:03 -0800 (PST), jeltedeproft@hotmail.com declaimed the following in gmane.comp.python.general: > this is what i have right now, it tells me i can't multiply a vector with a vector, i have to find a way to multiply the speed with the updated angle (=hoek in dutch) > It's a trite saying but: How would you perform this vector multiplication by hand? Write down the steps... Now convert those steps into Python code. Or -- download/install something like NumPy and recode your program using NumPy vector types which should support the needed multiplications. >>> import numpy >>> a = numpy.array( (2.78, 3.14, 1958) ) >>> b = numpy.array( (1.5, 2.0, 1.0) ) >>> >>> a*b array([ 4.17, 6.28, 1958. ]) >>> a.dot(b) 1968.45 >>> -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/