SoatDev IT Consulting
SoatDev IT Consulting
  • About us
  • Expertise
  • Services
  • How it works
  • Contact Us
  • News
  • August 12, 2023
  • Rss Fetcher

Evenly placing points on a sphere is a difficult problem. It’s impossible in general, and so you distribute the points as evenly as you can. The results vary according to how you measure how evenly the points are spread.

However, there is a fast and simple way to distribute points that may be good enough, depending on your application, called the Fibonacci lattice.

Let P = 2N + 1. To distribute P points on a sphere let the latitude of the points be arccos(2i/P) and the longitude 2πi/φ where φ is the golden ratio and i runs from −N to N.

Here’s the Mathematica code that produced the image above.

    sp[{r_, lat_, long_}] := r {Cos[lat] Cos[long], Cos[lat] Sin[long], Sin[lat]};
    n = 500;
    Graphics3D@{ 
        Sphere[{0, 0, 0}, 1],
        Point[sp /@ 
            Table[{1, ArcSin[2 i /(2 n + 1)], 2 Pi i/GoldenRatio}, 
                  {i, -n, n}]]}

Maybe you’d like something that looks more random, i.e. something that looks what people think randomness looks like. Actual randomness is clumpier than people expect. In this case you could jitter the Fibonacci lattice by changing the coordinates to something like

    {1, ArcSin[2 i /(2 n + 1)] + RandomReal[0.05], 2 Pi i/GoldenRatio + RandomReal[0.1]}

Note that this adds twice as much randomness to the longitude than latitude because the former has twice the range.

Related posts

  • Spherical coordinate Rosetta Stone
  • QMC in integration and art

The post Simple way to distribute points on a sphere first appeared on John D. Cook.

Previous Post
Next Post

Recent Posts

  • Genesis AI launches with $105M seed funding from Eclipse, Khosla to build AI models for robots
  • xAI raises $10B in debt and equity
  • Safaricom Ethiopia Hits 10 Million Customers
  • Cloudflare launches a marketplace that lets websites charge AI bots for scraping
  • Tinder’s mandatory facial recognition check comes to the US

Categories

  • Industry News
  • Programming
  • RSS Fetched Articles
  • Uncategorized

Archives

  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023

Tap into the power of Microservices, MVC Architecture, Cloud, Containers, UML, and Scrum methodologies to bolster your project planning, execution, and application development processes.

Solutions

  • IT Consultation
  • Agile Transformation
  • Software Development
  • DevOps & CI/CD

Regions Covered

  • Montreal
  • New York
  • Paris
  • Mauritius
  • Abidjan
  • Dakar

Subscribe to Newsletter

Join our monthly newsletter subscribers to get the latest news and insights.

© Copyright 2023. All Rights Reserved by Soatdev IT Consulting Inc.