The different rules to define and measure diagonal distance/cost in a square grid. The description of each option refers to the distance/cost of moving diagonally relative to the distance/cost of a horizontal or vertical move.

Enumeration Members

EQUIDISTANT: number

The diagonal distance is 1. Diagonal movement costs the same as horizontal/vertical movement.

EXACT: number

The diagonal distance is √2. Diagonal movement costs √2 times as much as horizontal/vertical movement.

APPROXIMATE: number

The diagonal distance is 1.5. Diagonal movement costs 1.5 times as much as horizontal/vertical movement.

RECTILINEAR: number

The diagonal distance is 2. Diagonal movement costs 2 times as much as horizontal/vertical movement.

ALTERNATING_1: number

The diagonal distance alternates between 1 and 2 starting at 1. The first diagonal movement costs the same as horizontal/vertical movement The second diagonal movement costs 2 times as much as horizontal/vertical movement. And so on...

ALTERNATING_2: number

The diagonal distance alternates between 2 and 1 starting at 2. The first diagonal movement costs 2 times as much as horizontal/vertical movement. The second diagonal movement costs the same as horizontal/vertical movement. And so on...

ILLEGAL: number

The diagonal distance is ∞. Diagonal movement is not allowed/possible.