Documentation ¶
Overview ¶
Package predicates is implements arbitrary precision floating-point arithmetic and fast robust geometric predicates. ported form C code "predicates.c"
Index ¶
- func Compress(elen int, e *Float, h *Float) int
- func ExpansionSum(elen int, e *Float, flen int, f *Float, h *Float) int
- func ExpansionSumZeroElim1(elen int, e *Float, flen int, f *Float, h *Float) int
- func ExpansionSumZeroElim2(elen int, e *Float, flen int, f *Float, h *Float) int
- func FastExpansionSum(elen int, e *Float, flen int, f *Float, h *Float) int
- func FastExpansionSumZeroElim(elen int, e *Float, flen int, f *Float, h *Float) int
- func GrowExpansion(elen int, e *Float, b Float, h *Float) int
- func GrowExpansionZeroElim(elen int, e *Float, b Float, h *Float) int
- func LinearExpansionSum(elen int, e *Float, flen int, f *Float, h *Float) int
- func LinearExpansionSumZeroElim(elen int, e *Float, flen int, f *Float, h *Float) int
- func ScaleExpansion(elen int, e *Float, b Float, h *Float) int
- func ScaleExpansionZeroElim(elen int, e *Float, b Float, h *Float) int
- type Float
- func Estimate(elen int, e *Float) Float
- func Incircle(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float) Float
- func Incircle2p(pa, pb, pc [2]Float) Float
- func Incircle2pFast(pa, pb, pc [2]Float) Float
- func IncircleAdapt(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float, permanent Float) Float
- func IncircleExact(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float) Float
- func IncircleFast(pa [2]Float, pb [2]Float, pc [2]Float, pd [2]Float) Float
- func IncircleSlow(pa, pb, pc, pd [2]Float) Float
- func Insphere(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, pe [3]Float) Float
- func InsphereAdapt(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, pe [3]Float, ...) Float
- func InsphereExact(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, pe [3]Float) Float
- func InsphereFast(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, pe [3]Float) Float
- func InsphereSlow(pa, pb, pc, pd, pe [3]Float) Float
- func Orient2d(pa [2]Float, pb [2]Float, pc [2]Float) Float
- func Orient2dAdapt(pa [2]Float, pb [2]Float, pc [2]Float, detsum Float) Float
- func Orient2dExact(pa [2]Float, pb [2]Float, pc [2]Float) Float
- func Orient2dFast(pa [2]Float, pb [2]Float, pc [2]Float) Float
- func Orient2dSlow(pa [2]Float, pb [2]Float, pc [2]Float) Float
- func Orient3d(pa, pb, pc, pd [3]Float) Float
- func Orient3dAdapt(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float, permanent Float) Float
- func Orient3dExact(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float) Float
- func Orient3dFast(pa [3]Float, pb [3]Float, pc [3]Float, pd [3]Float) Float
- func Orient3dSlow(pa, pb, pc, pd [3]Float) Float
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpansionSum ¶
841 "./predicates.c.txt" ¶
func ExpansionSumZeroElim1 ¶
885 "./predicates.c.txt" ¶
func ExpansionSumZeroElim2 ¶
940 "./predicates.c.txt" ¶
func FastExpansionSum ¶
992 "./predicates.c.txt" ¶
func FastExpansionSumZeroElim ¶
1065 "./predicates.c.txt" ¶
func GrowExpansion ¶
770 "./predicates.c.txt" ¶
func GrowExpansionZeroElim ¶
803 "./predicates.c.txt" ¶
func LinearExpansionSum ¶
1145 "./predicates.c.txt" ¶
func LinearExpansionSumZeroElim ¶
1204 "./predicates.c.txt" ¶
func ScaleExpansion ¶
1273 "./predicates.c.txt" ¶
Types ¶
type Float ¶
type Float = float32
Float is floating-point number type
func Incircle ¶
***************************************************************************
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 Incircle2pFast ¶
func IncircleAdapt ¶
2622 "./predicates.c.txt" ¶
func IncircleFast ¶
2344 "./predicates.c.txt" ¶
func IncircleSlow ¶
func Insphere ¶
***************************************************************************
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 InsphereFast ¶
3261 "./predicates.c.txt" ¶
func InsphereSlow ¶
func Orient2d ¶
***************************************************************************
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 ¶
1543 "./predicates.c.txt" ¶
func Orient2dFast ¶
1449 "./predicates.c.txt" ¶
func Orient3d ¶
***************************************************************************
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.
***************************************************************************