Radius

data class Radius
kotlin.Any
   ↳ androidx.ui.engine.geometry.Radius

A radius for either circular or elliptical shapes.

Summary

Public constructors

<init>(x: Float, y: Float)

A radius for either circular or elliptical shapes.

Public methods

operator Radius
div(operand: Float)

Division operator.

operator Radius
minus(other: Radius)

Binary subtraction operator.

operator Radius
plus(other: Radius)

Binary addition operator.

operator Radius
rem(operand: Float)

Modulo (remainder) operator.

operator Radius
times(operand: Float)

Multiplication operator.

String

Radius
truncDiv(operand: Float)

Integer (truncating) division operator.

operator Radius

Unary negation operator.

Companion functions

Radius
circular(radius: Float)

Constructs a circular radius.

Radius

Constructs an elliptical radius with the given radii.

Properties

Float

The radius value on the horizontal axis.

Float

The radius value on the vertical axis.

Companion properties

Radius

A radius with x and y values set to zero.

Public constructors

<init>

Radius(
    x: Float,
    y: Float)

A radius for either circular or elliptical shapes.

Public methods

div

operator fun div(operand: Float): Radius

Division operator.

Returns a radius whose coordinates are the coordinates of the left-hand-side operand (a radius) divided by the scalar right-hand-side operand (a Float).

minus

operator fun minus(other: Radius): Radius

Binary subtraction operator.

Returns a radius whose x value is the left-hand-side operand's x minus the right-hand-side operand's x and whose y value is the left-hand-side operand's y minus the right-hand-side operand's y.

plus

operator fun plus(other: Radius): Radius

Binary addition operator.

Returns a radius whose x value is the sum of the x values of the two operands, and whose y value is the sum of the y values of the two operands.

rem

operator fun rem(operand: Float): Radius

Modulo (remainder) operator.

Returns a radius whose coordinates are the remainder of dividing the coordinates of the left-hand-side operand (a radius) by the scalar right-hand-side operand (a Float).

times

operator fun times(operand: Float): Radius

Multiplication operator.

Returns a radius whose coordinates are the coordinates of the left-hand-side operand (a radius) multiplied by the scalar right-hand-side operand (a Float).

toString

fun toString(): String

truncDiv

fun truncDiv(operand: Float): Radius

Integer (truncating) division operator.

Returns a radius whose coordinates are the coordinates of the left-hand-side operand (a radius) divided by the scalar right-hand-side operand (a Float), rounded towards zero.

unaryMinus

operator fun unaryMinus(): Radius

Unary negation operator.

Returns a Radius with the distances negated.

Radiuses with negative values aren't geometrically meaningful, but could occur as part of expressions. For example, negating a radius of one pixel and then adding the result to another radius is equivalent to subtracting a radius of one pixel from the other.

Properties

x

val x: Float

The radius value on the horizontal axis.

y

val y: Float

The radius value on the vertical axis.

Companion functions

circular

fun circular(radius: Float): Radius

Constructs a circular radius. x and y will have the same radius value.

elliptical

fun elliptical(
    x: Float,
    y: Float
): Radius

Constructs an elliptical radius with the given radii.

Companion properties

zero

val zero: Radius

A radius with x and y values set to zero.

You can use Radius.zero with RRect to have right-angle corners.