New to Telerik UI for WinForms? Start a free 30-day trial

Point3D

Class

Represents a mutable three-dimensional coordinate used by carousel paths. The path implementation interprets the coordinates; for example, it uses X and Y for position and may use Z for scaling, stacking order, or opacity.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
[TypeConverter(typeof(Point3DConverter))]
public class Point3D

Inheritance: objectPoint3D

Constructors

Initializes a point at the origin.

C#
public Point3D()

Initializes a point with the specified three coordinates.

C#
public Point3D(double x, double y, double z)
Parameters:xdouble

The horizontal coordinate.

ydouble

The vertical coordinate.

zdouble

The depth or path-specific coordinate.

Initializes a point with the specified horizontal and vertical coordinates and a zero Z coordinate.

C#
public Point3D(double x, double y)
Parameters:xdouble

The horizontal coordinate.

ydouble

The vertical coordinate.

Creates a point from the two-dimensional coordinates, setting Z to zero.

C#
public Point3D(Point pt)
Parameters:ptPoint

The source point.

Creates an independent copy of another point.

C#
public Point3D(Point3D pt)
Parameters:ptPoint3D

The point whose coordinates are copied.

Creates a point from the two-dimensional coordinates, setting Z to zero.

C#
public Point3D(PointF pt)
Parameters:ptPointF

The source point.

Fields

A shared mutable zero point used as the unset-point sentinel by carousel path APIs.

C#
public static Point3D Empty

Properties

Gets or sets the horizontal coordinate.

C#
public double X { get; set; }

Gets or sets the vertical coordinate.

C#
public double Y { get; set; }

Gets or sets the depth or path-specific coordinate used by carousel paths for effects such as scaling and stacking order.

C#
public double Z { get; set; }

Methods

Adds the specified coordinate offsets to this point.

C#
public void Add(double x, double y, double z)
Parameters:xdouble

The horizontal offset.

ydouble

The vertical offset.

zdouble

The Z-coordinate offset.

Adds another point's coordinates to this point.

C#
public void Add(Point3D pt)
Parameters:ptPoint3D

The coordinate offsets to add.

Calculates the vector cross product of two points.

C#
public static Point3D CrossProduct(Point3D vect1, Point3D vect2)
Parameters:vect1Point3D

The first vector.

vect2Point3D

The second vector.

Returns:

Point3D

A new point containing the cross-product coordinates.

Divides each coordinate by the specified coefficient without checking for zero.

C#
public void Divide(double coef)
Parameters:coefdouble

The divisor applied to each coordinate.

Calculates the scalar dot product of two points treated as vectors.

C#
public static double DotProduct(Point3D vect1, Point3D vect2)
Parameters:vect1Point3D

The first vector.

vect2Point3D

The second vector.

Returns:

double

The sum of the products of corresponding coordinates.

Determines whether the object is a point with equal X, Y, and Z coordinates.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare.

Returns:

bool

true when the object is this point or another Point3D with equal coordinates.

Overrides: object.Equals(object)

Combines the integer conversions of the coordinates with XOR; distinct points can produce the same hash code.

C#
public override int GetHashCode()
Returns:

int

A hash code derived from the three coordinates.

Overrides: object.GetHashCode()

Calculates the Euclidean magnitude of the three coordinates.

C#
public double Length()
Returns:

double

The square root of the sum of the squared coordinates.

Multiplies each coordinate by the specified coefficient.

C#
public void Multiply(double coef)
Parameters:coefdouble

The coefficient applied to each coordinate.

Negates each coordinate in place.

C#
public void Negate()

Scales this point so its magnitude is one. A zero-length point is divided by zero and produces non-finite coordinates.

C#
public void Normalize()

Subtracts the specified coordinate offsets from this point.

C#
public void Subtract(double x, double y, double z)
Parameters:xdouble

The horizontal offset to subtract.

ydouble

The vertical offset to subtract.

zdouble

The Z-coordinate offset to subtract.

Subtracts another point's coordinates from this point.

C#
public void Subtract(Point3D pt)
Parameters:ptPoint3D

The coordinates to subtract.

Creates a two-dimensional point from X and Y, rounding each coordinate to the nearest integer and discarding Z.

C#
public Point ToPoint()
Returns:

Point

The rounded X and Y coordinates as a Point.

Creates a two-dimensional point from X and Y, casting each coordinate to float and discarding Z.

C#
public PointF ToPointF()
Returns:

PointF

The X and Y coordinates as a PointF.

Operators

Converts the X and Y coordinates to a Point, discarding Z and rounding each coordinate.

C#
public static explicit operator Point(Point3D pt)
Parameters:ptPoint3D

The point to convert.

Returns:

Point

A two-dimensional point with rounded integer coordinates.

Converts the X and Y coordinates to a PointF, discarding Z.

C#
public static explicit operator PointF(Point3D pt)
Parameters:ptPoint3D

The point to convert.

Returns:

PointF

A two-dimensional point with coordinates cast to float.

Subtracts the second point from the first coordinate by coordinate without modifying either operand.

C#
public static Point3D operator -(Point3D pt1, Point3D pt2)
Parameters:pt1Point3D

The point from which to subtract.

pt2Point3D

The point to subtract.

Returns:

Point3D

A new point containing the differences.

Negates each coordinate without modifying the operand.

C#
public static Point3D operator -(Point3D pt)
Parameters:ptPoint3D

The point to negate.

Returns:

Point3D

A new point with negated coordinates.

Multiplies each coordinate by a coefficient without modifying the point.

C#
public static Point3D operator *(Point3D pt, float coef)
Parameters:ptPoint3D

The point to scale.

coeffloat

The coefficient applied to each coordinate.

Returns:

Point3D

A new scaled point.

Divides each coordinate by a coefficient without modifying the point.

C#
public static Point3D operator /(Point3D pt, float coef)
Parameters:ptPoint3D

The point to scale.

coeffloat

The divisor applied to each coordinate.

Returns:

Point3D

A new scaled point.

Adds two points coordinate by coordinate without modifying either operand.

C#
public static Point3D operator +(Point3D pt1, Point3D pt2)
Parameters:pt1Point3D

The first point.

pt2Point3D

The second point.

Returns:

Point3D

A new point containing the sums of the coordinates.