UKismetMathLibrary::Atan
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the inverse tangent (arc tangent) of A in radians, in the range (-π/2, π/2). For converting a 2D direction to an angle use Atan2 instead.
Caveats & Gotchas
- • Atan only handles a single ratio and cannot distinguish the full 360° range — use Atan2(Y, X) when you need a quadrant-aware angle from a 2D direction vector.
- • Result is in radians; use RadiansToDegrees to convert if your downstream code expects degrees.
Signature
static UE_INL_API double Atan(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | The value to compute the arc tangent of. | — |
Return Type
double Example
Angle from a slope ratio C++
double Rise = 1.0, Run = 1.0;
double AngleRad = UKismetMathLibrary::Atan(Rise / Run); // π/4 ≈ 0.785 rad
double AngleDeg = UKismetMathLibrary::RadiansToDegrees(AngleRad); // 45.0 Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?