Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

swh:1:snp:c78d7a14cc07423acb6a43d0e3059b9afd67996a
  • Code
  • Branches (1)
  • Releases (0)
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • f9aac5f
  • /
  • src
  • /
  • extended_predicates.h
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
content badge
swh:1:cnt:f20d7f0f55eb16ca60e4c489adb65d5884bf218c
directory badge
swh:1:dir:4f575ba51229ed8a439e690987eb7223782b67ec
revision badge
swh:1:rev:c5be799ee3dad53f5edf10eeb39527bbca5add11
snapshot badge
swh:1:snp:c78d7a14cc07423acb6a43d0e3059b9afd67996a

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: c5be799ee3dad53f5edf10eeb39527bbca5add11 authored by LorenzoDiazzi on 29 May 2025, 10:15:58 UTC
Update README.md
Tip revision: c5be799
extended_predicates.h
#ifndef extended_predicates_h
#define extended_predicates_h

#include <stdio.h>
#include "implicit_point.h"

#include "delaunay.h"

#pragma intrinsic(fabs)

//------------------------
// Basic operations
//------------------------

//  Input: two points p and q, having coordinates p=(px,py,pz), q=(qx,qy,qz).
// Output: 1 -> if p and q have the same coordinates,
//         0 -> otherwise.
static inline uint32_t same_point(const double* p, const double* q) {
    return (p[0] == q[0] && p[1] == q[1] && p[2] == q[2]);
}

//-----------------------------------
// Signe-version of basic predicates
//-----------------------------------

static inline int signe_orient2d(const double* p, const double* q, const double* r) {
    return orient2d(p[0], p[1], q[0], q[1], r[0], r[1]);
}

static inline int signe_orient3d(const double* p, const double* q, const double* r, const double* s) {
    return orient3d(p[0], p[1], p[2], q[0], q[1], q[2], r[0], r[1], r[2], s[0], s[1], s[2]);
}

bool misAlignment(const double * p, const double * q, const double * r);

uint32_t same_half_plane(const double * p, const double * q, const double * v1, const double * v2);
uint32_t pointInInnerSegment(const double * p, const double * v1, const double * v2);
uint32_t pointInSegment(const double * p, const double * v1, const double * v2);
uint32_t innerSegmentsCross(const double* u1, const double* u2, const double* v1, const double* v2);

uint32_t pointInInnerTriangle(const double * p, const double * v1, const double * v2, const double * v3);
uint32_t pointInTriangle(const double * p, const double * v1, const double * v2, const double * v3);
uint32_t innerSegmentCrossesInnerTriangle(const double * u1, const double * u2, const double * v1, const double * v2, const double * v3);
uint32_t innerSegmentCrossesTriangle(const double * u1, const double * u2,
                          const double * v1, const double * v2, const double * v3);

int triangles_overlap(const double* v11, const double* v12, const double* v13, const double* v21, const double* v22, const double* v23);
int triangle_intersects_inner_tet(
    const double* v1, const double* v2, const double* v3,
    const double* t1, const double* t2, const double* t3, const double* t4);


#endif /* extended_predicates_h */

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API