predicates

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2021 License: Unlicense Imports: 4 Imported by: 0

README

predicates

Routines for Arbitrary Precision Floating-point Arithmetic and Fast Robust Geometric Predicates

This package is ported form predicates.c

see predicates.c.txt for oringinal C code.

License

Public Domain

Documentation

Overview

Package predicates is implements arbitrary precision floating-point arithmetic and fast robust geometric predicates. ported form C code "predicates.c"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(elen int, e *Float, h *Float) int

1369 "./predicates.c.txt"

func ExpansionSum

func ExpansionSum(elen int, e *Float, flen int, f *Float, h *Float) int

841 "./predicates.c.txt"

func ExpansionSumZeroElim1

func ExpansionSumZeroElim1(elen int, e *Float, flen int, f *Float, h *Float) int

885 "./predicates.c.txt"

func ExpansionSumZeroElim2

func ExpansionSumZeroElim2(elen int, e *Float, flen int, f *Float, h *Float) int

940 "./predicates.c.txt"

func FastExpansionSum

func FastExpansionSum(elen int, e *Float, flen int, f *Float, h *Float) int

992 "./predicates.c.txt"

func FastExpansionSumZeroElim

func FastExpansionSumZeroElim(elen int, e *Float, flen int, f *Float, h *Float) int

1065 "./predicates.c.txt"

func GrowExpansion

func GrowExpansion(elen int, e *Float, b Float, h *Float) int

770 "./predicates.c.txt"

func GrowExpansionZeroElim

func GrowExpansionZeroElim(elen int, e *Float, b Float, h *Float) int

803 "./predicates.c.txt"

func LinearExpansionSum

func LinearExpansionSum(elen int, e *Float, flen int, f *Float, h *Float) int

1145 "./predicates.c.txt"

func LinearExpansionSumZeroElim

func LinearExpansionSumZeroElim(elen int, e *Float, flen int, f *Float, h *Float) int

1204 "./predicates.c.txt"

func ScaleExpansion

func ScaleExpansion(elen int, e *Float, b Float, h *Float) int

1273 "./predicates.c.txt"

func ScaleExpansionZeroElim

func ScaleExpansionZeroElim(elen int, e *Float, b Float, h *Float) int

1318 "./predicates.c.txt"

Types

type Float

type Float = float32

Float is floating-point number type

func Estimate

func Estimate(elen int, e *Float) Float

1411 "./predicates.c.txt"

func Incircle

func Incircle(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float) Float

***************************************************************************

incirclefast()   Approximate 2D incircle test.  Nonrobust.
incircleexact()   Exact 2D incircle test.  Robust.
incircleslow()   Another exact 2D incircle test.  Robust.
incircle()   Adaptive exact 2D incircle test.  Robust.

             Return a positive value if the point pd lies inside the
             circle passing through pa, pb, and pc; a negative value if
             it lies outside; and zero if the four points are cocircular.
             The points pa, pb, and pc must be in counterclockwise
             order, or the sign of the result will be reversed.

Only the first and last routine should be used; the middle two are for
timings.

The last three use exact arithmetic to ensure a correct answer.  The
result returned is the determinant of a matrix.  In incircle() only,
this determinant is computed adaptively, in the sense that exact
arithmetic is used only to the degree it is needed to ensure that the
returned value has the correct sign.  Hence, incircle() is usually quite
fast, but will run more slowly when the input points are cocircular or
nearly so.

***************************************************************************

func Incircle2p

func Incircle2p(pa, pb, pc [2]Float) Float

func Incircle2pFast

func Incircle2pFast(pa, pb, pc [2]Float) Float

func IncircleAdapt

func IncircleAdapt(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float, permanent Float) Float

2622 "./predicates.c.txt"

func IncircleExact

func IncircleExact(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float) Float

func IncircleFast

func IncircleFast(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float) Float

2344 "./predicates.c.txt"

func IncircleSlow

func IncircleSlow(pa, pb, pc, pd [2]Float) Float

func Insphere

func Insphere(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, pe [3]Float) Float

***************************************************************************

inspherefast()   Approximate 3D insphere test.  Nonrobust.
insphereexact()   Exact 3D insphere test.  Robust.
insphereslow()   Another exact 3D insphere test.  Robust.
insphere()   Adaptive exact 3D insphere test.  Robust.

             Return a positive value if the point pe lies inside the
             sphere passing through pa, pb, pc, and pd; a negative value
             if it lies outside; and zero if the five points are
             cospherical.  The points pa, pb, pc, and pd must be ordered
             so that they have a positive orientation (as defined by
             orient3d()), or the sign of the result will be reversed.

