Function coordinates

  • Generate a random 2D coordinate within a specified range.

    Parameters

    • minX: number

      The minimum x value of the range.

    • maxX: number

      The maximum x value of the range.

    • minY: number

      The minimum y value of the range.

    • maxY: number

      The maximum y value of the range.

    Returns Point

    A random 2D coordinate within the specified range.

    Example

    const coordinate = RNG.coordinate(0, 100, -50, 50);
    console.log(coordinate); // Output: e.g., { x: 75.123, y: 23.456 }

Generated using TypeDoc