UKismetMathLibrary::DegreesToRadians
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Converts an angle from degrees to radians by multiplying by π/180. Use before passing degree values to radian-input functions like Cos, Sin, or Tan.
Caveats & Gotchas
- • Forgetting this conversion is the single most common mistake when using the radian-input trig functions (Cos, Sin, Tan, Atan2) — the results look plausible but are completely wrong for non-tiny angles.
- • In C++ the macro FMath::DegreesToRadians is available and inlines to the same multiplication; prefer it in performance-critical paths to avoid the Kismet function call overhead.
Signature
static UE_INL_API double DegreesToRadians(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | Angle in degrees to convert. | — |
Return Type
double Example
Convert designer-facing degree value before trig C++
// FieldOfViewDegrees is set in editor as a UPROPERTY
double HalfFOVRad = UKismetMathLibrary::DegreesToRadians(FieldOfViewDegrees * 0.5);
double HalfFOVTan = UKismetMathLibrary::Tan(HalfFOVRad); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?