GHvW / twig

A tiny library for finding the mid-point of a path or polyline on a 2D plane

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

twig

Twig is a tiny library used primarily for finding the mid-point of a path or polyline on a 2D plane.

Rough usage:

import { findMidpoint } from "/path/to/path";

const path = [
    { x: 0, y: 0 },
    { x: 10, y: 10 },
    { x: 20, y: 20 },
    { x: 30, y: 30 }
];

const midpoint = findMidpoint(path);
// midpoint = { x: 15, y: 15 }

About

A tiny library for finding the mid-point of a path or polyline on a 2D plane

License:MIT License


Languages

Language:TypeScript 100.0%