Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#

Mathf.Atan2

public static float Atan2(float y, float x);

Description

Returns the angle in radians whose Tan is y/x.

Return value is the angle between the x-axis and a 2D vector starting at zero and terminating at (x,y).

Note: This function takes account of the cases where x is zero and returns the correct angle rather than throwing a division by zero exception.

no example available in C#

Did you find this page useful? Please give it a rating: