Or as a directed magnitude (running from the origin to that point). Vector of dimensionality n can be interpreted as point in an n-dimensional space, Thus two-dimensional vectors are elements of the set, e.g. a member of R^n (where R stands for the real numbers). Operationsĭefined on scalars include addition, multiplication, exponentiation, etc.Ī vector is an n-tuple (an ordered set) of numbers,Į.g. Name "scalar" derives from its role in scaling vectors. Vectors, matrices and basic operations on themĪ scalar is any real (later complex) number. and at a couple of points in the course, this will become important. (and in Matlab) scalars, vectors and matrices can be made out of complex numbers This review will be limited to the case of real numbers. Note that theĭouble "greater-than" > is the Matlab prompt. This introduction will also show you how to express each concept We begin this course with a brief review of linear algebra, and will return to the topic This is just as true for research on speech, language and communication as it is for every other area of science. This is true of most inferential and exploratory statistics, most data mining, most model building and testing, most analysis and synthesis of sounds and images, and so on. Today, most scientific mathematics is applied linear algebra, in whole or in part. PS - I wouldn't be surprised that if you would write everything out that I did, you'll probably re-discover the Haversine formula.Linear Algebra has become as basic and as applicableĪs calculus, and fortunately it is easier. But I don't think that is your goal here :) If you want to include the Earth's oblateness or some higher order shape model (or God forbid, distances including terrain), you need to do far more complicated stuff. Now, all of this is valid for the whole Earth, provided you find the smooth spherical Earth accurate enough an approximation. If you insist on skipping the conversion to Cartesian and use lat/lon directly, you'll have to use the Haversine formula, as outlined on this website for example, which is also the method used by distance() from the mapping toolbox. % Convert that linear index to 2D subscripts % slight overshoots due to numerical artifacts % NOTE: force the dot product into the interval. % The minimum distance, and the linear index where that distance was found % NOTE: use radius 1, so we don't have to normalize the vectors % Convert the array of lat/lon coordinates to Cartesian vectors In MATLAB code: % Some example coordinates (degrees are assumed) Note that | a| = | b| = R, with R = 6371 the radius of Earth. Where a and b are two such Cartesian vectors on the sphere. I've learned to do all this in university, but I also learned that the spherical trig approach often introduces complexity that mathematically speaking is not strictly required, in other words, the spherical trig is not the simplest representation of the underlying problem.įor example, your distance problem is pretty trivial if you convert your latitudes and longitudes to 3D Cartesian X,Y,Z coordinates, and then find the distances through the simple formula For spatial computations however, like the on-surface distances you are trying to compute, spherical coordinates are actually pretty cumbersome to work with.Īlthough it is possible to do such calculations using the angles directly, I personally don't consider it very practical: you often have to have a strong background in spherical trigonometry, and considerable experience to know its many pitfalls - very often there are instabilities or "special points" you need to work around (the poles, for example), quadrant ambiguities you need to consider because of trig functions you've introduced, etc. Spherical coordinates are very useful and practical for purposes of navigation, mapping, and that sort of thing. This will be more of a problem in the polar regions, since large longitude differences there will have less of an impact on the actual distance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |