Understanding of the function 'dist'

6 views (last 30 days)
justine
justine on 12 Aug 2014
Edited: justine on 12 Aug 2014
Hi everyone,
So here's my problem - I am considering two points, let's say A and B, and I would like to know the heading of the point A from the point B (i.e. the angle between A and B and the direction of A - if A is going towards B or further away). For this, I am using the function [RANGE,AF,AR]= dist(lat,lon) as follows:
[rangeMeter,AF,AR] = dist([B.lat A.lat],[B.lon A.lon]);
My concern is that I do not really understand the results I got - how to understand the forward (AF) and reverse (AR) bearing ? Are there any similar functions that could lead me to what I want to find ?
Any help would be so much appreciated! Thanks!
  4 Comments
Adam
Adam on 12 Aug 2014
Edited: Adam on 12 Aug 2014
I don't have the Neural Networks toolbox myself, but it sounds to me as though it is tailored towards specific cases of Neural Networks and if you just want general euclidean maths I would recommend keeping it simple. That is, unless I misunderstand your problem and you are in fact using Neural Networks
In this case I can't think of any builtin functions that will do all that you want, just trigonometry components.
justine
justine on 12 Aug 2014
Edited: justine on 12 Aug 2014
Okay so I finally got it! This is not a function from the Neural Networks toolbox, my mistake. It appears to be a function from WHOI ( http://staff.washington.edu/dushaw/WOA/dist.m )
After lots of calculus and simulation, I managed to understand the "forward and reverse" bearings name - it depends of the position of my point A and B. The forward bearing is for example the direction of the line between A to B and the reverse is from B to A. Forward and reverse bearings differ by + or - 180°.

Sign in to comment.

Accepted Answer

Greg Heath
Greg Heath on 12 Aug 2014
To try to understand any function, first use the commands help, doc and type
help dist
doc dist
type dist
Then examine the examples in detail
Finally, search the NEWSGROUP and ANSWERS for posted applications.
Hope this helps.
Thank you for formally accepting my answer
Greg

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!