Idioma

Vector3D.Negate Método

Definição

Anula uma Vector3D estrutura.

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

Exemplos

O exemplo seguinte mostra como negar uma Vector3D estrutura.

// Negates a Vector3D using the Negate method.

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

vector1.Negate();
// vector1 is equal to (-20, -30, -40)
' Negates a Vector3D using the Negate method.

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

vector1.Negate()
' vector1 is equal to (-20, -30, -40)

Observações

O vetor tem a mesma magnitude de antes, mas a sua direção é agora oposta.

Aplica-se a

Consulte também