Vector.Normalize Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Normalizes this vector.
public:
void Normalize();
public void Normalize ();
member this.Normalize : unit -> unit
Public Sub Normalize ()
Examples
The following example shows how to use this method to normalize a vector.
private Vector normalizeExample()
{
Vector vectorResult = new Vector(20, 30);
// A normalized vector maintains its direction but
// its length becomes 1.
// vectorResult is approximately equal to (0.5547,0.8321).
vectorResult.Normalize();
return vectorResult;
}
Remarks
A normalized vector maintains its direction but its Length becomes 1. The resulting vector is often called a unit vector. A vector is normalized by dividing the vector by its own Length.
Applies to
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา