UKismetMathLibrary::Asin
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the inverse sine (arcsine) of A in radians. The result is in the range [-PI/2, PI/2].
Caveats & Gotchas
- • If A is outside [-1, 1], the result is NaN per IEEE 754 — the engine does not clamp or assert. Always validate the input if it comes from a calculation that might slightly exceed 1.0 due to floating-point error (e.g., dot products of nearly-parallel unit vectors).
- • The result is in radians in the range [-PI/2, PI/2] (i.e., [-90°, 90°]) — it cannot recover angles outside that range because sine is not injective outside it. Use Atan2 if you need a full 360° inverse.
Signature
static UE_INL_API double Asin(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | The sine value, must be in the range [-1, 1]. | — |
Return Type
double Example
Recover a launch angle from a known vertical-to-speed ratio C++
double VerticalSpeed = LaunchVelocity.Z;
double TotalSpeed = LaunchVelocity.Size();
if (TotalSpeed > KINDA_SMALL_NUMBER)
{
double SinAngle = FMath::Clamp(VerticalSpeed / TotalSpeed, -1.0, 1.0);
double AngleRadians = UKismetMathLibrary::Asin(SinAngle);
double AngleDegrees = FMath::RadiansToDegrees(AngleRadians);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?