UKismetMathLibrary::DegSin
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the sine of A where A is in degrees. Handles the degree-to-radian conversion internally, making it safer than calling Sin directly with degree values.
Caveats & Gotchas
- • Slightly slower than Sin(DegreesToRadians(A)) due to the internal conversion, but negligible outside of tight inner loops — the real benefit is eliminating the common forgotten-conversion bug.
- • Blueprint surfaces this as 'Sin (Degrees)' with the compact node title 'SINd' — easy to confuse with the plain 'Sin' node which expects radians.
Signature
static UE_INL_API double DegSin(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | Angle in degrees. | — |
Return Type
double Example
Oscillate an actor vertically using a degree-based angle C++
// OscillationAngle advances in degrees each tick
OscillationAngle += 90.0 * DeltaTime;
float ZOffset = (float)(Amplitude * UKismetMathLibrary::DegSin(OscillationAngle));
SetActorLocation(BaseLocation + FVector(0, 0, ZOffset)); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?