# usencrypt.sin#

usencrypt.sin(x, n=14, debug=False)#

Computes the sine of $$x$$ using the cosine series approximation method.

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

• n (int) – The number of iterations for the cosine series approximation. Defaults to 14.

Returns

The sine of x.

Return type

usencrypt.cipher.Float

Note

As $$\sin(x)$$ is equivalent to $$\cos(\frac{x − \pi}{2})$$, this function simply uses the cosine series with an altered parameter.

Warning

• Our current implementation of $$\sin$$ is dependent on the cosine series, and as such faces the same issues.

• Some slight loss of precision occurs from the initial subtraction, so a slightly higher degree $$n$$ is used for the cosine polynomial to account for it.

>>> import usencrypt as ue