Skip to content

circ from FastDelaunay.h depends on points ordering #297

@DumitruIlie

Description

@DumitruIlie

It seems that this function works as intended for counterclockwise orders of points

vector<P> u;

u.push_back(P(2, 10));
u.push_back(P(3, 14));
u.push_back(P(4, 5));
u.push_back(P(5, 5));

circ(u[3], u[0], u[1], u[2]) // 0
circ(u[3], u[2], u[1], u[0]) // 1

Simple fix: add this before p2 = ...

if(a.cross(b, c)<0)
	swap(a, c); // Any swap will do

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions