ImmutableParallelogram


class ImmutableParallelogram : Parallelogram


Immutable parallelogram (i.e. a quadrilateral with parallel sides), defined by its center, width, height, rotation, and shearFactor.

Summary

Public companion functions

ImmutableParallelogram
fromCenterAndDimensions(
    center: ImmutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float
)

Constructs an ImmutableParallelogram with a given center, width and height.

ImmutableParallelogram
fromCenterDimensionsAndRotation(
    center: ImmutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float,
    rotation: @AngleRadiansFloat Float
)

Constructs an ImmutableParallelogram with a given center, width, height and rotation.

ImmutableParallelogram
fromCenterDimensionsRotationAndShear(
    center: ImmutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float,
    rotation: @AngleRadiansFloat Float,
    shearFactor: Float
)

Constructs an ImmutableParallelogram with a given center, width, height, rotation and shearFactor.

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

open ImmutableVec
open Float

A Parallelogram may have a positive or negative height; a positive height indicates that the angle from the first semi-axis to the second will also be positive.

open Float
open Float

A Parallelogram] may have a positive or negative shear factor; a positive shear factor indicates a smaller absolute angle between the semi-axes (the shear factor is, in fact, the cotangent of that angle).

open Float

A Parallelogram may not have a negative width.

Inherited functions

From androidx.ink.geometry.Parallelogram
Float

Returns the signed area of the Parallelogram.

Public companion functions

fromCenterAndDimensions

Added in 1.0.0-alpha01
fun fromCenterAndDimensions(
    center: ImmutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float
): ImmutableParallelogram

Constructs an ImmutableParallelogram with a given center, width and height. The resulting Parallelogram has zero rotation and shearFactor. If the width is less than zero, the Parallelogram will be normalized.

fromCenterDimensionsAndRotation

Added in 1.0.0-alpha01
fun fromCenterDimensionsAndRotation(
    center: ImmutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float,
    rotation: @AngleRadiansFloat Float
): ImmutableParallelogram

Constructs an ImmutableParallelogram with a given center, width, height and rotation. The resulting Parallelogram has zero shearFactor. If the width is less than zero or if the rotation is not in the range [0, 2π), the Parallelogram will be normalized.

fromCenterDimensionsRotationAndShear

Added in 1.0.0-alpha01
fun fromCenterDimensionsRotationAndShear(
    center: ImmutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float,
    rotation: @AngleRadiansFloat Float,
    shearFactor: Float
): ImmutableParallelogram

Constructs an ImmutableParallelogram with a given center, width, height, rotation and shearFactor. If the width is less than zero or if the rotation is not in the range [0, 2π), the Parallelogram will be normalized.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

center

Added in 1.0.0-alpha01
open val centerImmutableVec

height

Added in 1.0.0-alpha01
open val heightFloat

A Parallelogram may have a positive or negative height; a positive height indicates that the angle from the first semi-axis to the second will also be positive.

rotation

Added in 1.0.0-alpha01
open val rotationFloat

shearFactor

Added in 1.0.0-alpha01
open val shearFactorFloat

A Parallelogram] may have a positive or negative shear factor; a positive shear factor indicates a smaller absolute angle between the semi-axes (the shear factor is, in fact, the cotangent of that angle).

width

Added in 1.0.0-alpha01
open val widthFloat

A Parallelogram may not have a negative width. If an operation on a parallelogram would result in a negative width, it is instead normalized, by negating both the width and the height, adding π to the angle of rotation, and normalizing rotation to the range [0, 2π).