UKismetMathLibrary::DegTan
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPureUFUNCTION
Description
Returns the tangent of angle A where A is in degrees. Use this instead of FMath::Tan when your angle is already in degrees to avoid manually converting.
Caveats & Gotchas
- • Tangent is undefined at ±90 degrees and returns a very large (near-infinite) value — guard against those inputs if they can occur in your data.
- • Unlike the radian-based FMath::Tan, this function handles the degree-to-radian conversion internally, so passing a radian value will produce incorrect results.
Signature
static UE_INL_API double DegTan(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | Angle in degrees. | — |
Return Type
double Example
Compute slope from angle C++
float AngleDeg = 45.0f;
double Slope = UKismetMathLibrary::DegTan(AngleDeg); // returns ~1.0 Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?