tan
Keywords: tan, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## Name

> tan - returns tangent of scalars and vectors.

> ## Synopsis

>     float  tan(float a);
>     float1 tan(float1 a);
>     float2 tan(float2 a);
>     float3 tan(float3 a);
>     float4 tan(float4 a);

>     half   tan(half a);
>     half1  tan(half1 a);
>     half2  tan(half2 a);
>     half3  tan(half3 a);
>     half4  tan(half4 a);

>     fixed  tan(fixed a);
>     fixed1 tan(fixed1 a);
>     fixed2 tan(fixed2 a);
>     fixed3 tan(fixed3 a);
>     fixed4 tan(fixed4 a);

> ## Parameters

> a
>   Vector or scalar of which to determine the tangent.

> ## Description

> Returns the tangent of a in radians.

> For vectors, the returned vector contains the tangent of each element of the input vector.

> ## Reference Implementation

> tan can be implemented in terms of the sin and cos functions like this:

>     float tan(float a) {
>       float s, c;
>       sincos(a, s, c);
>       return s / c;
>     }

> ## Profile Support

> tan is fully supported in all profiles unless otherwise specified.

> tan is supported via approximations of sin and cos functions (see the respective sin and cos manual pages for details) in the vs_1_1, vp20, and arbvp1 profiles.

> tan is unsupported in the fp20, ps_1_1, ps_1_2, and ps_1_3 profiles.

> ## See Also

> atan, atan2, cos, dot, frac, sin, sincos