Mathematical Functions

The following tables show mathematical functions provided by NLCPy.

Trigonometric Functions

nlcpy.sin

Computes the element-wise sine.

nlcpy.cos

Computes the element-wise cosine.

nlcpy.tan

Computes the element-wise tangent.

nlcpy.arcsin

Computes the element-wise inverse sine.

nlcpy.arccos

Computes the element-wise inverse cosine.

nlcpy.arctan

Computes the element-wise inverse tangent.

nlcpy.arctan2

Computes the element-wise inverse tangent of x1/x2 choosing the quadrant correctly.

nlcpy.hypot

Computes the "legs" of a right triangle.

nlcpy.degrees

Converts angles from radians to degrees.

nlcpy.radians

Converts angles from degrees to radians.

nlcpy.deg2rad

Converts angles from degrees to radians.

nlcpy.rad2deg

Converts angles from radians to degrees.

Hyperbolic Functions

nlcpy.sinh

Computes the element-wise hyperbolic sine.

nlcpy.cosh

Computes the element-wise hyperbolic cosine.

nlcpy.tanh

Computes the element-wise hyperbolic tangent.

nlcpy.arcsinh

Computes the element-wise inverse hyperbolic sine.

nlcpy.arccosh

Computes the element-wise inverse hyperbolic cosine.

nlcpy.arctanh

Computes the element-wise inverse hyperbolic tangent.

Rounding

nlcpy.floor

Returns the floor of the input, element-wise.

nlcpy.ceil

Returns the ceiling of the input, element-wise.

nlcpy.trunc

Returns the truncated value of the input, element-wise.

Sums, Products, Differences

nlcpy.prod

Returns the product of array elements over a given axis.

nlcpy.sum

Sum of array elements over a given axis.

nlcpy.cumsum

Returns the cumulative sum of the elements along a given axis.

nlcpy.diff

Calculates the n-th discrete difference along the given axis.

Exponents and Logarithms

nlcpy.exp

Computes the exponential of all elements in the input array.

nlcpy.exp2

Computes 2**x for all elements in the array.

nlcpy.log

Computes the element-wise natural logarithm of x.

nlcpy.log10

Computes the element-wise base-10 logarithm of x.

nlcpy.expm1

Computes exp(x) - 1 for all elements in the array.

nlcpy.log1p

Computes the element-wise natural logarithm of 1 + x.

nlcpy.logaddexp

Computes the element-wise natural logarithm of exp(x1) + exp(x2).

nlcpy.logaddexp2

Computes the element-wise base-2 logarithm of 2^{x1} + 2^{x2}.

nlcpy.signbit

Returns True where signbit is set (less than zero), element-wise.

nlcpy.copysign

Changes the sign of x1 to that of x2, element-wise.

nlcpy.spacing

Returns the distance between x and the nearest adjacent number, element-wise.

nlcpy.ldexp

Returns x1 * 2^{x2}, element-wise.

Arithmetic Operations

nlcpy.add

Computes the element-wise addition of the inputs.

nlcpy.subtract

Computes the element-wise subtraction of the inputs.

nlcpy.multiply

Computes the element-wise multiplication of the inputs.

nlcpy.divide

Computes the element-wise division of the inputs.

nlcpy.true_divide

Computes the element-wise division of the inputs.

nlcpy.floor_divide

Computes the element-wise floor division of the inputs.

nlcpy.negative

Computes numerical negative, element-wise.

nlcpy.positive

Computes numerical positive, element-wise.

nlcpy.power

Computes the element-wise exponentiation of the inputs.

nlcpy.remainder

Computes the element-wise remainder of division.

nlcpy.mod

Computes the element-wise remainder of division.

nlcpy.fmod

Computes the element-wise remainder of division.

nlcpy.absolute

Computes the element-wise absolute value.

nlcpy.reciprocal

Computes the element-wise reciprocal of the input.

Handling Complex Numbers

nlcpy.angle

Returns the angle of the complex argument.

nlcpy.real

Returns the real part of the complex argument.

nlcpy.imag

Returns the imaginary part of the complex argument.

nlcpy.conj

Returns the element-wise complex conjugate.

nlcpy.conjugate

Returns the element-wise complex conjugate.

Miscellaneous

nlcpy.clip

Clips (limits) the values in an array.

nlcpy.sqrt

Computes the element-wise square-root of the input.

nlcpy.cbrt

Computes the element-wise cubic-root of the input.

nlcpy.square

Computes the element-wise square of the input.

nlcpy.absolute

Computes the element-wise absolute value.

nlcpy.fabs

Computes the element-wise absolute value.

nlcpy.sign

Returns the element-wise indication of the sign of a number.

nlcpy.heaviside

Computes Heaviside step function.

nlcpy.maximum

Computes the element-wise maximum of the inputs.

nlcpy.minimum

Computes the element-wise minimum of the inputs.

nlcpy.fmax

Computes the element-wise maximum of the inputs.

nlcpy.fmin

Computes the element-wise minimum of the inputs.