Point3D Structure
TOC
Collapse the table of content
Expand the table of content

Point3D Structure

 

Represents an x-, y-, and z-coordinate point in 3-D space.

Namespace:   System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

<SerializableAttribute>
<TypeConverterAttribute(GetType(Point3DConverter))>
Public Structure Point3D
	Implements IFormattable

NameDescription
System_CAPS_pubmethodPoint3D(Double, Double, Double)

Initializes a new instance of the Point3D structure.

NameDescription
System_CAPS_pubpropertyX

Gets or sets the x-coordinate of this Point3D structure.

System_CAPS_pubpropertyY

Gets or sets the y-coordinate of this Point3D structure.

System_CAPS_pubpropertyZ

Gets or sets the z-coordinate of this Point3D structure.

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAdd(Point3D, Vector3D)

Adds a Point3D structure to a Vector3D and returns the result as a Point3D structure.

System_CAPS_pubmethodEquals(Object)

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. (Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodEquals(Point3D)

Compares two Point3D structures for equality.

System_CAPS_pubmethodSystem_CAPS_staticEquals(Point3D, Point3D)

Compares two Point3D structures for equality.

System_CAPS_pubmethodGetHashCode()

Returns a hash code for this Point3D structure. (Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticMultiply(Point3D, Matrix3D)

Transforms the specified Point3D structure by the specified Matrix3D structure.

System_CAPS_pubmethodOffset(Double, Double, Double)

Translates the Point3D structure by the specified amounts.

System_CAPS_pubmethodSystem_CAPS_staticParse(String)

Converts a String representation of a 3-D point into the equivalent Point3D structure.

System_CAPS_pubmethodSystem_CAPS_staticSubtract(Point3D, Point3D)

Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

System_CAPS_pubmethodSystem_CAPS_staticSubtract(Point3D, Vector3D)

Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

System_CAPS_pubmethodToString()

Creates a String representation of this Point3D structure. (Overrides ValueType.ToString().)

System_CAPS_pubmethodToString(IFormatProvider)

Creates a String representation of this Point3D structure.

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticAddition(Point3D, Vector3D)

Adds a Point3D structure to a Vector3D and returns the result as a Point3D structure.

System_CAPS_puboperatorSystem_CAPS_staticEquality(Point3D, Point3D)

Compares two Point3D structures for equality.

System_CAPS_puboperatorSystem_CAPS_staticNarrowing(Point3D to Point4D)

Converts a Point3D structure into a Point4D structure.

System_CAPS_puboperatorSystem_CAPS_staticNarrowing(Point3D to Vector3D)

Converts a Point3D structure into a Vector3D structure.

System_CAPS_puboperatorSystem_CAPS_staticInequality(Point3D, Point3D)

Compares two Point3D structures for inequality.

System_CAPS_puboperatorSystem_CAPS_staticMultiply(Point3D, Matrix3D)

Transforms the specified Point3D structure by the specified Matrix3D structure.

System_CAPS_puboperatorSystem_CAPS_staticSubtraction(Point3D, Point3D)

Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

System_CAPS_puboperatorSystem_CAPS_staticSubtraction(Point3D, Vector3D)

Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIFormattable.ToString(String, IFormatProvider)

This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. For a description of this member, see ToString.

In XAML, the delimiter between the values of a Point3D can be either a comma or a space.

Some cultures might use the comma character as the decimal delimiter instead of the period character. XAML processing for invariant culture defaults to en-US in most XAML processor implementations, and expects the period to be the decimal delimiter. 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.

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

x

The x-coordinate of this Point3D.

y

The y-coordinate of this Point3D.

z

The z-coordinate of this Point3D.

This example shows how to subtract Point3D structures and Vector3D structures using the overloaded subtraction (-) operator and the Point3D static Subtract method.

The following code illustrates how to use the Point3D subtraction methods. First, the Point3D structures and the Vector3D structures are instantiated. The Point3D structures are subtracted using the overloaded subtraction (-) operator and then they are subtracted using the static Subtract method. 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)

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft