Background: I have a sphere of some radius R. What I'm trying to do is essentially create a wireframe consisting of great circles that run along the sphere.

I want an equation to represent the great circles so that I can find points that run along those trajectories.

I don't have enough credit to post links, but there a post in the Mathematica stack exchange titled: How to draw a great circle on a sphere?

Which is what I want to achieve.

However, I want to implement it in python and require a further breakdown of the equations that are happening behind the scenes.

I will be plotting these equations in python.


closed as off-topic by Xander Henderson, Namaste, Shaun, Theoretical Economist, Taroccoesbrocco Aug 21 '18 at 3:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Namaste, Shaun, Taroccoesbrocco
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Seems more like a programming question to me, as the answer depends on your graphics library, if it is 2D or 3D, about how fast or smooth the rendering should be etc. $\endgroup$ – mvw Aug 20 '18 at 20:47
  • 1
    $\begingroup$ What attempts have you made at this problem yourself? Do you know the equation that points on a sphere must satisfy? What about the equation for points lying on a plane? A great circle is the intersection of your sphere with a plane which passes through the origin. Can you see what two equations the points satisfying these conditions must satisfy? $\endgroup$ – Matt Aug 20 '18 at 20:50
  • $\begingroup$ Did you mean this Mathematica link: How to draw a great circle on a sphere? $\endgroup$ – Weather Vane Aug 20 '18 at 20:51

The equation of equally placed great circles can be written as following in the spherical coordinates$$R=1\\\phi=\dfrac{i}{n}2\pi$$which by translating to Cartesian coordinates gives us $$x^2+y^2+z^2=1\\y=x\cdot\tan \dfrac{i}{n}2\pi$$you can use the following parametric equation for this$$\left(\sin t\cdot\cos \dfrac{i}{n}2\pi\quad,\quad\sin t\cdot\sin \dfrac{i}{n}2\pi\quad,\quad\pm\cos t\right)$$here is an image of what this can generate using MATLAB

enter image description here

  • $\begingroup$ \left( ... \right) would help... I would also suggest using parentheses to group the arguments of the trig functions, as this would enhance readability. $\endgroup$ – Xander Henderson Aug 20 '18 at 21:06
  • $\begingroup$ Why not write $$ \left( \sin(t)\tan\left(2\pi i/n\right), \sin(t), \pm\sqrt{1- \sin^2(t)\, /\cos^2\left(2\pi i/n\right) }\right) $$ $\endgroup$ – mvw Aug 20 '18 at 21:18
  • $\begingroup$ Sorry i don't get you. What is the difference in your post with my answer? $\endgroup$ – Mostafa Ayaz Aug 20 '18 at 21:24
  • $\begingroup$ For clarification are you defining phi to be the angle between the z-axis and the XY plane and theta to be the angle of an arc in the XY plane? Where I'm defining the z-axis to be pointing up. $\endgroup$ – NoviceCoder Aug 20 '18 at 21:35
  • $\begingroup$ Well i defined them exactly reversed :) $\phi$ is the angle of arc $\endgroup$ – Mostafa Ayaz Aug 20 '18 at 21:37

The top answer over at the Mathematica.SE question is effectively doing the following:

  1. Construct two unit vectors $\hat{u}, \hat{v} \in \mathbb{R}^3$ such that $\hat{u} \cdot \hat{v} = 0$. These two vectors lie in the plane of the desired great circle. If one wants a "random" great circle, one could simply construct two random vectors and then apply the Gram-Schmidt process.

  2. Plot points of the form $$\vec{r}(\theta) = (R \cos \theta) \hat{u} + (R \sin \theta) \hat{v}.$$ As $\theta$ runs from $0$ to $2 \pi$, this traces out a parametric circle of radius $R$ lying in the plane spanned by $\hat{u}$ and $\hat{v}$.

  • $\begingroup$ This partially worked for me, except I could not rotate the points about the y-axis to create great circles around the sphere. Instead, I could rotate about the x-axis and get small circles instead. I may use this for a different application. Thank you regardless I upvoted this, but I do not have enough rep to change your score. $\endgroup$ – NoviceCoder Aug 20 '18 at 23:59

Use spherical trigonometry to help you.

Presumably you are using the usual spherical coordinates, Thus define the origin as the center of the sphere, $P_0 =(\theta_0, \phi_0)$ as the angular coordinates of any fixed point P on the sphere, and $N = (\theta =0,\phi =0)$ as the coordinates of the "north pole" where the positive $z$ axis meets the sphere. We choose $P_0$ as the "pole" with respect to which the great circle would be the "equator", situated $90°$ from the pole $P_0$.

Draw $\triangle PP_0N$ on the sphere, where $P$ is any point on the great circle that is $90°$ from $P_0$. By hypothesis $|PN|=\theta, |P_0N|=\theta_0, |PP_0=90°,|\angle N|=|\phi-\phi_0|.$ Then the Law of Cosines for arc $PP_0$ immediately gives


Q(uod) E(rat) F(aciendum).


Not the answer you're looking for? Browse other questions tagged or ask your own question.