math docs
    Preparing search index...

    Function intersection

    • Computes the intersection point of the two closed segments a-b and c-d, writing it to out. Returns out when the segments intersect, or null when they do not (including parallel/collinear segments).

      Parameters

      • out: vec2.Vec2

        output parameter for the intersection point

      • a: vec2.Vec2

        first endpoint of the first segment

      • b: vec2.Vec2

        second endpoint of the first segment

      • c: vec2.Vec2

        first endpoint of the second segment

      • d: vec2.Vec2

        second endpoint of the second segment

      Returns vec2.Vec2 | null

      out if the segments intersect, otherwise null