Skip to content

Latest commit

 

History

History
100 lines (50 loc) · 3.01 KB

dx-graphics-hlsl-atan2.md

File metadata and controls

100 lines (50 loc) · 3.01 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
atan2 (Corecrt\_math.h)
Returns the arctangent of two values (x,y).
e7b53751-f321-4390-8f8f-ec1fa3aaa798
atan2 HLSL
apiref
atan2
corecrt_math.h
HeaderDef
reference
05/31/2018

atan2

Returns the arctangent of two values (x,y).

ret atan2(y, x)

Parameters

Item Description
y
[in] The y value.
x
[in] The x value.

Return Value

The arctangent of (y,x).

Remarks

The signs of the x and y parameters are used to determine the quadrant of the return values within the range of -π to π. The atan2 HLSL intrinsic function is well-defined for every point other than the origin, even if y equals 0 and x does not equal 0.

Type Description

Name Template Type Component Type Size
y same as input x float same dimension(s) as input x
x scalar, vector, or matrix float any
ret same as input x float same dimension(s) as input x

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 2 (DirectX HLSL) and higher shader models yes
Shader Model 1 (DirectX HLSL) vs_1_1

Requirements

Requirement Value
Header
Corecrt_math.h

See also

Intrinsic Functions (DirectX HLSL)