Api - ICascadePoint Interface
Hierarchy
-
ICascade
- ICascadePoint
Index
Properties
$initial
$reset
Use the $original as the $result.
Type declaration
-
-
Returns this
-
$result
The current final value of the cascade.
Methods
add
-
Add two points together and return the result as a new point object.
Parameters
-
b: IPoint
Second point.
-
Optional subtract: boolean
Optional boolean to subtract instead of add.
Returns ICascadePoint
this cascade container, this.$result will be A new point object.
-
average
-
Get the average of two points.
Parameters
-
b: IPoint
Second point.
Returns ICascadePoint
this cascade container, this.$result will be New point object which is the average of a and b.
-
clone
-
Clone a point into a new point.
Returns ICascadePoint
this cascade container, this.$result will be A new point with same values as the original.
closest
-
From an array of points, find the closest point to a given reference point.
Parameters
-
pointOptions: IPoint[]
Array of points to choose from.
Returns ICascadePoint
this cascade container, this.$result will be The first closest point from the pointOptions.
-
distort
-
Distort a point's coordinates.
Parameters
-
scaleX: number
The amount of x scaling.
-
scaleY: number
The amount of y scaling.
Returns ICascadePoint
this cascade container, this.$result will be A new point.
-
mirror
-
Create a clone of a point, mirrored on either or both x and y axes.
Parameters
-
mirrorX: boolean
Boolean to mirror on the x axis.
-
mirrorY: boolean
Boolean to mirror on the y axis.
Returns ICascadePoint
this cascade container, this.$result will be Mirrored point.
-
rotate
-
Rotate a point.
Parameters
-
angleInDegrees: number
The amount of rotation, in degrees.
-
Optional rotationOrigin: IPoint
(default [0, 0]) The center point of rotation.
Returns ICascadePoint
this cascade container, this.$result will be A new point.
-
rounded
-
Round the values of a point.
Parameters
-
Optional accuracy: number
Optional exemplar number of decimal places.
Returns ICascadePoint
this cascade container, this.$result will be A new point with the values rounded.
-
scale
-
Scale a point's coordinates.
Parameters
-
scaleValue: number
The amount of scaling.
Returns ICascadePoint
this cascade container, this.$result will be A new point.
-
subtract
-
Subtract a point from another point, and return the result as a new point. Shortcut to Add(a, b, subtract = true).
Parameters
-
b: IPoint
Second point.
Returns ICascadePoint
this cascade container, this.$result will be A new point object.
-
Generated using TypeDoc
The initial context object of the cascade.