Skip to content

Add atand function #1927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions pvlib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def cosd(angle):
"""
Cosine with angle input in degrees
Trigonometric cosine with angle input in degrees.

Parameters
----------
Expand All @@ -23,14 +23,13 @@ def cosd(angle):
result : float or array-like
Cosine of the angle
"""

res = np.cos(np.radians(angle))
return res


def sind(angle):
"""
Sine with angle input in degrees
Trigonometric sine with angle input in degrees.

Parameters
----------
Expand All @@ -42,14 +41,13 @@ def sind(angle):
result : float
Sin of the angle
"""

res = np.sin(np.radians(angle))
return res


def tand(angle):
"""
Tan with angle input in degrees
Trigonometric tangent with angle input in degrees.

Parameters
----------
Expand All @@ -61,14 +59,13 @@ def tand(angle):
result : float
Tan of the angle
"""

res = np.tan(np.radians(angle))
return res


def asind(number):
"""
Inverse Sine returning an angle in degrees
Trigonometric inverse sine returning an angle in degrees.

Parameters
----------
Expand All @@ -80,14 +77,13 @@ def asind(number):
result : float
arcsin result
"""

res = np.degrees(np.arcsin(number))
return res


def acosd(number):
"""
Inverse Cosine returning an angle in degrees
Trigonometric inverse cosine returning an angle in degrees.

Parameters
----------
Expand All @@ -99,11 +95,28 @@ def acosd(number):
result : float
arccos result
"""

res = np.degrees(np.arccos(number))
return res


def atand(number):
"""
Trigonometric inverse tangent returning an angle in degrees.

Parameters
----------
number : float
Input number

Returns
-------
result : float
arctan result
"""
res = np.degrees(np.arctan(number))
return res


def localize_to_utc(time, location):
"""
Converts or localizes a time series to UTC.
Expand Down