@antv/util
Version:
<h1 align="center">@antv/util</h1>
14 lines (12 loc) • 445 B
text/typescript
import type { PathArray, PathLengthFactoryOptions } from '../types';
import { pathLengthFactory } from './path-length-factory';
/**
* Returns [x,y] coordinates of a point at a given length of a shape.
*/
export function getPointAtLength(
pathInput: string | PathArray,
distance: number,
options?: Partial<PathLengthFactoryOptions>,
) {
return pathLengthFactory(pathInput, distance, { ...options, bbox: false, length: true }).point;
}