# How to place n equidistant points on a sphere?

**URL:** <https://forums.unrealengine.com/t/how-to-place-n-equidistant-points-on-a-sphere/494016>\
**Category:** Architectural and Design Visualization\
**Tags:** unreal-engine, UE5-0, UE4-26, question\
**Created:** [February 4, 2022, 1:35am UTC](https://forums.unrealengine.com/t/how-to-place-n-equidistant-points-on-a-sphere/494016 "2022-02-04T01:35:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fr3qee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fr3qee](https://forums.unrealengine.com/u/Fr3qee)\
**Post date:** [February 4, 2022, 1:35am UTC](https://forums.unrealengine.com/t/how-to-place-n-equidistant-points-on-a-sphere/494016/1 "2022-02-04T01:35:25Z")

</div>

There is a sphere. At it’s centre are long objects—let’s call them rays—anchored from one end. They all need to be radiating out at equidistant points through the surface of the sphere.

The model needs to be designed in a manner that can automatically recalculate positions based on the number of rays because the count will slowly increase over time and sometimes decrease.

I understand that purely equidistant placement is impossible to achieve in some cases, e.g. 5 points, but an approximation would be sufficient.

The paper [A New Computationally Efficient Method for Spacing n Points on a Sphere by Jonathan Kogan](https://scholar.rose-hulman.edu/cgi/viewcontent.cgi?article=1387&context=rhumj) may be of use—it even includes some python code at the end—but I do not know how to implement this in my use case.

Do you know how this can be achieved? Any guidance would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 4, 2022, 5:23pm UTC](https://forums.unrealengine.com/t/how-to-place-n-equidistant-points-on-a-sphere/494016/2 "2022-02-04T17:23:23Z")

</div>

It’s called a Fibonacci lattice ( or one method of doing this ).

If you take a look at the module in Niagara called, SphereLocation ( double click it to see the code ), there is an option called ‘Uniform’ for the distribution.

This uses a lattice.

Basically, what you do is use polar coordinates to distribute items on your sphere. You can convert the polar coords to cartesian ( ie vectors ), using a formula

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/7/f179a7e816fca11c58ae7fa9bd7b6312a235ed76.png)

I will put my blueprint code up tomorrow, but not at the machine right now.

---

<div class="post-metadata">

**Author:** ![Fr3qee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fr3qee](https://forums.unrealengine.com/u/Fr3qee)\
**Post date:** [February 5, 2022, 1:55am UTC](https://forums.unrealengine.com/t/how-to-place-n-equidistant-points-on-a-sphere/494016/4 "2022-02-05T01:55:50Z")

</div>

Wow! Thank you so much for this lead. I just played around a bit and it is exactly what I was hoping to find!

So, the next step is having objects anchor at the centre of the sphere and radiate out at the points as determined by Niagara\>Particle Spawn\>Sphere Location. I wonder if that can be achieved with ribbons, since I essentially do want to have ribbon-like formations coming out of the sphere.

Do you think I should open this up as a new question? Your answer really is the solution to the main topic question. If you agree, I’ll edit this post and post a new Q.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 5, 2022, 11:44am UTC](https://forums.unrealengine.com/t/how-to-place-n-equidistant-points-on-a-sphere/494016/5 "2022-02-05T11:44:53Z")

</div>

Feel free to mark it as answered 😉

I didn’t realize you actually wanted to use Niagara, I was only pointing at that module as an example.

If you want to use Niagara, then you can specify the ribbon start and end points using sphere location.

Here’s the reverse engineered code:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/4/dc4345ae7340ebcae146803464fba2a33515cc0e.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/7/e074763586cdbbd116f6f188be3ef2dea5972506.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/5/ff51ee5ef7a3b93e53859fd9d822acedf17b3eee.png)

and the function is

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/9/7b93dbc4f36262a6ae463846100b1532feea0444.png)

---

<div class="post-metadata">

**Author:** ![Rareden](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rareden](https://forums.unrealengine.com/u/Rareden)\
**Post date:** [November 3, 2022, 3:38am UTC](https://forums.unrealengine.com/t/how-to-place-n-equidistant-points-on-a-sphere/494016/6 "2022-11-03T03:38:20Z")

</div>

> [@ClockworkOcean](#):
>
> Fibonacci lattice

If your working in c++ you can use

TSphericalFibonacci SphericalFibonacci(NumPoints);  
// access index  
const FVector3 RealType=SphericalFibonacci.Point(PointIndex);  
// convert to normal vector for ue4  
FVector SphericalCoord(RealType.X,RealType.Y,RealType.Z);
