Point3D Structure

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

Namespace: System.Windows.Media.Media3D
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public struct Point3D : IFormattable
/** @attribute SerializableAttribute() */ 
/** @attribute TypeConverterAttribute(System.Windows.Media.Media3D.Point3DConverter) */ 
public final class Point3D extends ValueType implements IFormattable
<object property="x,y,z"/>
 x   System.Double  The x-coordinate of this Point3D.  y   System.Double  The y-coordinate of this Point3D.  z   System.Double  The z-coordinate of this Point3D. 

This example shows how to subtract Point3D structures and Vector3D structures using the overloaded - 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 - 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 - 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)

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions