Commit 16cf5e80 authored by Olaf's avatar Olaf

nothing to commit

parents 30382120 36bb77b4
......@@ -236,6 +236,19 @@ def ellipse_angle_of_rotation(a):
else:
return np.pi/2 + np.arctan(2*b/(a-c))/2
def eccentricity(axes):
# determine semi-minor and semi-major axis
semi_minor_axis = np.min(axes)
semi_major_axis = np.max(axes)
# calculate eccentricity
e = np.sqrt(1-semi_minor_axis**2/semi_major_axis**2)
if e > 1:
raise ValueError('Eccentricity =',e,' but should be smaller than 1.')
return semi_minor_axis, semi_major_axis, e
def rot_x(r, theta):
"""
Function to rotate coordinates parallel to x axis
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment