Plotting points evenly around an origin

In summary: Radian( r ) * Sin( golden_ratio ) * Cos( golden_angle ).theta = Radian( r ) * Cos( golden_ratio ) * Sin( golden_angle )The geog type variable stores an array of doubles.The geog array stores an array of doubles.The geog array contains 100 double values.The geog array has 1, 100 elements.The geog array has Radian(1) values, Sin(2*pi*golden_ratio) values, and Cos(golden_angle)* values.
  • #1
wizzy
1
0
TL;DR Summary
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
  • #2
Last edited:
  • #3
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 ?
 
  • #4
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
 

Related to Plotting points evenly around an origin

1. What does it mean to plot points evenly around an origin?

Plotting points evenly around an origin means to place a set of points on a graph in such a way that they are equidistant from the center point, or origin. This can be achieved by using mathematical formulas or by evenly dividing the distance between each point.

2. Why is it important to plot points evenly around an origin?

Plotting points evenly around an origin is important because it allows for accurate representation of data and makes it easier to visualize patterns or relationships between the points. It also helps to maintain consistency and avoid distortion in the graph.

3. How can I plot points evenly around an origin?

There are a few different methods for plotting points evenly around an origin. One method is to use the distance formula, which involves calculating the distance between each point and the origin using the Pythagorean theorem. Another method is to divide the circumference of a circle into equal segments and plot the points at those intervals.

4. What are some common mistakes when plotting points evenly around an origin?

One common mistake is not properly calculating the distance between each point and the origin, which can lead to unevenly spaced points. Another mistake is not properly labeling or scaling the axes of the graph, which can result in a distorted representation of the data.

5. How can plotting points evenly around an origin be useful in scientific research?

Plotting points evenly around an origin can be useful in scientific research as it allows for accurate visualization and analysis of data. This can help researchers identify patterns, trends, and relationships within the data, which can then be used to make informed conclusions and further research.

Similar threads

  • High Energy, Nuclear, Particle Physics
Replies
1
Views
147
Replies
2
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
485
  • Advanced Physics Homework Help
Replies
6
Views
653
  • Special and General Relativity
Replies
4
Views
791
Replies
17
Views
3K
  • Introductory Physics Homework Help
Replies
6
Views
2K
  • Programming and Computer Science
Replies
12
Views
1K
Replies
3
Views
462
Replies
3
Views
1K
Back
Top