Skip to content

Commit f7f724c

Browse files
authored
add hyperbolic functions (#282)
* add hyperbolic functions * changelog
1 parent 507b3a5 commit f7f724c

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
`cache_get_size()` [hroskes]
1212
* don't generate docs for deprecated arguments [jcupitt]
1313
* buffer save tries with the target API first [jcupitt]
14+
* add hyperbolic functions `sinh`, `cosh`, `tanh`, `asinh`, `acosh`, `atanh`
1415

1516
## Version 2.1.15 (27 Dec 2020)
1617

pyvips/enums.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,18 @@ class OperationMath(object):
404404
405405
ATAN (str): atan(), angles in degrees
406406
407+
SINH (str): sinh(), angles in radians
408+
409+
COSH (str): cosh(), angles in radians
410+
411+
TANH (str): tanh(), angles in radians
412+
413+
ASINH (str): asinh(), angles in radians
414+
415+
ACOSH (str): acosh(), angles in radians
416+
417+
ATANH (str): atanh(), angles in radians
418+
407419
LOG (str): log base e
408420
409421
LOG10 (str): log base 10
@@ -420,6 +432,12 @@ class OperationMath(object):
420432
ASIN = 'asin'
421433
ACOS = 'acos'
422434
ATAN = 'atan'
435+
SINH = 'sinh'
436+
COSH = 'cosh'
437+
TANH = 'tanh'
438+
ASINH = 'asinh'
439+
ACOSH = 'acosh'
440+
ATANH = 'atanh'
423441
LOG = 'log'
424442
LOG10 = 'log10'
425443
EXP = 'exp'

pyvips/vimage.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,30 @@ def atan(self):
13351335
"""Return the inverse tangent of an image in degrees."""
13361336
return self.math('atan')
13371337

1338+
def sinh(self):
1339+
"""Return the hyperbolic sine of an image in radians."""
1340+
return self.math('sinh')
1341+
1342+
def cosh(self):
1343+
"""Return the hyperbolic cosine of an image in radians."""
1344+
return self.math('cosh')
1345+
1346+
def tanh(self):
1347+
"""Return the hyperbolic tangent of an image in radians."""
1348+
return self.math('tanh')
1349+
1350+
def asinh(self):
1351+
"""Return the inverse hyperbolic sine of an image in radians."""
1352+
return self.math('asinh')
1353+
1354+
def acosh(self):
1355+
"""Return the inverse hyperbolic cosine of an image in radians."""
1356+
return self.math('acosh')
1357+
1358+
def atanh(self):
1359+
"""Return the inverse hyperbolic tangent of an image in radians."""
1360+
return self.math('atanh')
1361+
13381362
def log(self):
13391363
"""Return the natural log of an image."""
13401364
return self.math('log')

0 commit comments

Comments
 (0)