# usencrypt.tan#

usencrypt.tan(x, debug=False)#

Computes the tangent of $$x$$ using the definition $$\tan{x} = \frac{\sin{x}}{\cos{x}}$$.

Parameters

x (usencrypt.cipher.Float or float) – The input value.

Returns

The tangent of x.

Return type

usencrypt.cipher.Float

Note

This function is dependent on the general form of sine and cosine, both of which use the series expansion method of approximation. Cosine uses 12 iterations, while sine uses 14 iterations.

Warning

See the warnings for usencrypt.cos(). Both cosine and sine are dependent on usencrypt.cos(), which currently only converges for a small range of values.

Examples
>>> import usencrypt as ue
>>> a = ue.encrypt(0.75)
>>> a_tan = ue.tan(a)
>>> a_tan
(0x7f843af52c10) Float: 0x5c9d5ebbfbdca5b21779de629d52da2a62db841dc4245371c80051fa563db122
>>> ue.decrypt(a_tan)
0.9315964637789875