public class OMSVGPoint
extends com.google.gwt.core.client.JavaScriptObject
Many of the SVG DOM interfaces refer to objects of class OMSVGPoint
.
An OMSVGPoint
is an (x, y) coordinate pair.
When used in matrix operations, an OMSVGPoint
is treated as a vector of the form:
[x] [y] [1]
If an OMSVGRect
object is designated
as read only, then attempting to assign to one of its attributes
will result in an exception being thrown.
Modifier | Constructor and Description |
---|---|
protected |
OMSVGPoint() |
Modifier and Type | Method and Description |
---|---|
OMSVGPoint |
add(OMSVGPoint p)
Adds the specified point to this point.
|
OMSVGPoint |
add(OMSVGPoint p,
OMSVGPoint destination)
Adds the specified point to this point and puts the
result in the specified destination point.
|
OMSVGPoint |
assignTo(OMSVGPoint destination)
Copies this point to the specified destination point.
|
float |
crossProduct(OMSVGPoint p)
Returns the cross product of this point and the specified point.
|
float |
distance(OMSVGPoint p)
Returns the euclidian distance from this point to specified point.
|
float |
distance2(OMSVGPoint p)
Returns the squared euclidian distance from this point to specified point.
|
float |
dotProduct(OMSVGPoint p)
Returns the dot product of this point and the specified point.
|
OMSVGPoint |
floor()
Applies the
Math.floor() to the coordinated of this point. |
OMSVGPoint |
floor(OMSVGPoint destination)
Applies the
Math.floor() to the coordinated of this
point and puts the result in the specified destination point. |
String |
getDescription()
Returns a textual description of the point for debugging purposes.
|
float |
getX()
The x coordinate.
|
float |
getY()
The y coordinate.
|
float |
length()
Returns the length of this point, treating the point as a 2D vector.
|
float |
length2()
Returns the squared length of this point, treating the point as a 2D vector.
|
OMSVGPoint |
matrixTransform(OMSVGMatrix matrix)
Applies a 2x3 matrix transformation on this
OMSVGPoint
object and returns a new, transformed OMSVGPoint
object: |
OMSVGPoint |
product(OMSVGPoint p)
Multiplies this point by the specified point.
|
OMSVGPoint |
product(OMSVGPoint p,
OMSVGPoint destination)
Multiplies this point by the specified point and puts the
result in the specified destination point.
|
OMSVGPoint |
round()
Applies the
Math.round() to the coordinated of this point. |
OMSVGPoint |
round(OMSVGPoint destination)
Applies the
Math.round() to the coordinated of this
point and puts the result in the specified destination point. |
OMSVGPoint |
scale(float f)
Scales this point by the specified factor.
|
OMSVGPoint |
scale(float f,
OMSVGPoint destination)
Scales this point by the specified factor and puts the
result in the specified destination point.
|
void |
setX(float value)
The x coordinate.
|
void |
setY(float value)
The y coordinate.
|
OMSVGPoint |
substract(OMSVGPoint p)
Substracts the specified point from this point.
|
OMSVGPoint |
substract(OMSVGPoint p,
OMSVGPoint destination)
Substracts the specified point to this point and puts the
result in the specified destination point.
|
public final float getX()
public final void setX(float value) throws com.google.gwt.core.client.JavaScriptException
DOMException(NO_MODIFICATION_ALLOWED_ERR)
- Raised if the OMSVGPoint
object is read only, or corresponds
to a DOM attribute that is read only.com.google.gwt.core.client.JavaScriptException
public final float getY()
public final void setY(float value) throws com.google.gwt.core.client.JavaScriptException
DOMException(NO_MODIFICATION_ALLOWED_ERR)
- Raised if the OMSVGPoint
object is read only, or corresponds
to a DOM attribute that is read only.com.google.gwt.core.client.JavaScriptException
public final OMSVGPoint matrixTransform(OMSVGMatrix matrix)
Applies a 2x3 matrix transformation on this OMSVGPoint
object and returns a new, transformed OMSVGPoint
object:
newpoint = matrix thispoint
matrix
- The matrix which is to be applied to this OMSVGPoint
object.OMSVGPoint
object.public final String getDescription()
public final OMSVGPoint add(OMSVGPoint p)
p
- the point to add.public final OMSVGPoint add(OMSVGPoint p, OMSVGPoint destination)
p
- the point to add.destination
- the destination point.public final OMSVGPoint substract(OMSVGPoint p)
p
- the point to substract.public final OMSVGPoint substract(OMSVGPoint p, OMSVGPoint destination)
p
- the point to substract.destination
- the destination point.public final OMSVGPoint scale(float f)
f
- scale factor.public final OMSVGPoint scale(float f, OMSVGPoint destination)
f
- scale factor.destination
- the destination point.public final OMSVGPoint assignTo(OMSVGPoint destination)
destination
- the destination point.public final OMSVGPoint product(OMSVGPoint p)
p
- the point to multiply by.public final OMSVGPoint product(OMSVGPoint p, OMSVGPoint destination)
p
- the point to multiply by.destination
- the destination point.public final float dotProduct(OMSVGPoint p)
p
- the second factor of the dot product.public final float crossProduct(OMSVGPoint p)
p
- the second factor of the cross product.public final OMSVGPoint round()
Math.round()
to the coordinated of this point.public final OMSVGPoint round(OMSVGPoint destination)
Math.round()
to the coordinated of this
point and puts the result in the specified destination point.destination
- the destination point.public final OMSVGPoint floor()
Math.floor()
to the coordinated of this point.public final OMSVGPoint floor(OMSVGPoint destination)
Math.floor()
to the coordinated of this
point and puts the result in the specified destination point.destination
- the destination point.public final float length()
public final float length2()
public final float distance(OMSVGPoint p)
p
- the point used to measure the distancepublic final float distance2(OMSVGPoint p)
p
- the point used to measure the distanceCopyright © 2018. All Rights Reserved.