Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Atan2(float, float)

Calculate the arc-tangent i.e. the angle of the provided slope y/x. This operates as deterministically as possible across platforms.
Read time 1 minuteLast updated 7 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public static float Atan2(float y, float x)

Parameters

The Y axis.

The X axis.

Returns

Type

Description

floatThe angle in radians.