bolo17

Untitled

Sep 11th, 2023
786
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | Science | 0 0
  1. Python code to solve Kepler’s equation
  2.  
  3. from numpy import sqrt, cbrt, pi, sin, cos, arcsin, random
  4.    
  5.     # This will solve the special form of the cubic we need.
  6.     def solve_cubic(a, c, d):
  7.         assert(a > 0 and c > 0)
  8.         p = c/a
  9.         q = d/a
  10.         k = sqrt( q**2/4 + p**3/27 )
  11.         return cbrt(-q/2 - k) + cbrt(-q/2 + k)
  12. for more:https://bestcash2020.com/Mqz9m
Advertisement
Add Comment
Please, Sign In to add comment