Represents some type of number value with a unit, such as 2 seconds or 20 pixels.
Measurements are created using the DSL syntax such as:
2.s //== two seconds 20.px //== 20 pixels 20.deg //== 20 degrees
Constructor and description |
---|
Measurement
(Number value, String unit) |
Type Params | Return Type | Name and description |
---|---|---|
|
static Number |
convertNum(Number num, String conversion) |
|
Number |
convertValue(Measurement other) |
|
Number |
div(Measurement other) |
|
Measurement |
div(Number number) |
|
boolean |
equals(def other) |
|
int |
hashCode() |
|
boolean |
isDistance() Is a distance measurement (pt,pc,in,mm,cm,m). |
|
boolean |
isPercent() Is a percentage. |
|
boolean |
isPixel() Unit is pixel. |
|
boolean |
isRelative() Relative length units. |
|
boolean |
isTime() Is a time measurement (s, ms). |
|
boolean |
isTrig() Trigonometric. |
|
boolean |
isZero() |
|
Measurement |
minus(Measurement other) |
|
Measurement |
mod(Number other) |
|
Measurement |
multiply(Number other) |
|
Measurement |
negative() |
|
Measurement |
plus(Measurement other) |
|
Measurement |
power(Number number) |
|
static double |
toDegrees(Number angrad) Converts an angle measured in radians to an approximately equivalent angle measured in degrees. |
|
static double |
toRadians(Number angdeg) Converts an angle measured in degrees to an approximately equivalent angle measured in radians. |
|
String |
toString() |
Is a distance measurement (pt,pc,in,mm,cm,m).
Is a percentage.
Unit is pixel.
Relative length units.
Is a time measurement (s, ms).
Trigonometric.
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
Groovy Documentation