Python Forum
data science - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: data science (/thread-21262.html)



data science - peepeepoopoo - Sep-21-2019

I have a dataframe with billions of stars, and i would like to narrow it down using equations. I need to find which stars are moving at escape velocity from their galactic coordinates in order to find which objects will have a significant enough gravitational pull on the star to alter its course so it has to be moving at the proper 3 dimensional velocity. My friend is working on the galactic coordinates equation and i am new to python and need to plug the formula into the dataframe could somebody show how to put an equation in to python with multiple steps.

The equation would be a basic 3d velocity equation which i would explain but the equation looks like this apparently but we do not have the end position. x y and z are different vectors like tangential velocity, radial velocity etc
dx = endPosition.x - startPosition.x
dy = endPosition.y - startPosition.y
dz = endPosition.z - startPosition.z


d = sqrt(dx*dx + dy*dy + dz*dz)

vx = dx/d * missileSpeed
vy = dy/d * missileSpeed
vz = dz/d * missileSpeed


RE: data science - Larz60+ - Sep-21-2019

something like this? https://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html?highlight=3d%20quiver%20plot