PiMath API
    Preparing search index...

    Interface RandomGeometryVectorConfig

    Options of rndVector: those of rndPoint (axis, quadrant, range, fraction), with allow.zero in place of allow.origin, and primitive.

    interface RandomGeometryVectorConfig {
        allow?: { zero?: boolean };
        axis?: boolean | "x" | "y" | null;
        fraction?: boolean | RandomCoefficientConfig;
        primitive?: boolean;
        quadrant?: Quadrant | Quadrant[] | null;
        range?: RandomRange;
    }

    Hierarchy (View Summary)

    Index
    allow?: { zero?: boolean }

    Type Declaration

    • Optionalzero?: boolean

      true allows the null vector (default false).

    axis?: boolean | "x" | "y" | null

    Where the point lies relative to the axes (default null).

    • 'x': on the x-axis (y = 0); 'y': on the y-axis (x = 0).
    • true: on one of the two axes, chosen at random.
    • false: on no axis (no coordinate is zero).
    • null: unconstrained (a coordinate may be zero).
    fraction?: boolean | RandomCoefficientConfig

    false (default): integer coordinates; true: fractions; object: full control over the fractions.

    primitive?: boolean

    Integer components with no common divisor, e.g. (1, 2) and never (2, 4) (default false). Requires integers.

    quadrant?: Quadrant | Quadrant[] | null

    Restricts the point to one quadrant, or to a union of quadrants (default null). Axes belong to the quadrants: quadrant 1 means x >= 0 and y >= 0. With several quadrants, one of them is chosen uniformly, then the point is drawn in it.

    range?: RandomRange

    Interval of the coordinates (default 10). A number d means [-|d|, |d|] (so 10 and -10 are equivalent); {min, max} gives explicit bounds.