Skip to content

add hyperbolic functions #282

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 3 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
`cache_get_size()` [hroskes]
* don't generate docs for deprecated arguments [jcupitt]
* buffer save tries with the target API first [jcupitt]
* add hyperbolic functions `sinh`, `cosh`, `tanh`, `asinh`, `acosh`, `atanh`

## Version 2.1.15 (27 Dec 2020)

Expand Down
18 changes: 18 additions & 0 deletions pyvips/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,18 @@ class OperationMath(object):

ATAN (str): atan(), angles in degrees

SINH (str): sinh(), angles in radians

COSH (str): cosh(), angles in radians

TANH (str): tanh(), angles in radians

ASINH (str): asinh(), angles in radians

ACOSH (str): acosh(), angles in radians

ATANH (str): atanh(), angles in radians

LOG (str): log base e

LOG10 (str): log base 10
Expand All @@ -420,6 +432,12 @@ class OperationMath(object):
ASIN = 'asin'
ACOS = 'acos'
ATAN = 'atan'
SINH = 'sinh'
COSH = 'cosh'
TANH = 'tanh'
ASINH = 'asinh'
ACOSH = 'acosh'
ATANH = 'atanh'
LOG = 'log'
LOG10 = 'log10'
EXP = 'exp'
Expand Down
24 changes: 24 additions & 0 deletions pyvips/vimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,30 @@ def atan(self):
"""Return the inverse tangent of an image in degrees."""
return self.math('atan')

def sinh(self):
"""Return the hyperbolic sine of an image in radians."""
return self.math('sinh')

def cosh(self):
"""Return the hyperbolic cosine of an image in radians."""
return self.math('cosh')

def tanh(self):
"""Return the hyperbolic tangent of an image in radians."""
return self.math('tanh')

def asinh(self):
"""Return the inverse hyperbolic sine of an image in radians."""
return self.math('asinh')

def acosh(self):
"""Return the inverse hyperbolic cosine of an image in radians."""
return self.math('acosh')

def atanh(self):
"""Return the inverse hyperbolic tangent of an image in radians."""
return self.math('atanh')

def log(self):
"""Return the natural log of an image."""
return self.math('log')
Expand Down