Vector3D Vector3D Vector3D Vector3D Struct

Definição

Representa um deslocamento no espaço 3D.Represents a displacement in 3-D space.

public value class Vector3D : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Vector3DConverter))]
[System.Serializable]
public struct Vector3D : IFormattable
type Vector3D = struct
    interface IFormattable
Public Structure Vector3D
Implements IFormattable
Herança
Atributos
Implementações

Exemplos

Este Vector3D exemplo mostra como subtrair estruturas usando o operador de subtração sobrecarregado (-) e o Vector3D método Subtract estático.This example shows how to subtract Vector3D structures using the overloaded subtraction (-) operator and the Vector3D static Subtract method.

O código a seguir mostra como usar os Vector3D métodos de subtração.The following code shows how to use the Vector3D subtraction methods. Primeiro, as Vector3D estruturas são instanciadas.First, the Vector3D structures are instantiated. As Vector3D estruturas são subtraídas usando o operador sobrecarregado (-) e, em seguida, são subtraídas usando o Subtract método estático.The Vector3D structures are subtracted using the overloaded (-) operator, and then they are subtracted using the static Subtract method.

// Subtracts two 3-D Vectors using the Subtract method and -

// Declaring vector1 and initializing x,y,z values
Vector3D vector1 = new Vector3D(20, 30, 40);

// Declaring vector2 without initializing x,y,z values
Vector3D vector2 = new Vector3D();

// Assigning values to vector2
vector2.X = 45;
vector2.Y = 70;
vector2.Z = 80;

// Subtracting vectors using overload - operator
Vector3D vectorResult1 = new Vector3D();
vectorResult1 = vector1 - vector2;
// vectorResult1 is equal to (-25, -40, -40)

// Subtracting vectors using static Subtract method
Vector3D vectorResult2 = new Vector3D();
vectorResult2 = Vector3D.Subtract(vector1, vector2);
// vector2 is equal to (-25, -40, -40)

Comentários

Uso do Atributo XAMLXAML Attribute Usage

<object property="x,y,z"/>  
-or  
<object property="x y z"/>  

Valores XAMLXAML Values

xx
O X componenteVector3D desta estrutura.The X component of this Vector3D structure.

yy
O Y componenteVector3D desta estrutura.The Y component of this Vector3D structure.

zz
O Z componenteVector3D desta estrutura.The Z component of this Vector3D structure.

Construtores

Vector3D(Double, Double, Double) Vector3D(Double, Double, Double) Vector3D(Double, Double, Double) Vector3D(Double, Double, Double)

Inicializa uma nova instância de uma estrutura Vector3D.Initializes a new instance of a Vector3D structure.

Propriedades

Length Length Length Length

Obtém o tamanho desta estrutura Vector3D.Gets the length of this Vector3D structure.

LengthSquared LengthSquared LengthSquared LengthSquared

Obtém o quadrado do comprimento dessa estrutura Vector3D.Gets the square of the length of this Vector3D structure.

X X X X

Obtém ou define o componente X desta estrutura Vector3D.Gets or sets the X component of this Vector3D structure.

Y Y Y Y

Obtém ou define o componente Y desta estrutura Vector3D.Gets or sets the Y component of this Vector3D structure.

Z Z Z Z

Obtém ou define o componente Z desta estrutura Vector3D.Gets or sets the Z component of this Vector3D structure.

Métodos

Add(Vector3D, Point3D) Add(Vector3D, Point3D) Add(Vector3D, Point3D) Add(Vector3D, Point3D)

Converte a estrutura Point3D especificada segundo a estrutura Vector3D especificada e retorna o resultado como um estrutura Point3D.Translates the specified Point3D structure by the specified Vector3D structure and returns the result as a Point3D structure.

Add(Vector3D, Vector3D) Add(Vector3D, Vector3D) Add(Vector3D, Vector3D) Add(Vector3D, Vector3D)

Adiciona duas estruturas Vector3D vetores e retorna o resultado como uma estrutura Vector3D.Adds two Vector3D structures and returns the result as a Vector3D structure.

AngleBetween(Vector3D, Vector3D) AngleBetween(Vector3D, Vector3D) AngleBetween(Vector3D, Vector3D) AngleBetween(Vector3D, Vector3D)

