UKismetMathLibrary::Tan
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the tangent of the given angle in radians. Use DegTan if your angle is in degrees.
Caveats & Gotchas
- • Tan approaches ±infinity at odd multiples of π/2 (~1.5708 rad, ~90°). Passing such values produces very large or undefined results that can break physics or rendering code.
- • Like all radian-input trig functions, accidentally passing degrees is the most frequent mistake — verify units before calling.
Signature
static UE_INL_API double Tan(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | Angle in radians. | — |
Return Type
double Example
Compute slope ratio from an angle C++
double SlopeAngleRad = FMath::DegreesToRadians(30.0);
double Slope = UKismetMathLibrary::Tan(SlopeAngleRad); // ≈ 0.577 Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?