Area

Represents an area, internally stored as a Double of square meters.

Most arithmetic operations are supported, and will automatically result in a scalar, Length, or Area depending on the operation.

See also

Types

Link copied to clipboard
object Companion

Companion object containing predefined area values.

Properties

Link copied to clipboard

Returns the absolute value of this area.

Link copied to clipboard

Returns this Area as a scalar value in acres.

Link copied to clipboard

Returns this Area as a scalar value in ares.

Link copied to clipboard

Returns this Area as a scalar value in centiares.

Link copied to clipboard

Returns this Area as a scalar value in decares.

Link copied to clipboard

Returns this Area as a scalar value in deciares.

Link copied to clipboard

Returns this Area as a scalar value in hectares.

Link copied to clipboard

Returns this Area as a scalar value in square centimeters.

Link copied to clipboard

Returns this Area as a scalar value in square feet.

Link copied to clipboard

Returns this Area as a scalar value in square inches.

Link copied to clipboard

Returns this Area as a scalar value in square kilometers.

Link copied to clipboard

Returns this Area as a scalar value in square meters.

Link copied to clipboard

Returns this Area as a scalar value in square miles.

Link copied to clipboard

Returns this Area as a scalar value in square millimeters.

Link copied to clipboard

Returns this Area as a scalar value in square rods.

Link copied to clipboard

Returns this Area as a scalar value in square yards.

Link copied to clipboard

Returns true if this area is finite (not infinite).

Link copied to clipboard

Returns true if this area is infinite (positive or negative).

Link copied to clipboard

Returns true if this area is less than zero.

Link copied to clipboard

Returns true if this area is greater than zero.

Link copied to clipboard

Returns true if this area is equal to zero.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Area): Int
Link copied to clipboard
operator fun div(other: Double): Area

Divides this area by a scalar value.

operator fun div(other: Area): Double

Divides this area by another area, resulting in a dimensionless scalar.

operator fun div(other: Length): Length

Divides this Area by a Length, resulting in another Length.

Link copied to clipboard
operator fun minus(other: Area): Area

Subtracts another area from this area.

Link copied to clipboard
fun mod(other: Area): Area

Returns the modulo of this area with respect to another area.

Link copied to clipboard
operator fun plus(other: Area): Area

Adds another area to this area.

Link copied to clipboard
operator fun rem(other: Area): Area

Returns the remainder of dividing this area by another area.

Link copied to clipboard
fun roundToInt(unit: AreaUnit): Int

Rounds this area to an Int value in the specified unit.

Link copied to clipboard

Rounds this area to a Long value in the specified unit.

Link copied to clipboard
operator fun times(other: Double): Area

Multiplies this area by a scalar value.

Link copied to clipboard

Converts this area to a Double value in the specified unit.

Link copied to clipboard
fun toFloat(unit: AreaUnit): Float

Converts this area to a Float value in the specified unit.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of this area in square meters.

fun toString(unit: AreaUnit = SquareMeters, decimalPlaces: Int = 2): String

Returns a formatted string representation of this area.

Link copied to clipboard
operator fun unaryMinus(): Area

Returns the negation of this area.

Link copied to clipboard
operator fun unaryPlus(): Area

Returns this area unchanged.