Recupera o ângulo necessário para girar a primeira estrutura Vector3D especificada na segunda estrutura Vector3D especificada.Retrieves the angle required to rotate the first specified Vector3D structure into the second specified Vector3D structure.

CrossProduct(Vector3D, Vector3D) CrossProduct(Vector3D, Vector3D) CrossProduct(Vector3D, Vector3D) CrossProduct(Vector3D, Vector3D)

Calcula o produto cruzado de duas estruturas Vector3D.Calculates the cross product of two Vector3D structures.

Divide(Vector3D, Double) Divide(Vector3D, Double) Divide(Vector3D, Double) Divide(Vector3D, Double)

Divide a estrutura Vector3D especificada pelo escalar especificado e retorna o resultado como um Vector3D.Divides the specified Vector3D structure by the specified scalar and returns the result as a Vector3D.

DotProduct(Vector3D, Vector3D) DotProduct(Vector3D, Vector3D) DotProduct(Vector3D, Vector3D) DotProduct(Vector3D, Vector3D)

Calcula o produto escalar de duas estruturas Vector3D.Calculates the dot product of two Vector3D structures.

Equals(Vector3D, Vector3D) Equals(Vector3D, Vector3D) Equals(Vector3D, Vector3D) Equals(Vector3D, Vector3D)

Compara a igualdade de duas estruturas Vector3D.Compares two Vector3D structures for equality.

Equals(Vector3D) Equals(Vector3D) Equals(Vector3D) Equals(Vector3D)

Compara a igualdade de duas estruturas Vector3D.Compares two Vector3D structures for equality.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina se o objeto especificado é uma estrutura Vector3D e se as propriedades X, Y e Z do Object especificado são iguais às propriedades X, Y e Z desta estrutura Vector3D.Determines whether the specified object is a Vector3D structure and whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Vector3D structure.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Obtém o código hash desta estrutura Vector3D.Gets a hash code for this Vector3D structure.

Multiply(Double, Vector3D) Multiply(Double, Vector3D) Multiply(Double, Vector3D) Multiply(Double, Vector3D)

Multiplica o escalar especificado pela estrutura Vector3D especificada e retorna o resultado como Vector3D.Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D.

Multiply(Vector3D, Double) Multiply(Vector3D, Double) Multiply(Vector3D, Double) Multiply(Vector3D, Double)

Multiplica a estrutura Vector3D especificada pelo escalar especificado e retorna o resultado como um Vector3D.Multiplies the specified Vector3D structure by the specified scalar and returns the result as a Vector3D.

Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D)

Transforma o espaço de coordenadas da estrutura Vector3D especificada usando a estrutura Matrix3D especificada.Transforms the coordinate space of the specified Vector3D structure using the specified Matrix3D structure.

Negate() Negate() Negate() Negate()

Nega uma estrutura Vector3D.Negates a Vector3D structure.

Normalize() Normalize() Normalize() Normalize()

Normaliza a estrutura Vector3D especificada.Normalizes the specified Vector3D structure.

Parse(String) Parse(String) Parse(String) Parse(String)

Converte uma representação de String de um vetor 3D3-D na estrutura Vector3D equivalente.Converts a String representation of a 3D3-D vector into the equivalent Vector3D structure.

Subtract(Vector3D, Point3D) Subtract(Vector3D, Point3D) Subtract(Vector3D, Point3D) Subtract(Vector3D, Point3D)

Subtrai uma estrutura Point3D de uma estrutura Vector3D.Subtracts a Point3D structure from a Vector3D structure.

Subtract(Vector3D, Vector3D) Subtract(Vector3D, Vector3D) Subtract(Vector3D, Vector3D) Subtract(Vector3D, Vector3D)

Subtrai uma estrutura Vector3D de uma estrutura Vector3D.Subtracts a Vector3D structure from a Vector3D structure.

ToString() ToString() ToString() ToString()

Cria uma representação String desta estrutura Vector3D.Creates a String representation of this Vector3D structure.

ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider)

Cria uma representação String desta estrutura Vector3D.Creates a String representation of this Vector3D structure.

