Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Angle between two vectors
Date: Tue, 16 Aug 2011 11:17:31 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <j2djkb$j0o$1@newscl01ah.mathworks.com>
References: <ef5ce9c.-1@webcrossing.raydaftYaTP> <1184052626.324470.175540@n2g2000hse.googlegroups.com> <ellieandrogerxyzzy-1007070127090001@dialup-4.232.57.130.dial1.losangeles1.level3.net> <1184104526.774530.54800@n60g2000hse.googlegroups.com> <ellieandrogerxyzzy-1007071622370001@dialup-4.232.15.192.dial1.losangeles1.level3.net> <idlqpm$rc7$1@fred.mathworks.com> <il9t55$en6$1@fred.mathworks.com> <ila06k$t8g$1@fred.mathworks.com> <ilambc$67b$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1313493451 19480 172.30.248.35 (16 Aug 2011 11:17:31 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 16 Aug 2011 11:17:31 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2892724
Xref: news.mathworks.com comp.soft-sys.matlab:740138

Wondering if anyone can please help me with yet another problem calculating angles in matlab!

Ill set the scene:
I am simulating erosion on volcano slopes. I have a bathymetry dataset for a volcano - a matrix of land heights in the form a grid. Suppose for simplicity the grid is 100km x 100km and i have a measurement of land height (z) at every 1km. So we are in 3D.

I want to calculate the angle of the volcano sides - so essentially I will have a matrix of angles in which the slope angle is calculated between a point and the point directly above it (so looking from the bottom of the volcano towards the peak). Im struggling because on the East slope, the peak will be to the West, whereas at the South, it will be to the North. I thus wonder whether I will need to calculate the angles using vertical cross sections of the volcano and rotate the matrix through 360 degrees. 

Some help would be greatly appreciated as honestly i dont know where to start! and let me know if what ive said doesnt make sense!
Thank you!!