Skip to content

Not all points are detected #3

Open
@anvaka

Description

@anvaka

Consider to following set of segments:

var lines = [
  [ [ 0.6180339887498949, 1.902113032590307 ], [ 2, 0 ] ],
  [ [ -1.6180339887498947, 1.1755705045849465 ], [ 2, 0 ] ],
  [ [ 2, 0 ], [ -1.618033988749895, -1.175570504584946 ] ],
  [ [ 2, 0 ], [ 0.6180339887498945, -1.9021130325903073 ] ],
  [ [ 0.6180339887498949, 1.902113032590307 ], [ -1.6180339887498947, 1.1755705045849465 ] ],
  [ [ 0.6180339887498949, 1.902113032590307 ], [ -1.618033988749895, -1.175570504584946 ] ],
  [ [ 0.6180339887498949, 1.902113032590307 ], [ 0.6180339887498945, -1.9021130325903073 ] ],
  [ [ -1.6180339887498947, 1.1755705045849465 ], [ -1.618033988749895, -1.175570504584946 ] ],
  [ [ -1.6180339887498947, 1.1755705045849465 ], [ 0.6180339887498945, -1.9021130325903073 ] ],
  [ [ -1.618033988749895, -1.175570504584946 ], [ 0.6180339887498945, -1.9021130325903073 ] ]
]

When you run findIntersections(lines) it reports only 9 intersected points, while there are (visually) 10 intersections:

Reported:

image

Expected

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions