Skip to content

Instantly share code, notes, and snippets.

@larsberg
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save larsberg/960cb199405387d585dd to your computer and use it in GitHub Desktop.

Select an option

Save larsberg/960cb199405387d585dd to your computer and use it in GitHub Desktop.

Revisions

  1. larsberg revised this gist Oct 30, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions pointOnSphere
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@ static ofVec3f pointOnSphere(float theta, float phi, float radius = 50)
    {
    ofVec3f p;

    p.x = radius * cos(theta) * sin(phi);
    p.y = radius * cos(phi);
    p.z = radius * sin(theta) * sin(phi);
    p.x = radius * cos(theta) * sin(phi);
    p.y = radius * cos(phi);
    p.z = radius * sin(theta) * sin(phi);

    return p;
    }
  2. larsberg created this gist Oct 30, 2014.
    11 changes: 11 additions & 0 deletions pointOnSphere
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    //theta in [0,TWO_PI), phi in [0,PI], and where radius in [0,infty)
    static ofVec3f pointOnSphere(float theta, float phi, float radius = 50)
    {
    ofVec3f p;

    p.x = radius * cos(theta) * sin(phi);
    p.y = radius * cos(phi);
    p.z = radius * sin(theta) * sin(phi);

    return p;
    }