Affine

smile.modeling.Affine
See theAffine companion object
final case class Affine

An affine map of the plane, with its coefficients in the order a canvas, Java2D and SVG all take them. (x, y) goes to (a * x + c * y + e, b * x + d * y + f). That makes it setTransform(a, b, c, d, e, f) on a canvas, new AffineTransform(a, b, c, d, e, f) in Java2D and matrix(a b c d e f) in SVG.

Every affine is normalized when it is made, so that equal maps are equal values. Linear coefficients within smile.modeling.Affine.Tolerance times the largest of a to d of 0, 1 or -1 become exactly that, e and f are rounded to the nearest multiple of 2^-20, and -0.0 becomes 0.0. Equality is exact over the normalized values.

A public affine is always invertible and finite.

Attributes

Companion
object
Source
Affine.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def andThen(next: Affine): Affine

This map followed by next.

This map followed by next.

Attributes

Source
Affine.scala
def apply(x: Double, y: Double): Pos

Where this map takes the point (x, y).

Where this map takes the point (x, y).

Attributes

Source
Affine.scala
def apply(point: Pos): Pos

Where this map takes point.

Where this map takes point.

Attributes

Source
Affine.scala
def boxBounds(left: Double, top: Double, right: Double, bottom: Double): Bounds

The box around where this map takes the rectangle with the given sides.

The box around where this map takes the rectangle with the given sides.

Attributes

Source
Affine.scala

The signed factor by which this map scales areas. It is never zero for an affine made through the public API.

The signed factor by which this map scales areas. It is never zero for an affine made through the public API.

Attributes

Source
Affine.scala

The map that undoes this one.

The map that undoes this one.

Attributes

Source
Affine.scala

Whether the map has no shear and takes the axes to the axes. It only moves, scales along the axes, turns by right angles and mirrors.

Whether the map has no shear and takes the axes to the axes. It only moves, scales along the axes, turns by right angles and mirrors.

Attributes

Source
Affine.scala

Whether the map only moves, mirrors and turns by right angles, without resizing. It lays a pixel grid on another pixel grid. Its linear part has a one or a minus one in each row and column, and zeros elsewhere.

Whether the map only moves, mirrors and turns by right angles, without resizing. It lays a pixel grid on another pixel grid. Its linear part has a one or a minus one in each row and column, and zeros elsewhere.

Attributes

Source
Affine.scala
def mapX(x: Double, y: Double): Double

The x coordinate that this map takes the point (x, y) to.

The x coordinate that this map takes the point (x, y) to.

Attributes

Source
Affine.scala
def mapY(x: Double, y: Double): Double

The y coordinate that this map takes the point (x, y) to.

The y coordinate that this map takes the point (x, y) to.

Attributes

Source
Affine.scala

Inherited methods

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala