.
This commit is contained in:
@@ -21,6 +21,7 @@ def gha1_approx(ell: EllipsoidTriaxial, p0: np.ndarray, alpha0: float, s: float,
|
||||
alphas = [alpha0]
|
||||
s_curr = 0.0
|
||||
last_sigma = None
|
||||
last_p = None
|
||||
|
||||
while s_curr < s:
|
||||
ds_step = min(ds, s - s_curr)
|
||||
@@ -30,9 +31,13 @@ def gha1_approx(ell: EllipsoidTriaxial, p0: np.ndarray, alpha0: float, s: float,
|
||||
p1 = points[-1]
|
||||
alpha1 = alphas[-1]
|
||||
|
||||
sigma = func_sigma_ell(ell, p1, alpha1)
|
||||
if last_sigma is not None and np.linalg.norm(sigma - last_sigma) > 0.2:
|
||||
raise Exception("GHA1_approx: Plötzlicher Richtungswechsel")
|
||||
p, q = pq_ell(ell, p1)
|
||||
if last_p is not None and np.dot(p, last_p) < 0:
|
||||
p = -p
|
||||
q = -q
|
||||
sigma = p * sin(alpha1) + q * cos(alpha1)
|
||||
if last_sigma is not None and np.dot(sigma, last_sigma) < 0:
|
||||
sigma = -sigma
|
||||
p2 = p1 + ds_step * sigma
|
||||
p2 = ell.point_onto_ellipsoid(p2)
|
||||
|
||||
@@ -82,10 +87,10 @@ def show_points(points: NDArray, p0: NDArray, p1: NDArray):
|
||||
|
||||
if __name__ == '__main__':
|
||||
ell = EllipsoidTriaxial.init_name("BursaSima1980round")
|
||||
P0 = ell.ell2cart(wu.deg2rad(10), wu.deg2rad(1))
|
||||
P0 = ell.ell2cart(wu.deg2rad(89), wu.deg2rad(1))
|
||||
alpha0 = wu.deg2rad(2)
|
||||
s = 100000
|
||||
P1_app, alpha1_app, points, alphas = gha1_approx(ell, P0, alpha0, s, ds=10000, all_points=True)
|
||||
s = 200000
|
||||
P1_app, alpha1_app, points, alphas = gha1_approx(ell, P0, alpha0, s, ds=100, all_points=True)
|
||||
P1_ana, alpha1_ana = gha1_ana(ell, P0, alpha0, s, maxM=20, maxPartCircum=2)
|
||||
show_points(points, P0, P1_ana)
|
||||
print(np.linalg.norm(P1_app - P1_ana))
|
||||
show_points(points, P0, P1_ana)
|
||||
|
||||
@@ -128,6 +128,12 @@ def pq_ell(ell: EllipsoidTriaxial, point: NDArray) -> Tuple[NDArray, NDArray]:
|
||||
n = ell.func_n(point)
|
||||
|
||||
beta, lamb = ell.cart2ell(point)
|
||||
if abs(cos(beta)) < 1e-12 and abs(np.sin(lamb)) < 1e-12:
|
||||
if beta > 0:
|
||||
p = np.array([0, -1, 0])
|
||||
else:
|
||||
p = np.array([0, 1, 0])
|
||||
else:
|
||||
B = ell.Ex ** 2 * cos(beta) ** 2 + ell.Ee ** 2 * sin(beta) ** 2
|
||||
L = ell.Ex ** 2 - ell.Ee ** 2 * cos(lamb) ** 2
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user