Only the first and last routine should be used; the middle two are for
timings.

The last three use exact arithmetic to ensure a correct answer.  The
result returned is the determinant of a matrix.  In insphere() only,
this determinant is computed adaptively, in the sense that exact
arithmetic is used only to the degree it is needed to ensure that the
returned value has the correct sign.  Hence, insphere() is usually quite
fast, but will run more slowly when the input points are cospherical or
nearly so.

***************************************************************************

func InsphereAdapt

func InsphereAdapt(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, pe [3]Float, permanent Float) Float

3887 "./predicates.c.txt"

func InsphereExact

func InsphereExact(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, pe [3]Float) Float

func InsphereFast

func InsphereFast(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, pe [3]Float) Float

3261 "./predicates.c.txt"

func InsphereSlow

func InsphereSlow(pa, pb, pc, pd, pe [3]Float) Float

func Orient2d

func Orient2d(pa [2]Float, pb [2]Float, pc [2]Float) Float

***************************************************************************

orient2dfast()   Approximate 2D orientation test.  Nonrobust.
orient2dexact()   Exact 2D orientation test.  Robust.
orient2dslow()   Another exact 2D orientation test.  Robust.
orient2d()   Adaptive exact 2D orientation test.  Robust.

             Return a positive value if the points pa, pb, and pc occur
             in counterclockwise order; a negative value if they occur
             in clockwise order; and zero if they are collinear.  The
             result is also a rough approximation of twice the signed
             area of the triangle defined by the three points.

Only the first and last routine should be used; the middle two are for
timings.

The last three use exact arithmetic to ensure a correct answer.  The
result returned is the determinant of a matrix.  In orient2d() only,
this determinant is computed adaptively, in the sense that exact
arithmetic is used only to the degree it is needed to ensure that the
returned value has the correct sign.  Hence, orient2d() is usually quite
fast, but will run more slowly when the input points are collinear or
nearly so.

***************************************************************************

func Orient2dAdapt

func Orient2dAdapt(pa [2]Float, pb [2]Float, pc [2]Float, detsum Float) Float

1543 "./predicates.c.txt"

func Orient2dExact

func Orient2dExact(pa [2]Float, pb [2]Float, pc [2]Float) Float

func Orient2dFast

func Orient2dFast(pa [2]Float, pb [2]Float, pc [2]Float) Float

1449 "./predicates.c.txt"

func Orient2dSlow

func Orient2dSlow(pa [2]Float, pb [2]Float, pc [2]Float) Float

func Orient3d

func Orient3d(pa, pb, pc, pd [3]Float) Float

***************************************************************************

orient3dfast()   Approximate 3D orientation test.  Nonrobust.
orient3dexact()   Exact 3D orientation test.  Robust.
orient3dslow()   Another exact 3D orientation test.  Robust.
orient3d()   Adaptive exact 3D orientation test.  Robust.

             Return a positive value if the point pd lies below the
             plane passing through pa, pb, and pc; "below" is defined so
             that pa, pb, and pc appear in counterclockwise order when
             viewed from above the plane.  Returns a negative value if
             pd lies above the plane.  Returns zero if the points are
             coplanar.  The result is also a rough approximation of six
             times the signed volume of the tetrahedron defined by the
             four points.

Only the first and last routine should be used; the middle two are for
timings.

The last three use exact arithmetic to ensure a correct answer.  The
result returned is the determinant of a matrix.  In orient3d() only,
this determinant is computed adaptively, in the sense that exact
arithmetic is used only to the degree it is needed to ensure that the
returned value has the correct sign.  Hence, orient3d() is usually quite
fast, but will run more slowly when the input points are coplanar or
nearly so.

***************************************************************************

func Orient3dAdapt

func Orient3dAdapt(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, permanent Float) Float

1877 "./predicates.c.txt"

func Orient3dExact

func Orient3dExact(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float) Float

func Orient3dFast

func Orient3dFast(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float) Float

1685 "./predicates.c.txt"

func Orient3dSlow

func Orient3dSlow(pa, pb, pc, pd [3]Float) Float

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL