MutableParallelogram


class MutableParallelogram : Parallelogram


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

Summary

Public companion functions

MutableParallelogram
fromCenterAndDimensions(
    center: MutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float
)

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

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

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

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

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

Public constructors

Public functions

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

Public properties

open MutableVec
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: MutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float
): MutableParallelogram

Constructs an MutableParallelogram 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: MutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float,
    rotation: @AngleRadiansFloat Float
): MutableParallelogram

Constructs an MutableParallelogram 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: MutableVec,
    width: @FloatRange(from = 0.0) Float,
    height: Float,
    rotation: @AngleRadiansFloat Float,
    shearFactor: Float
): MutableParallelogram

Constructs an MutableParallelogram 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 constructors

MutableParallelogram

Added in 1.0.0-alpha01
MutableParallelogram()

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 var centerMutableVec

height

Added in 1.0.0-alpha01
open var 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 var rotationFloat

shearFactor

Added in 1.0.0-alpha01
open var 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 var 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π).