Point3D Point3D Point3D Point3D Struct

Definizione

Rappresenta un punto di coordinata x-, y- e z nello spazio 3D.Represents an x-, y-, and z-coordinate point in 3-D space.

public value class Point3D : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Point3DConverter))]
[System.Serializable]
public struct Point3D : IFormattable
type Point3D = struct
    interface IFormattable
Public Structure Point3D
Implements IFormattable
Ereditarietà
Attributi
Implementazioni

Esempi

Questo esempio illustra come sottrarre Point3D strutture e Vector3D strutture usando l'operatore di sottrazione (-) di overload e il Point3D metodo Subtract statico.This example shows how to subtract Point3D structures and Vector3D structures using the overloaded subtraction (-) operator and the Point3D static Subtract method.

Il codice seguente illustra come usare i Point3D metodi di sottrazione.The following code illustrates how to use the Point3D subtraction methods. Viene innanzitutto creata Point3D un'istanza delle Vector3D strutture e delle strutture.First, the Point3D structures and the Vector3D structures are instantiated. Le Point3D strutture vengono sottratte usando l'operatore di sottrazione di overload-() e quindi vengono sottratte usando il metodo statico Subtract .The Point3D structures are subtracted using the overloaded subtraction (-) operator and then they are subtracted using the static Subtract method. Successivamente, la Vector3D struttura viene sottratta dalla prima Point3D struttura usando il metodo statico Subtract Vector3D e infine la Point3D struttura viene sottratta da usando la sottrazione di overload (-operatore).Next, the Vector3D structure is subtracted from the first Point3D structure using the static Subtract method, and finally the Point3D structure is subtract from the Vector3D using the overloaded subtraction (-) operator.

// instantiate variables
Point3D point1 = new Point3D();
Point3D point2 = new Point3D(15, 40, 60);
Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D pointResult1 = new Point3D();
Point3D pointResult2 = new Point3D();
Vector3D vectorResult1 = new Vector3D();
Vector3D vectorResult2 = new Vector3D();

// defining x,y,z of point1
point1.X = 10;
point1.Y = 5;
point1.Z = 1;

vectorResult1 = Point3D.Subtract(point1, point2);
// vectorResult1 is equal to (-5, -35, -59)

vectorResult2 = point2 - point1;
// vectorResult2 is equal to (5, 35, 59)

pointResult1 = Point3D.Subtract(point1, vector1);
//  pointResult1 is equal to (-10, -25, -39)

pointResult2 = vector1 - point1;
//  pointResult2 is equal to (10, 25, 39)

Commenti

In XAML, il delimitatore tra i valori di un Point3D oggetto può essere una virgola o uno spazio.In XAML, the delimiter between the values of a Point3D can be either a comma or a space.

Alcune impostazioni cultura potrebbero utilizzare il carattere virgola come delimitatore decimale anziché il carattere punto.Some cultures might use the comma character as the decimal delimiter instead of the period character. Per impostazione predefinita, l'elaborazione XAML per impostazioni cultura invarianti è en-US nella maggior parte delle implementazioni del processore XAML e prevede che il periodo sia il delimitatore decimale.XAML processing for invariant culture defaults to en-US in most XAML processor implementations, and expects the period to be the decimal delimiter. È consigliabile evitare di usare il carattere virgola come delimitatore decimale Point3D se si specifica un oggetto in XAML, perché questo si scontra con la Point3D conversione del tipo di stringa di un valore di attributo nei relativi componenti.You should avoid using the comma character as the decimal delimiter if specifying a Point3D in XAML, because that will clash with the string type conversion of a Point3D attribute value into its components.

Uso della sintassi XAML per gli attributiXAML Attribute Usage

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

Valori XAMLXAML Values

xx
Coordinata x della struttura Point3D.The x-coordinate of this Point3D.

yy
Coordinata y della struttura Point3D.The y-coordinate of this Point3D.

zz
Coordinata z dell' Point3Doggetto.The z-coordinate of this Point3D.

Costruttori

Point3D(Double, Double, Double) Point3D(Double, Double, Double) Point3D(Double, Double, Double) Point3D(Double, Double, Double)

Inizializza una nuova istanza della struttura Point3D.Initializes a new instance of the Point3D structure.

Proprietà

X X X X

Ottiene o imposta la coordinata x della struttura Point3D corrente.Gets or sets the x-coordinate of this Point3D structure.

Y Y Y Y

Ottiene o imposta la coordinata y della struttura Point3D corrente.Gets or sets the y-coordinate of this Point3D structure.

Z Z Z Z

Ottiene o imposta la coordinata z della struttura Point3D corrente.Gets or sets the z-coordinate of this Point3D structure.

Metodi

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

Somma una struttura a una Point3D struttura Vector3D e restituisce il risultato sotto forma di struttura Point3D.Adds a Point3D structure to a Vector3D and returns the result as a Point3D structure.

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

Determina se l'oggetto specificato è una Point3D struttura e se lo è, se X, Y e Z le proprietà dell'oggetto specificato Object sono uguali a X, Y e Z alle proprietà di questa struttura Point3D.Determines whether the specified object is a Point3D structure and if so, whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Point3D structure.

Equals(Point3D) Equals(Point3D) Equals(Point3D) Equals(Point3D)

Confronta due strutture Point3D per determinare se sono uguali.Compares two Point3D structures for equality.

Equals(Point3D, Point3D) Equals(Point3D, Point3D) Equals(Point3D, Point3D) Equals(Point3D, Point3D)

Confronta due strutture Point3D per determinare se sono uguali.Compares two Point3D structures for equality.

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

Restituisce un codice hash per questa struttura Point3D.Returns a hash code for this Point3D structure.

Multiply(Point3D, Matrix3D) Multiply(Point3D, Matrix3D) Multiply(Point3D, Matrix3D) Multiply(Point3D, Matrix3D)

Trasforma la struttura Point3D specificata in base alla struttura Matrix3D definita.Transforms the specified Point3D structure by the specified Matrix3D structure.

Offset(Double, Double, Double) Offset(Double, Double, Double) Offset(Double, Double, Double) Offset(Double, Double, Double)

Traduce la struttura Point3D in base al valore specificato.Translates the Point3D structure by the specified amounts.

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

Converte una rappresentazione String di un punto tridimensionale nella struttura Point3D equivalente.Converts a String representation of a 3-D point into the equivalent Point3D structure.

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

Sottrae una struttura Point3D da una struttura Point3D e restituisce il risultato sotto forma di struttura Vector3D.Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

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

Sottrae una struttura Vector3D da una struttura Point3D e restituisce il risultato sotto forma di struttura Point3D.Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

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

Crea una rappresentazione String di questa struttura Point3D.Creates a String representation of this Point3D structure.

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

Crea una rappresentazione String di questa struttura Point3D.Creates a String representation of this Point3D structure.

Operatori

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

Somma una struttura a una Point3D struttura Vector3D e restituisce il risultato sotto forma di struttura Point3D.Adds a Point3D structure to a Vector3D and returns the result as a Point3D structure.

Equality(Point3D, Point3D) Equality(Point3D, Point3D) Equality(Point3D, Point3D) Equality(Point3D, Point3D)

Confronta due strutture Point3D per determinare se sono uguali.Compares two Point3D structures for equality.

Explicit(Point3D to Point4D) Explicit(Point3D to Point4D) Explicit(Point3D to Point4D) Explicit(Point3D to Point4D)

Converte una struttura Point3D in una struttura Point4D.Converts a Point3D structure into a Point4D structure.

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

Converte una struttura Point3D in una struttura Vector3D.Converts a Point3D structure into a Vector3D structure.

Inequality(Point3D, Point3D) Inequality(Point3D, Point3D) Inequality(Point3D, Point3D) Inequality(Point3D, Point3D)

Confronta le due strutture Point3D per stabilirne la disuguaglianza.Compares two Point3D structures for inequality.

Multiply(Point3D, Matrix3D) Multiply(Point3D, Matrix3D) Multiply(Point3D, Matrix3D) Multiply(Point3D, Matrix3D)

Trasforma la struttura Point3D specificata in base alla struttura Matrix3D definita.Transforms the specified Point3D structure by the specified Matrix3D structure.

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

Sottrae una struttura Point3D da una struttura Point3D e restituisce il risultato sotto forma di struttura Vector3D.Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

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

Sottrae una struttura Vector3D da una struttura Point3D e restituisce il risultato sotto forma di struttura Point3D.Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

Implementazioni dell'interfaccia esplicita

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

Questo membro supporta l'infrastruttura di Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) e non deve essere usato direttamente dal codice.This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. Per una descrizione di questo membro, vedere ToString(String, IFormatProvider).For a description of this member, see ToString(String, IFormatProvider).

Si applica a