The Lab
MISC native

GET_ANGLE_BETWEEN_2D_VECTORS

returns float4 paramsbuild 1207

Returns the angle, in degrees, between the 2D vectors (x1, y1) and (x2, y2).

Signature

C
float GET_ANGLE_BETWEEN_2D_VECTORS(float x1, float y1, float x2, float y2); // 0xD0DFE1C486097BBB b1207

Parameters

#NameType
1x1float
2y1float
3x2float
4y2float

Facts

Facts about GET_ANGLE_BETWEEN_2D_VECTORS
Name
GET_ANGLE_BETWEEN_2D_VECTORS
Hash
0xD0DFE1C486097BBB
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(0xD0DFE1C486097BBB, -- GET_ANGLE_BETWEEN_2D_VECTORS
  0.0, -- float x1
  0.0, -- float y1
  0.0, -- float x2
  0.0, -- float y2
  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("0xD0DFE1C486097BBB", // GET_ANGLE_BETWEEN_2D_VECTORS
  0.0, // float x1
  0.0, // float y1
  0.0, // float x2
  0.0, // float y2
  Citizen.resultAsFloat()
);
console.log(result)
C#
float result = Function.Call<float>((Hash)0xD0DFE1C486097BBB, // GET_ANGLE_BETWEEN_2D_VECTORS
  0.0f, // float x1
  0.0f, // float y1
  0.0f, // float x2
  0.0f // float y2
);
All MISC natives

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