Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't have a copy of matlab handy, but I'll post the modifications I would make to your curve.</p> <p>Just to be clear since there are n-finity+1 different definitions for spherical angles. I will use the following, its backwards from your definition but I'm bound to make mistakes if I try and switch.</p> <ul> <li><code>\phi</code> - the angle from the z-axis</li> <li><code>\theta</code> - the projected angle in the x-y plane.</li> </ul> <h1>The Parameterization</h1> <p>Let <code>t</code> be a discrete set of N evenly spaced points from 0 to pi (inclusive).</p> <pre><code>\phi(t) = t \theta = 2 * c * t </code></pre> <p>Rather straight forward and simple, a spiral around a sphere is linear in <code>\phi</code> and <code>theta</code>. <code>c</code> is a constant that represents the number of full rotations in <code>\theta</code>, it need not be integer.</p> <h1>Neighboring Points</h1> <p>In your example, you calculate the angle between vectors with <code>atan2(norm(cross....)</code> which is fine, but doesn't give any insight into the problem. Your problem is on the surface of a sphere, <strong>use this fact</strong>. So I consider the distance between points <a href="http://mathb.in/10367" rel="nofollow">using this formula</a></p> <p>Now you find neighboring points, these occur at <code>t +- dt</code> and <code>theta +- 2pi</code> for whatever t this happens.</p> <p>In the first case <code>t +- dt</code>, it is easy to calculate <code>cos(gamma) = 1 - 2 c^2 sin^2(t) dt^2</code>. The <code>sin^2(t)</code> dependence is why the poles are more dense. Ideally you want to choose <code>theta(t)</code> and <code>phi(t)</code> such that <code>dtheta^2 * sin^2(phi)</code> is constant and minimal to satisfy this case.</p> <p>The second case is a little more difficult and brings up my comments about "staggering" your points. If we choose an N such that <code>dtheta</code> does not evenly divide 2pi, then after a full rotation around the sphere in <code>theta</code> I cannot end up directly beneath a previous point. To compare the distance between points in this case, use <code>delta t</code> so that <code>c delta t = 1</code>. Then you have <code>delta phi = delta t</code> and <code>delta theta = 2 c delta t - 2pi</code>. Depending on your choice of <code>c</code>, <code>delta phi</code> may or may not be small enough to use the small angle approximations.</p> <h1>Final notes</h1> <p>It should be apparent that <code>c=0</code> is a straight line down the sphere. By increasing <code>c</code> you increase the "density of the spiral" gaining more coverage. However, you also increase the distance between neighboring points. You will want to choose a <code>c</code> for the chosen <code>N</code> that makes the two distance formulas above approximately equal.</p> <p>EDIT moved some things to mathbin for cleanliness</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload