Skip to content

Instantly share code, notes, and snippets.

@posaunehm
Created January 23, 2012 05:39
Show Gist options
  • Save posaunehm/1660918 to your computer and use it in GitHub Desktop.
Save posaunehm/1660918 to your computer and use it in GitHub Desktop.
Vector Helper Extention Method
static readonly Vector ANGLE_BASE_VECTOR = new Vector(1, 0);
/// <summary>
/// ベクトルの角度をDegreeで返します
/// </summary>
/// <param name="vector">ベクトル</param>
/// <returns>角度(Degree値)</returns>
public static double GetAngle(this Vector vector)
{
return Vector.AngleBetween(ANGLE_BASE_VECTOR, vector);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment