Rank: 666 based on 125 downloads (last 30 days) and 5 files submitted
photo

Kurt

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Kurt View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
21 May 2012 Find Nearest Neighbors on Sphere To be used with the GridSphere function to look up the nearest point to a query on a geodesic grid. Author: Kurt nearest neighbor, gridsphere, sphere, ball, grid, search 27 2
21 May 2012 GridSphere Produces a nearly even grid over the surface of a sphere. Author: Kurt sphere, geometry, ball, grid, geodesic, find nearest neighbor... 39 4
  • 5.0
5.0 | 1 rating
21 May 2012 Is Octave Returns true when code is executing in GNU Octave. Author: Kurt environment, octave, compatibility 15 0
21 May 2012 Golden Ratio Computes the golden ratio. Author: Kurt golden mean, mathematics, golden ratio, phi 18 7
  • 5.0
5.0 | 1 rating
21 May 2012 Spherical To Azimuthal Equidistant Convert from spherical coordinates to azimuthal equidistant coordinates. Author: Kurt spatial, sphere, geometry, mathematics, coordinates, transformation 26 0
  • 5.0
5.0 | 1 rating
Comments and Ratings by Kurt View all
Updated File Comments Rating
19 May 2012 GridSphere Produces a nearly even grid over the surface of a sphere. Author: Kurt

Thank you, LU! That's a great question. How concerned are you concerned with performance? If you can stomach an O(n ^ 2) algorithm, where n is the number of points output by GridSphere, then I think the following approach will be easiest.

1. Find the distance between all the pairs of points output by GridSphere.
2. Sort by these distances to find all the pairs of points that are closest to one another. There are at least three gotchas here: (1) you'll need to make sure that either you're not computing the distance between a point and itself or that you're filtering out the pairs with distance 0, (2) you'll probably want to avoid computing both the distance from point a to point b and the distance from point b to point a, and (3) you'll need to account for the imperfect precision of floating point arithmetic, which will result in clumps of distances that are very close but not quite equal. Some of the functions that come with GridSphere may be helpful to you, such as DistinctFromPrevious, which will find the boundaries between the aforementioned clumps.
3. Draw great circles (or just straight lines) connecting the pairs of points you found in step 2. Each of these pairs corresponds to one edge of a triangle. As Paul mentioned, you may need to call conversion functions like deg2rad and sph2cart on your great circle (or line) vectors to project them appropriately.

08 Feb 2012 GridSphere Produces a nearly even grid over the surface of a sphere. Author: Kurt

Thank you for the feedback, Paul. I went ahead and put in a request for the description to be modified to include a usage example. It should appear within five business days.

28 Sep 2010 Golden Ratio Computes the golden ratio. Author: Kurt

Thanks for pointing this out, Matt. I ran several of the options against each other, and profiled the results. I've updated the file with the version that consistently ran the fastest. You were right that using a persistent variable was not worth it.

28 Sep 2010 Golden Ratio Computes the golden ratio. Author: Kurt

This is a good point Mark. I would be very surprised if the function ran faster than an inline computation of phi, because, as you suggest, the overhead for a function call is non-trivial. I don't recommend this function (or the MATLAB environment in general) to someone concerned about such a performance difference.

27 Sep 2010 Golden Ratio Computes the golden ratio. Author: Kurt

I'm aware that the function is trivial to implement, but I felt it was an important enough constant that it should have come built in. Apparently other people did as well, because it's getting downloaded.

Comments and Ratings on Kurt's Files View all
Updated File Comment by Comments Rating
19 May 2012 GridSphere Produces a nearly even grid over the surface of a sphere. Author: Kurt Kurt

Thank you, LU! That's a great question. How concerned are you concerned with performance? If you can stomach an O(n ^ 2) algorithm, where n is the number of points output by GridSphere, then I think the following approach will be easiest.

1. Find the distance between all the pairs of points output by GridSphere.
2. Sort by these distances to find all the pairs of points that are closest to one another. There are at least three gotchas here: (1) you'll need to make sure that either you're not computing the distance between a point and itself or that you're filtering out the pairs with distance 0, (2) you'll probably want to avoid computing both the distance from point a to point b and the distance from point b to point a, and (3) you'll need to account for the imperfect precision of floating point arithmetic, which will result in clumps of distances that are very close but not quite equal. Some of the functions that come with GridSphere may be helpful to you, such as DistinctFromPrevious, which will find the boundaries between the aforementioned clumps.
3. Draw great circles (or just straight lines) connecting the pairs of points you found in step 2. Each of these pairs corresponds to one edge of a triangle. As Paul mentioned, you may need to call conversion functions like deg2rad and sph2cart on your great circle (or line) vectors to project them appropriately.

16 May 2012 GridSphere Produces a nearly even grid over the surface of a sphere. Author: Kurt LU

Hi Kurt, Wonderful program. I was just wondering if it is possible to connect the vertices with lines? Using Paul's example plots the vertiecs but i would like to display it as a mesh grid showing the edges of the triangles.

Thanks!

08 Feb 2012 GridSphere Produces a nearly even grid over the surface of a sphere. Author: Kurt Kurt

Thank you for the feedback, Paul. I went ahead and put in a request for the description to be modified to include a usage example. It should appear within five business days.

07 Feb 2012 GridSphere Produces a nearly even grid over the surface of a sphere. Author: Kurt Koppen, Paul

Blazingly fast and well documented. Only an example would not have been unbecoming, e.g. to illustrate the fact that returned values are in degrees (whereas Matlab's sph2cart requires radians).

[lat,long] = GridSphere(1000);
latrad = deg2rad(lat);
longrad = deg2rad(long);
[x,y,z] = sph2cart(longrad, latrad, 1);
scatter3(x, y, z, 22);
axis equal vis3d;

07 Feb 2012 Find Nearest Neighbors on Sphere To be used with the GridSphere function to look up the nearest point to a query on a geodesic grid. Author: Kurt Koppen, Paul

-- Wrong page. Comment intended for GridSphere code.

Top Tags Applied by Kurt
geometry, sphere, ball, geodesic, grid
Files Tagged by Kurt View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
21 May 2012 Find Nearest Neighbors on Sphere To be used with the GridSphere function to look up the nearest point to a query on a geodesic grid. Author: Kurt nearest neighbor, gridsphere, sphere, ball, grid, search 27 2
21 May 2012 GridSphere Produces a nearly even grid over the surface of a sphere. Author: Kurt sphere, geometry, ball, grid, geodesic, find nearest neighbor... 39 4
  • 5.0
5.0 | 1 rating
21 May 2012 Is Octave Returns true when code is executing in GNU Octave. Author: Kurt environment, octave, compatibility 15 0
21 May 2012 Golden Ratio Computes the golden ratio. Author: Kurt golden mean, mathematics, golden ratio, phi 18 7
  • 5.0
5.0 | 1 rating
21 May 2012 Spherical To Azimuthal Equidistant Convert from spherical coordinates to azimuthal equidistant coordinates. Author: Kurt spatial, sphere, geometry, mathematics, coordinates, transformation 26 0
  • 5.0
5.0 | 1 rating

Contact us at files@mathworks.com