API Docs for: 0.0.1
Show:

# Cartesian Class

The Cartesian class is a means to bundle Axis objects and provides neat accessors to calculate pixel/coord of two Axis objects at a time, a x-axis and a y-axis.

()

## Methods

### `addx`

(
• `name`
• `min`
• `max`
• `pxmin`
• `pxmax`
)

Add an x-axis to the cartesian instance.

#### Parameters:

• `name` String

• `min` Number

Minimal coordinate

• `max` Number

Maximal coordinate

• `pxmin` Number

Pixel value for minimal coordinate

• `pxmax` Number

Pixel value for maximal coordinate

### `addy`

(
• `name`
• `min`
• `max`
• `pxmin`
• `pxmax`
)

Add an y-axis to the cartesian instance.

#### Parameters:

• `name` String

• `min` Number

Minimal coordinate

• `max` Number

Maximal coordinate

• `pxmin` Number

Pixel value for minimal coordinate

• `pxmax` Number

Pixel value for maximal coordinate

### `coord`

(
• `namex`
• `namey`
• `px`
• `py`
)

Get coord for a given (px, py) pixel value (not rounded).

#### Parameters:

• `namex` String

The name of the x-axis

• `namey` String

The name of the y-axis

• `px` Number

Pixel (should be between pixel minimum and pixel maximum)

• `py` Number

Pixel (should be between pixel minimum and pixel maximum)

#### Returns:

Object:

Object with x and y property

### `coordx`

(
• `namex`
• `x`
)

Get coordinate value for a given pixel (not rounded) on the x-axis.

#### Parameters:

• `namex` String

The name of the x-axis

• `x` Number

Pixel (should be between pixel minimum and pixel maximum)

### `coordy`

(
• `namey`
• `y`
)

Get coordinate value for a given pixel (not rounded) on the y-axis.

#### Parameters:

• `namey` String

The name of the y-axis

• `y` Number

Pixel (should be between pixel minimum and pixel maximum)

### `invert`

(
• `name`
)

Invert the axis (swap minimum for maximum)

#### Parameters:

• `name` String

Name of axis to invert

### `pixel`

(
• `namex`
• `namey`
• `x`
• `y`
)

Get pixel value for a given (x, y) coord (not rounded).

#### Parameters:

• `namex` String

The name of the x-axis

• `namey` String

The name of the y-axis

• `x` Number

Coordinate (should be between minimum and maximum)

• `y` Number

Coordinate (should be between minimum and maximum)

#### Returns:

Object:

Object with x and y property

### `px`

(
• `namex`
• `x`
)

Get pixel value for a given coord (not rounded) on x-axis.

#### Parameters:

• `namex` String

The name of the x-axis

• `x` Number

Coordinate (should be between minimum and maximum)

### `py`

(
• `namey`
• `y`
)

Get pixel value for a given coord (not rounded) on y-axis.

#### Parameters:

• `namey` String

The name of the y-axis

• `y` Number

Coordinate (should be between minimum and maximum)