Class DOMPoint
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
A DOMPoint object represents a 2D or 3D point in a coordinate system; it includes values for the coordinates in up to three dimensions, as well as an optional perspective value. DOMPoint is based on DOMPointReadOnly but allows its properties' values to be changed.
[Value("DOMPoint")]
public class DOMPoint : DOMPointReadOnly
- Inheritance
-
DOMPoint
- Inherited Members
Remarks
In general, a positive x component represents a position to the right of the origin, a positive y component is downward from the origin, and a positive z component extends outward from the screen (in other words, toward the user).
Constructors
DOMPoint()
public DOMPoint()
DOMPoint(double, double, double, double)
The DOMPoint() constructor
creates and returns a new DOMPoint object, given the values for some or
all of its properties.
public DOMPoint(double x = 0, double y = 0, double z = 0, double w = 0)
Parameters
Remarks
You can also create a DOMPoint by calling the
FromPoint(DOMPointInit) static function. That function accepts any object with the required parameters, including a DOMPoint or
DOMPointReadOnly.
-DOMPointReadOnly(double, double, double, double)
-DOMRect
-DOMMatrix
Properties
W
The DOMPoint interface'sw property holds the point's perspective value, w, for a
point in space.
[Value("w")]
public double W { get; set; }
Property Value
- double
A double-precision floating-point value indicating the w perspective value for
the point. This value is unrestricted, meaning that it is allowed to be
infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).
The default is 1.0.
Remarks
X
The DOMPoint interface'sx property holds the horizontal coordinate, x, for a
point in space.
[Value("x")]
public double X { get; set; }
Property Value
- double
A double-precision floating-point value indicating the x coordinate's value for the
point. This value is unrestricted, meaning that it is allowed to be
infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).
Remarks
In general, positive values x mean to the right,
and negative values of x means to the left, barring any transforms that may
have altered the orientation of the axes.
-The other coordinate properties: Y,
Z, and the perspective value, W.
Y
The DOMPoint interface'sy property holds the vertical coordinate, y,
for a point in space.
[Value("y")]
public double Y { get; set; }
Property Value
- double
A double-precision floating-point value indicating the y coordinate's value
for the point. This value is unrestricted, meaning that it is allowed
to be infinite or invalid (that is, its value may be GlobalObject.NaN or
GlobalObject.Infinity).
Remarks
Unless transforms have been applied to alter the
orientation, the value of y increases downward and decreases upward.
-The other coordinate properties: X,
Z, and the perspective value, W.
Z
The DOMPoint interface'sz property specifies the depth coordinate of a point in
space.
[Value("z")]
public double Z { get; set; }
Property Value
- double
A double-precision floating-point value indicating the z coordinate's value
for the point. This value is unrestricted, meaning that it is allowed
to be infinite or invalid (that is, its value may be GlobalObject.NaN or
GlobalObject.Infinity).
Remarks
Unless transforms have changed the orientation, a z of 0 is
the plane of the screen, with positive values extending outward toward the user from the
screen, and negative values receding into the distance behind the screen.
-The other coordinate properties: X,
Y, and the perspective value, W.
Methods
FromPoint(DOMPointInit)
The fromPoint() static method of the DOMPoint interface creates and returns a new mutable DOMPoint object given a source point.
[Value("fromPoint")]
public static DOMPoint FromPoint(DOMPointInit other = null)
Parameters
otherDOMPointInit
Returns
- DOMPoint
A new DOMPoint object whose coordinate and perspective values are
identical to those in the source point. The point's properties are mutable and may be
changed at any time.
Remarks
You can also create a new DOMPoint object using the
DOMPoint(double, double, double, double) constructor.
Although this interface is based on DOMPointReadOnly, it is not read-only;
the properties within may be changed at will.