@rxflow/manhattan
Version:
Manhattan routing algorithm for ReactFlow - generates orthogonal paths with obstacle avoidance
49 lines • 1.2 kB
TypeScript
/**
* Point class representing a 2D coordinate
*/
export declare class Point {
x: number;
y: number;
constructor(x: number, y: number);
/**
* Create a copy of this point
*/
clone(): Point;
/**
* Check if this point equals another point
*/
equals(other: Point): boolean;
/**
* Translate this point by dx and dy
*/
translate(dx: number, dy: number): Point;
/**
* Round coordinates to specified precision
*/
round(precision: number): Point;
/**
* Calculate Manhattan distance to another point
*/
manhattanDistance(other: Point): number;
/**
* Calculate angle (in degrees) from this point to another point
*/
theta(other: Point): number;
/**
* Calculate the difference vector from this point to another
*/
diff(other: Point): Point;
/**
* Convert point to string representation
*/
toString(): string;
/**
* Snap point to grid
*/
snapToGrid(gridSize: number): Point;
/**
* Calculate squared distance to another point (for performance)
*/
squaredDistance(other: Point): number;
}
//# sourceMappingURL=Point.d.ts.map