Operadores

Addition(Vector3D, Vector3D) Addition(Vector3D, Vector3D) Addition(Vector3D, Vector3D) Addition(Vector3D, Vector3D)

Adiciona duas estruturas Vector3D vetores e retorna o resultado como uma estrutura Vector3D.Adds two Vector3D structures and returns the result as a Vector3D structure.

Addition(Vector3D, Point3D) Addition(Vector3D, Point3D) Addition(Vector3D, Point3D) Addition(Vector3D, Point3D)

Converte a estrutura Point3D especificada segundo a estrutura Vector3D especificada e retorna o resultado como um estrutura Point3D.Translates the specified Point3D structure by the specified Vector3D structure and returns the result as a Point3D structure.

Division(Vector3D, Double) Division(Vector3D, Double) Division(Vector3D, Double) Division(Vector3D, Double)

Divide a estrutura Vector3D especificada pelo escalar especificado e retorna o resultado como um Vector3D.Divides the specified Vector3D structure by the specified scalar and returns the result as a Vector3D.

Equality(Vector3D, Vector3D) Equality(Vector3D, Vector3D) Equality(Vector3D, Vector3D) Equality(Vector3D, Vector3D)

Compara a igualdade de duas estruturas Vector3D.Compares two Vector3D structures for equality.

Explicit(Vector3D to Point3D) Explicit(Vector3D to Point3D) Explicit(Vector3D to Point3D) Explicit(Vector3D to Point3D)

Converte uma estrutura Vector3D em uma estrutura Point3D.Converts a Vector3D structure into a Point3D structure.

Explicit(Vector3D to Size3D) Explicit(Vector3D to Size3D) Explicit(Vector3D to Size3D) Explicit(Vector3D to Size3D)

Converte um Vector3D estrutura em um Size3D.Converts a Vector3D structure into a Size3D.

Inequality(Vector3D, Vector3D) Inequality(Vector3D, Vector3D) Inequality(Vector3D, Vector3D) Inequality(Vector3D, Vector3D)

Compara a desigualdade de duas estruturas Vector3D.Compares two Vector3D structures for inequality.

Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D)

Transforma o espaço de coordenadas da estrutura Vector3D especificada usando a estrutura Matrix3D especificada.Transforms the coordinate space of the specified Vector3D structure using the specified Matrix3D structure.

Multiply(Double, Vector3D) Multiply(Double, Vector3D) Multiply(Double, Vector3D) Multiply(Double, Vector3D)

Multiplica o escalar especificado pela estrutura Vector3D especificada e retorna o resultado como Vector3D.Multiplies the specified scalar by the specified Vector3D structure and returns the result as a Vector3D.

Multiply(Vector3D, Double) Multiply(Vector3D, Double) Multiply(Vector3D, Double) Multiply(Vector3D, Double)

Multiplica a estrutura Vector3D especificada pelo escalar especificado e retorna o resultado como um Vector3D.Multiplies the specified Vector3D structure by the specified scalar and returns the result as a Vector3D.

Subtraction(Vector3D, Vector3D) Subtraction(Vector3D, Vector3D) Subtraction(Vector3D, Vector3D) Subtraction(Vector3D, Vector3D)

Subtrai uma estrutura Vector3D de uma estrutura Vector3D.Subtracts a Vector3D structure from a Vector3D structure.

Subtraction(Vector3D, Point3D) Subtraction(Vector3D, Point3D) Subtraction(Vector3D, Point3D) Subtraction(Vector3D, Point3D)

Subtrai uma estrutura Point3D de uma estrutura Vector3D.Subtracts a Point3D structure from a Vector3D structure.

UnaryNegation(Vector3D) UnaryNegation(Vector3D) UnaryNegation(Vector3D) UnaryNegation(Vector3D)

Nega uma estrutura Vector3D.Negates a Vector3D structure.

Implantações explícitas de interface

IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider)

Esse membro faz parte da infraestrutura Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) e não se destina a ser usado diretamente pelo seu código.This member is part of the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly by your code. Para obter uma descrição desse membro, consulte ToString(String, IFormatProvider).For a description of this member, see ToString(String, IFormatProvider).

Aplica-se a