UKismetMathLibrary::RadiansToDegrees
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Converts an angle from radians to degrees by multiplying by 180/π. Use to convert results from Acos, Asin, Atan, or Atan2 into human-readable degrees.
Caveats & Gotchas
- • UE's FRotator stores angles in degrees — always convert radian results with this function (or FMath::RadiansToDegrees) before assigning to a rotator component.
- • The return type is double; assigning to a float UPROPERTY will narrow the value, which is fine for most UI display purposes but introduces small rounding errors in iterative calculations.
Signature
static UE_INL_API double RadiansToDegrees(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | Angle in radians to convert. | — |
Return Type
double Example
Display angle between two vectors in degrees C++
double Dot = FVector::DotProduct(ForwardA.GetSafeNormal(), ForwardB.GetSafeNormal());
double AngleRad = UKismetMathLibrary::Acos(FMath::Clamp(Dot, -1.0, 1.0));
double AngleDeg = UKismetMathLibrary::RadiansToDegrees(AngleRad);
UE_LOG(LogGame, Log, TEXT("Angle: %.2f degrees"), AngleDeg); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?