Vector3DVector3DVector3DVector3D Struct

Definizione

Rappresenta uno spostamento nello spazio 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``````
Ereditarietà
Vector3DVector3DVector3DVector3D
Attributi
Implementazioni

Esempi

Questo esempio mostra come sottrarre Vector3D strutture utilizzando la sottrazione di overload (`-`) operatore e il Vector3D statico Subtract (metodo).This example shows how to subtract Vector3D structures using the overloaded subtraction (`-`) operator and the Vector3D static Subtract method.

Il codice seguente viene illustrato come utilizzare il Vector3D metodi sottrazione.The following code shows how to use the Vector3D subtraction methods. Prima di tutto la Vector3D strutture vengono create istanze.First, the Vector3D structures are instantiated. Il Vector3D strutture vengono sottratti usando l'overload (`-`) vengono sottratti operatore e quindi usando il metodo statico Subtract (metodo).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)
``````

Commenti

Uso della sintassi XAML per gli attributiXAML Attribute Usage

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

Valori XAMLXAML Values

xx
Componente X di questa struttura Vector3D.The X component of this Vector3D structure.

yy
Componente Y di questa struttura Vector3D.The Y component of this Vector3D structure.

zz
Componente Z di questa struttura Vector3D.The Z component of this Vector3D structure.

Costruttori

 Vector3D(Double, Double, Double) Vector3D(Double, Double, Double) Vector3D(Double, Double, Double) Vector3D(Double, Double, Double) Inizializza una nuova istanza di un Vector3D struttura.Initializes a new instance of a Vector3D structure.

Proprietà

 Length Length Length Length Ottiene la lunghezza di questa Vector3D struttura.Gets the length of this Vector3D structure. LengthSquared LengthSquared LengthSquared LengthSquared Ottiene il quadrato della lunghezza di questa Vector3D struttura.Gets the square of the length of this Vector3D structure. X X X X Ottiene o imposta il componente X di questa struttura Vector3D.Gets or sets the X component of this Vector3D structure. Y Y Y Y Ottiene o imposta il componente Y di questa struttura Vector3D.Gets or sets the Y component of this Vector3D structure. Z Z Z Z Ottiene o imposta il componente Z di questa struttura Vector3D.Gets or sets the Z component of this Vector3D structure.

Metodi

 Add(Vector3D, Point3D) Add(Vector3D, Point3D) Add(Vector3D, Point3D) Add(Vector3D, Point3D) Trasla la struttura Point3D struttura Vector3D strutturare e restituisce il risultato come un Point3D struttura.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) Aggiunge due Vector3D strutture e restituisce il risultato come un Vector3D struttura.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 l'angolo necessario per ruotare la prima struttura Vector3D specificata verso la seconda struttura Vector3D specificata.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) Calcola il prodotto incrociato di due Vector3D strutture.Calculates the cross product of two Vector3D structures. Divide(Vector3D, Double) Divide(Vector3D, Double) Divide(Vector3D, Double) Divide(Vector3D, Double) Divide l'oggetto specificato Vector3D struttura per lo scalare specificato e restituisce il risultato come un 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) Calcola il prodotto scalare di due Vector3D strutture.Calculates the dot product of two Vector3D structures. Equals(Vector3D, Vector3D) Equals(Vector3D, Vector3D) Equals(Vector3D, Vector3D) Equals(Vector3D, Vector3D) Confronta due Vector3D strutture per verificarne l'uguaglianza.Compares two Vector3D structures for equality. Equals(Vector3D) Equals(Vector3D) Equals(Vector3D) Equals(Vector3D) Confronta due Vector3D strutture per verificarne l'uguaglianza.Compares two Vector3D structures for equality. Equals(Object) Equals(Object) Equals(Object) Equals(Object) Determina se l'oggetto specificato è un Vector3D struttura e indica se il X, Y, e Z le proprietà dell'oggetto specificato Object sono uguali al X, Ye Zalle proprietà di questa Vector3D struttura.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() Ottiene un codice hash per questo Vector3D struttura.Gets a hash code for this Vector3D structure. Multiply(Double, Vector3D) Multiply(Double, Vector3D) Multiply(Double, Vector3D) Multiply(Double, Vector3D) Moltiplica lo scalare specificato per l'oggetto specificato Vector3D strutturare e restituisce il risultato come un 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) Moltiplica la struttura specificata Vector3D struttura per lo scalare specificato e restituisce il risultato come un 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) Trasforma lo spazio delle coordinate dell'oggetto specificato Vector3D struttura utilizzando l'oggetto specificato Matrix3D struttura.Transforms the coordinate space of the specified Vector3D structure using the specified Matrix3D structure. Negate() Negate() Negate() Negate() Nega un Vector3D struttura.Negates a Vector3D structure. Normalize() Normalize() Normalize() Normalize() Normalizza la struttura Vector3D specificata.Normalizes the specified Vector3D structure. Parse(String) Parse(String) Parse(String) Parse(String) Converte un String rappresentazione di un 3D3-D vettore equivalente Vector3D struttura.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) Sottrae un Point3D struttura da una Vector3D struttura.Subtracts a Point3D structure from a Vector3D structure. Subtract(Vector3D, Vector3D) Subtract(Vector3D, Vector3D) Subtract(Vector3D, Vector3D) Subtract(Vector3D, Vector3D) Sottrae un Vector3D struttura da una Vector3D struttura.Subtracts a Vector3D structure from a Vector3D structure. ToString() ToString() ToString() ToString() Crea una String rappresentazione di questo Vector3D struttura.Creates a String representation of this Vector3D structure. ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) Crea una String rappresentazione di questo Vector3D struttura.Creates a String representation of this Vector3D structure.

