Skip to content

Commit

Permalink
removed get_angle()
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperdoerTrav committed Jul 25, 2024
1 parent 1945c4b commit 12a37b7
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions ssapy/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 12a37b7

Please sign in to comment.