The Lab
MISC native

ATAN2

returns float2 paramsbuild 1207

Returns the arc tangent of p0 / p1 using the signs of both to pick the quadrant, in degrees.

Signature

C
float ATAN2(float p0, float p1); // 0x965B220A066E3F07 b1207

Parameters

#NameType
1p0float
2p1float

Facts

Facts about ATAN2
Name
ATAN2
Hash
0x965B220A066E3F07
Namespace
Returns
float
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result = Citizen.InvokeNative(0x965B220A066E3F07, -- ATAN2
  0.0, -- float p0
  0.0, -- float p1
  Citizen.ResultAsFloat()
)
print(result)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const result = Citizen.invokeNative("0x965B220A066E3F07", // ATAN2
  0.0, // float p0
  0.0, // float p1
  Citizen.resultAsFloat()
);
console.log(result)
C#
float result = Function.Call<float>((Hash)0x965B220A066E3F07, // ATAN2
  0.0f, // float p0
  0.0f // float p1
);
All MISC natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.