Generating a unit 3 vector in Python (Uniform Spherical Projection)

Andrew Bolster

Senior R&D Manager (Data Science) at Synopsys Software Integrity Group and Treasurer @ Bsides Belfast and NI OpenGovernment Network

Quick one more as a reminder to me than anything else.

As part of my PhD work I’m building different behaviours for virtual submarines. I’ll be explaining some parts of my work in a separate post, but basically, I needed to random walk. Random walk in 2 dimensions is easy; pick two random numbers, go that way. Unfortunately doesn’t work that way on a spherical surface

So to make things easier, I stole this StackOverflow answer from dmckee and tidied it up a bit for my purposes. (Assuming everyone else is like me and does import numpy as np)

blog comments powered by Disqus