Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Angle between line and axis
Date: Tue, 10 Jan 2012 17:30:09 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 19
Message-ID: <jehsj1$3v1$1@newscl01ah.mathworks.com>
References: <jehf9c$esc$1@newscl01ah.mathworks.com> <d9d5fbf1-2532-4943-9114-3b12d20e06bb@i6g2000vbk.googlegroups.com> <859cce56-847e-4b00-92ae-e68004ae82bf@z1g2000vbx.googlegroups.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1326216609 4065 172.30.248.48 (10 Jan 2012 17:30:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 10 Jan 2012 17:30:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:754329

Rune Allnor <allnor@tele.ntnu.no> wrote in message <859cce56-847e-4b00-92ae-e68004ae82bf@z1g2000vbx.googlegroups.com>...

> 
> Two comments:
> 
> 1) The inner product is the general method, while
>    your suggestion only works with respct to one of
>    the axes.

Wong again, the atan2() method can extend to angle between two arbitrary vectors (in R2 and R3, which is the case). I leave for you to find the formula as exercise Rune.

> 
> 2) Somebody who needs to ask the question at all
>    is not concerned with numerical accuracies.
> 

This is a bonus (beside it is a *correct* method, contrary to what  you did claim)

Bruno