Skip to content

Commit 6ff02e5

Browse files
AdamRJensenkandersolaradriesse
authored
Add atand function (#1927)
* Add atand function * Fix * Fix me again * Last fix promise * Update pvlib/tools.py Co-authored-by: Kevin Anderson <[email protected]> * Apply suggestions from code review Thanks for these improvements @adriesse Co-authored-by: Anton Driesse <[email protected]> --------- Co-authored-by: Kevin Anderson <[email protected]> Co-authored-by: Anton Driesse <[email protected]>
1 parent 4e99ddc commit 6ff02e5

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

pvlib/tools.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
def cosd(angle):
1313
"""
14-
Cosine with angle input in degrees
14+
Trigonometric cosine with angle input in degrees.
1515
1616
Parameters
1717
----------
@@ -23,14 +23,13 @@ def cosd(angle):
2323
result : float or array-like
2424
Cosine of the angle
2525
"""
26-
2726
res = np.cos(np.radians(angle))
2827
return res
2928

3029

3130
def sind(angle):
3231
"""
33-
Sine with angle input in degrees
32+
Trigonometric sine with angle input in degrees.
3433
3534
Parameters
3635
----------
@@ -42,14 +41,13 @@ def sind(angle):
4241
result : float
4342
Sin of the angle
4443
"""
45-
4644
res = np.sin(np.radians(angle))
4745
return res
4846

4947

5048
def tand(angle):
5149
"""
52-
Tan with angle input in degrees
50+
Trigonometric tangent with angle input in degrees.
5351
5452
Parameters
5553
----------
@@ -61,14 +59,13 @@ def tand(angle):
6159
result : float
6260
Tan of the angle
6361
"""
64-
6562
res = np.tan(np.radians(angle))
6663
return res
6764

6865

6966
def asind(number):
7067
"""
71-
Inverse Sine returning an angle in degrees
68+
Trigonometric inverse sine returning an angle in degrees.
7269
7370
Parameters
7471
----------
@@ -80,14 +77,13 @@ def asind(number):
8077
result : float
8178
arcsin result
8279
"""
83-
8480
res = np.degrees(np.arcsin(number))
8581
return res
8682

8783

8884
def acosd(number):
8985
"""
90-
Inverse Cosine returning an angle in degrees
86+
Trigonometric inverse cosine returning an angle in degrees.
9187
9288
Parameters
9389
----------
@@ -99,11 +95,28 @@ def acosd(number):
9995
result : float
10096
arccos result
10197
"""
102-
10398
res = np.degrees(np.arccos(number))
10499
return res
105100

106101

102+
def atand(number):
103+
"""
104+
Trigonometric inverse tangent returning an angle in degrees.
105+
106+
Parameters
107+
----------
108+
number : float
109+
Input number
110+
111+
Returns
112+
-------
113+
result : float
114+
arctan result
115+
"""
116+
res = np.degrees(np.arctan(number))
117+
return res
118+
119+
107120
def localize_to_utc(time, location):
108121
"""
109122
Converts or localizes a time series to UTC.

0 commit comments

Comments
 (0)