Plotting points evenly around an origin

Click For Summary

Discussion Overview

The discussion revolves around the challenge of plotting points evenly around a sphere, specifically using spherical coordinates (phi and theta) to generate a specified number of points. Participants explore various methods for achieving even distribution of points on the surface of a sphere.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes an initial approach to plotting points using spherical coordinates but expresses uncertainty about achieving even distribution of points.
  • Another participant asserts that an evenly spaced Cartesian grid cannot be mapped onto a sphere and suggests considering tessellation methods involving pentagons and hexagons for point placement.
  • A different approach is proposed involving random point generation on a sphere, with a request for a method to generate an orderly sequence of random numbers to achieve even spacing.
  • A participant introduces the Fibonacci Sphere method as a way to distribute points evenly over a sphere, providing a code snippet to illustrate the approach.

Areas of Agreement / Disagreement

Participants present multiple competing views on how to achieve even distribution of points on a sphere, with no consensus reached on a single method.

Contextual Notes

Some methods discussed depend on specific mathematical properties and assumptions about point distribution, which may not be universally applicable. The limitations of each approach are not fully resolved.

wizzy
Messages
1
Reaction score
0
TL;DR
Can anyone help w/ how to plot the given number of points evenly around a sphere using the start and end degrees for phi and theta?
Say I have phi starting at 0 and ending at 360 degrees. Theta starts at 0 and ends at 360, and I input 10 points for phi and theta. I am trying to 3d plot phi * theta number of points around a center point.

I can plot a coordinate around a sphere using the following, which I think is correct. The axes I'm using on my project is x, y is up, and z is depth (in, out).

C++:
Real radius;
Radian theta;
Radian phi;

Vector3 result;
result.x = radius * Cos(phi) * Sin(theta);
result.z = radius * Sin(phi) * Sin(theta);
result.y = radius * Cos(theta);

But I don't understand how to get the number of points evenly distributed which should be, if I'm not mistaken, 100 points (phi's no. of points * theta's no. of points).
 
Last edited:
Technology news on Phys.org
Last edited:
Another way might be to consider a method used to generate random points on a sphere, which goes something like this;

The phi coordinate is selected by a random number Ua between 0 and 1;
phi = Ua * 2 * Pi.

The theta coordinate is determined by selecting another random number Ub between 0 and 1; then solving for theta = Acos( 1 – 2 * Ub ).

The x, y and z coordinates are then;
x = r * Sin( theta ) * Cos( phi )
y = r * Sin( theta ) * Sin( phi )
z = r * Cos( theta )

How could you generate an orderly sequence of Ua and Ub to cover the sphere with evenly spaced points ?
 
The Fibonacci Sphere distributes points evenly over a sphere.
Code:
Const As Integer n = 100
Const Double TwoPi = 8 * Atn( 1 )
Const As Double golden_ratio = ( Sqrt( 5.0 ) + 1.0 ) / 2.0
Const As Double golden_angle = ( 2 - golden_ratio ) * TwoPi

Type geog
    As Double lat, lon
    As Double x, y, z
End Type

Dim As geog a( 1 To n )

Dim As Double r = 1
Dim As Integer i
For i = 1 To n
    With a( i )
        .lat = Asin( 2 * i / ( n + 1 ) - 1 )
        .lon = golden_angle * i
        .x = r * Cos( .lat ) * Cos( .lon )
        .y = r * Cos( .lat ) * Sin( .lon )
        .z = r * Sin( .lat )
    End With
Next i
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K