Dimension
classin packageklyn.math.geometry
public class Dimension<NUMBER extends AbstractNumber = Double> extends Object
Dimension

Represents a two-dimensional dimension with width and height.

Example

size = Dimension<Double>(640.0, 480.0)

Properties
Modifier and Type Member Description
public property height
height as NUMBER
The height of the dimension.
public property width
width as NUMBER
The width of the dimension.
Constructors
Modifier and Type Member Description
public Dimension
Dimension(width as NUMBER, height as NUMBER)
Constructs a new Dimension with the specified width and height.
Methods
Modifier and Type Member Description
public area
area() as NUMBER
Calculates the area of the dimension.
public perimeter
perimeter() as NUMBER
Calculates the perimeter of the dimension.
public scale
scale(factor as NUMBER) as Void
Scales the dimension by the specified factor.
public override toString
toString() as String
Returns a string representation of the dimension.