This class represents a vector in the 2-dimensional real vector space.
Inheritance Hierarchy
YVector
Remarks
This vector is an ordered 2 tuple and is defined by two doubles.
Type Details
- yfiles module
- algorithms
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.algorithms.YVector
Constructors
Creates a new vector, whose direction is given by two points.
Remarks
The vector is defined by
(x1 - x2, y1 - y2)
.Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- x1 - number
- the X-coordinate of the first point.
- y1 - number
- the Y-coordinate of the first point.
- x2 - number
- the X-coordinate of the second point.
- y2 - number
- the Y-coordinate of the second point.
Properties
Methods
Returns a new YVector
instance that is obtained by rotating this vector by the given angle (measured in radians) in clockwise direction (with regards to screen coordinates).
Remarks
Screen coordinates mean positive x-direction is from left to right and positive y-direction is from top to bottom.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- angle - number
- the angle of rotation in radians.
Returns
- ↪YVector
- the rotated vector.
Static Methods
Returns the result of the addition of two angles between 0
and 2*Pi
.
Remarks
The result is calculated modulo
2*Pi
.Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- a1 - number
- a value in
[0,2Pi)
. - a2 - number
- a value in
[0,2Pi)
.
Returns
- ↪number
- The sum of a1 and a2 modulo
2*Pi
.