기술 자료

Unity Engine

Unity Engine

magnitude

Returns the length of this vector (Read Only).
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public float magnitude { get; }

Remarks

The length of the vector is square root of
(x*x+y*y)
.
If you only need to compare magnitudes of some vectors, you can compare squared magnitudes of them using Vector2.sqrMagnitude (computing squared magnitudes is faster).
Additional Resources: Vector2.sqrMagnitude.