colour_hdri.distortion.hyperbolic_cosine_2D_function#
- colour_hdri.distortion.hyperbolic_cosine_2D_function(x_y: Tuple, r_x: float, x_0: float, r_y: float, y_0: float, c: float) NDArrayFloat [source]#
Evaluate a hyperbolic cosine 2D function on given coordinate matrices from coordinate vectors.
The hyperbolic cosine 2D function adopts the following form:
\(I_v(x, y) = 1 - (cosh(r_x * (x - x_0)) * cosh(r_y * (y - y_0))) + c\)
- Parameters:
x_y (Tuple) – Coordinate matrices from coordinate vectors to evaluate the parabolic 2d function on. The coordinate matrices can be generated with the
numpy.meshgrid()
definition.r_x (float) – Coefficient \(r_x\) for the hyperbolic cosine equation.
x_0 (float) – Coefficient \(x_0\) for the hyperbolic cosine equation.
r_y (float) – Coefficient \(r_y\) for the hyperbolic cosine equation.
y_0 (float) – Coefficient \(y_0\) for the hyperbolic cosine equation.
c_y – Coefficient \(c_y\) for the hyperbolic cosine equation.
c (float) – Coefficient \(c\) for the hyperbolic cosine equation.
- Returns:
Coordinate matrices with evaluated hyperbolic cosine 2D function.
- Return type:
References
Examples
>>> x_1, y_1 = np.meshgrid(np.linspace(0, 1, 4), np.linspace(0, 1, 3)) >>> hyperbolic_cosine_2D_function( ... (x_1, y_1), 1, -0.5, 1, -0.5, 1 ... ) array([[ 1. ..., 0.9439281..., 0.7694244..., 0.4569193...], [ 0.8723740..., 0.8091459..., 0.6123710..., 0.2599822...], [ 0.4569193..., 0.3703959..., 0.1011226..., -0.3810978...]])