warpvas
Version:
This JavaScript library enables fast and efficient image distortion transformations using Canvas 2D.
26 lines (25 loc) • 681 B
TypeScript
/**
* Extend point along perpendicular direction from line segment
*
* @param a - Target point coordinates {x: number, y: number}
* @param b - Reference line start point
* @param c - Reference line end point
* @param expandValue - Extension distance (default: 1 unit)
*
* @returns Extended coordinates
*
* @example
* ```typescript
* // Basic usage
* const expanded = calcExpandCoord(
* {x:0,y:0}, {x:-1,y:1}, {x:1,y:1}
* ); // Moves 1 unit away from line
* ```
*
* @remarks
* - Extension direction always perpendicular to line
*/
export declare const calcExpandCoord: (a: Coord, b: Coord, c: Coord, expandValue?: number) => {
x: number;
y: number;
};