From 12a37b7554bac60d03fd9c342e9a6332c7ce14c1 Mon Sep 17 00:00:00 2001 From: SuperdoerTrav Date: Thu, 25 Jul 2024 13:57:56 -0700 Subject: [PATCH] removed get_angle() --- ssapy/compute.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/ssapy/compute.py b/ssapy/compute.py index 2a53fcd..f92cf38 100644 --- a/ssapy/compute.py +++ b/ssapy/compute.py @@ -1322,48 +1322,6 @@ def calculate_orbital_elements(r_, v_, mu_barycenter=EARTH_MU): ###################################################################################### -def get_angle(a, b, c): # a,b,c where b is the vertex - """ - Calculate the angle between two vectors where b is the vertex of the angle. - - This function computes the angle between vectors `ba` and `bc`, where `b` is the vertex and `a` and `c` are the endpoints of the angle. - - Parameters: - ---------- - a : (n, 3) numpy.ndarray - Array of coordinates representing the first vector. - b : (n, 3) numpy.ndarray - Array of coordinates representing the vertex of the angle. - c : (n, 3) numpy.ndarray - Array of coordinates representing the second vector. - - Returns: - ------- - numpy.ndarray - Array of angles (in radians) between the vectors `ba` and `bc`. - - Notes: - ------ - - The function handles multiple vectors by using broadcasting. - - The angle is calculated using the dot product formula and the arccosine function. - - Example: - -------- - >>> a = np.array([[1, 0, 0]]) - >>> b = np.array([[0, 0, 0]]) - >>> c = np.array([[0, 1, 0]]) - >>> get_angle(a, b, c) - array([1.57079633]) - """ - a = np.atleast_2d(a) - b = np.atleast_2d(b) - c = np.atleast_2d(c) - ba = np.subtract(a, b) - bc = np.subtract(c, b) - cosine_angle = np.sum(ba * bc, axis=-1) / (np.linalg.norm(ba, axis=-1) * np.linalg.norm(bc, axis=-1)) - return np.arccos(cosine_angle) - - def moon_shine(r_moon, r_sat, r_earth, r_sun, radius, albedo, albedo_moon, albedo_back, albedo_front, area_panels): # In SI units, takes single values or arrays returns a fractional flux """ Calculate the fractional flux of sunlight reflected from the Moon to the satellite.