Vector3D.Normalize Metodo

Definizione

Normalizza la struttura Vector3D specificata.

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

Esempio

Nell'esempio seguente viene illustrato come normalizzare una Vector3D struttura.

// 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)

Commenti

Un normalizzato Vector3D mantiene la sua direzione, ma la sua grandezza diventa 1. Il risultato Vector3D viene spesso chiamato vettore di unità. Un Vector3D oggetto viene normalizzato dividendo l'oggetto in base alla Vector3D sua grandezza.

Si applica a