Bagikan melalui


Vector3D.Normalize Metode

Definisi

Menormalkan struktur yang ditentukan Vector3D .

public:
 void Normalize();
public void Normalize ();
member this.Normalize : unit -> unit
Public Sub Normalize ()

Contoh

Contoh berikut menunjukkan cara menormalkan Vector3D struktur.

// Normalizes a Vector3D using the Normalize method.  
// Returns a Vector3D.

Vector3D vector1 = new Vector3D(20, 30, 40);

vector1.Normalize();
// vector1 is approximately equal to (0.37139, 0.55709, 0.74278)
' Normalizes a Vector3D using the Normalize method.  
' Returns a Vector3D.

Dim vector1 As New Vector3D(20, 30, 40)

vector1.Normalize()
' vector1 is approximately equal to (0.37139, 0.55709)

Keterangan

Yang dinormalisasi Vector3D mempertahankan arahnya tetapi besarannya menjadi 1. Hasilnya Vector3D sering disebut vektor unit. Vector3D A dinormalisasi dengan memba merupakan Vector3D besarannya.

Berlaku untuk