The Base.Graphics interface is an abstract wrapper; specific packages (e.g., Cairo and Tk/Gtk) implement much of the functionality.


Vec2(x, y)

Creates a point in two dimensions

BoundingBox(xmin, xmax, ymin, ymax)

Creates a box in two dimensions with the given edges


Creates a box in two dimensions that encloses all objects


Computes the width of an object


Computes the height of an object


Computes the minimum x-coordinate contained in an object


Computes the maximum x-coordinate contained in an object


Computes the minimum y-coordinate contained in an object


Computes the maximum y-coordinate contained in an object


Return the length of the diagonal of an object


Compute the height/width of an object


Return the point in the center of an object


Returns a tuple (xmin(obj), xmax(obj))


Returns a tuple (ymin(obj), ymax(obj))

rotate(obj, angle, origin) → newobj

Rotates an object around origin by the specified angle (radians), returning a new object of the same type. Because of type-constancy, this new object may not always be a strict geometric rotation of the input; for example, if obj is a BoundingBox the return is the smallest BoundingBox that encloses the rotated input.

shift(obj, dx, dy)

Returns an object shifted horizontally and vertically by the indicated amounts

*(obj, s::Real)

Scale the width and height of a graphics object, keeping the center fixed

+(bb1::BoundingBox, bb2::BoundingBox) → BoundingBox

Returns the smallest box containing both boxes

&(bb1::BoundingBox, bb2::BoundingBox) → BoundingBox

Returns the intersection, the largest box contained in both boxes

deform(bb::BoundingBox, dxmin, dxmax, dymin, dymax)

Returns a bounding box with all edges shifted by the indicated amounts

isinside(bb::BoundingBox, x, y)

True if the given point is inside the box

isinside(bb::BoundingBox, point)

True if the given point is inside the box