Function calculateBlockDistance

  • Calculate distance between block.

    Distance is calculated from the center of the block.

    Example


    import { Block, calculateBlockDistance } from "blockwise";

    const a: Block = { x: 0, y: 0, w: 1, h: 1 };
    const b: Block = { x: 1, y: 0, w: 1, h: 1 };

    const distance = calculateBlockDistance(a, b);

    console.log(distance); // 1

    Parameters

    Returns number

Generated using TypeDoc