Operatori

 Addition(Vector3D, Vector3D) Addition(Vector3D, Vector3D) Addition(Vector3D, Vector3D) Addition(Vector3D, Vector3D) Aggiunge due Vector3D strutture e restituisce il risultato come un Vector3D struttura.Adds two Vector3D structures and returns the result as a Vector3D structure. Addition(Vector3D, Point3D) Addition(Vector3D, Point3D) Addition(Vector3D, Point3D) Addition(Vector3D, Point3D) Trasla la struttura Point3D struttura Vector3D strutturare e restituisce il risultato come un Point3D struttura.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 l'oggetto specificato Vector3D struttura per lo scalare specificato e restituisce il risultato come un 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) Confronta due Vector3D strutture per verificarne l'uguaglianza.Compares two Vector3D structures for equality. Explicit(Vector3D to Point3D) Explicit(Vector3D to Point3D) Explicit(Vector3D to Point3D) Explicit(Vector3D to Point3D) Converte un Vector3D struttura in un Point3D struttura.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 un Vector3D struttura in un Size3D.Converts a Vector3D structure into a Size3D. Inequality(Vector3D, Vector3D) Inequality(Vector3D, Vector3D) Inequality(Vector3D, Vector3D) Inequality(Vector3D, Vector3D) Confronta due Vector3D strutture per verificarne la disuguaglianza.Compares two Vector3D structures for inequality. Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D) Multiply(Vector3D, Matrix3D) Trasforma lo spazio delle coordinate dell'oggetto specificato Vector3D struttura utilizzando l'oggetto specificato Matrix3D struttura.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) Moltiplica lo scalare specificato per l'oggetto specificato Vector3D strutturare e restituisce il risultato come un 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) Moltiplica la struttura specificata Vector3D struttura per lo scalare specificato e restituisce il risultato come un 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) Sottrae un Vector3D struttura da una Vector3D struttura.Subtracts a Vector3D structure from a Vector3D structure. Subtraction(Vector3D, Point3D) Subtraction(Vector3D, Point3D) Subtraction(Vector3D, Point3D) Subtraction(Vector3D, Point3D) Sottrae un Point3D struttura da una Vector3D struttura.Subtracts a Point3D structure from a Vector3D structure. UnaryNegation(Vector3D) UnaryNegation(Vector3D) UnaryNegation(Vector3D) UnaryNegation(Vector3D) Nega un Vector3D struttura.Negates a Vector3D structure.

Implementazioni dell'interfaccia esplicita

 IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) Questo membro fa parte di Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastruttura e non può essere usato direttamente dal codice.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. Per una descrizione di questo membro, vedere ToString(String, IFormatProvider).For a description of this member, see ToString(String, IFormatProvider).