calc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: LGPL-2.1 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// OffsetSegmentSeparationFactor  Factor which controls how close offset segments can be to
	//   skip adding a filler or mitre.
	OffsetSegmentSeparationFactor = 1.0e-3

	// InsideTurnVertexSnapDistanceFactor Factor which controls how close curve vertices on inside turns can be to be snapped
	InsideTurnVertexSnapDistanceFactor = 1.0e-3

	// CurveVertexSnapDistanceFactor Factor which controls how close curve vertices can be to be snapped
	CurveVertexSnapDistanceFactor = 1.0e-6

	// MaxClosingSegLenFactor Factor which determines how short closing segs can be for round buffers
	MaxClosingSegLenFactor = 80
)
View Source
const (
	// DegreeRad is coefficient to translate from degrees to radians
	DegreeRad = math.Pi / 180.0
	// EarthR is earth radius in km
	EarthR = 6371.0

	// Angle of sin 60 = 0.866025403785
	Sin60 = 0.866025403785
	Cos60 = 0.5
)

const ...

View Source
const (
	// POINTS ...
	POINTS = iota
	// CLOSED edge is closed.
	CLOSED
	// MAIN overlay main polygon.
	MAIN
	// CUT overlay cut polygon.
	CUT
	// CLIP overlay clip.
	CLIP
	// MERGE overlay merge.
	MERGE
)

const overlay parameters.

View Source
const (
	// CLOCKWISE ...
	CLOCKWISE        = -1
	COUNTERCLOCKWISE = 1

	// ANGLE ...
	ANGLE = 2.0

	LEFT  = 1
	RIGHT = 2

	// MinRingSize ...
	MinRingSize = 3
	// MaxRingSize ...
	MaxRingSize = 9
	// NearnessFactor ...
	NearnessFactor = 0.99

	// CAPROUND Specifies a round line buffer end cap style.
	CAPROUND = 1
	// CAPFLAT Specifies a flat line buffer end cap style.
	CAPFLAT = 2
	// CAPSQUARE Specifies a square line buffer end cap style.
	CAPSQUARE = 3

	//JOINROUND Specifies a round join style.
	JOINROUND = 1
	// JOINMITRE Specifies a mitre join style.
	JOINMITRE = 2
	// JOINBEVEL Specifies a bevel join style.
	JOINBEVEL = 3

	// QUADRANTSEGMENTS The default number of facets into which to divide a fillet of 90 degrees.
	// A value of 8 gives less than 2% max error in the buffer distance.
	// For a max error of < 1%, use QS = 12.
	// For a max error of < 0.1%, use QS = 18.
	QUADRANTSEGMENTS = 8

	// MITRELIMIT
	// The default mitre limit
	// Allows fairly pointy mitres.
	MITRELIMIT = 5.0

	// SIMPLIFYFACTOR
	// The default simplify factor
	// Provides an accuracy of about 1%, which matches the accuracy of the default Quadrant Segments parameter.
	SIMPLIFYFACTOR = 0.01
)

const default parameters.

View Source
const (
	// The location value for the exterior of a geometry.
	// Also, DE-9IM row index of the exterior of the first geometry and column index
	INTERIOR = 0
	BOUNDARY = 1
	EXTERIOR = 2

	// FALSE Dimension value of the empty geometry (-1).
	// TRUE Dimension value of non-empty geometries (= {P, L, A}).
	// DONTCARE Dimension value for any dimension (= {FALSE, TRUE}).
	FALSE    = -1
	TRUE     = -2
	DONTCARE = -3

	P           = 0
	L           = 1
	A           = 2
	SYMFALSE    = 'F'
	SYMTRUE     = 'T'
	SYMDONTCARE = '*'
	SYMP        = '0'
	SYML        = '1'
	SYMA        = '2'
)

const default DE-9IM and Dimension parameters.

View Source
const (
	// The smallest representable relative difference between two  values.
	EPS   = 1.23259516440783e-32 // = 2^-106
	SPLIT = 134217729.0          // 2^27+1, for IEEE

	MAXPRINTDIGITS = 32

	SCINOTEXPONENTCHAR = "E"
	SCINOTZERO         = "0.0E0"
)

const calc parameter

Variables

View Source
var (
	// PI The value nearest to the constant Pi.
	PI = &PairFloat{3.141592653589793116e+00,
		1.224646799147353207e-16}
	// TWOPI The value nearest to the constant 2 * Pi.
	TWOPI = &PairFloat{
		6.283185307179586232e+00,
		2.449293598294706414e-16}
	// PI2 The value nearest to the constant Pi / 2.
	PI2 = &PairFloat{
		1.570796326794896558e+00,
		6.123233995736766036e-17}
	//E  The value nearest to the constant e (the natural logarithm base).
	E = &PairFloat{
		2.718281828459045091e+00,
		1.445646891729250158e-16}
)

Functions

func Signum

func Signum(x float64) int

Signum Returns an integer indicating the sign of this value.

Types

type PairFloat

type PairFloat struct {
	Hi, Lo float64
}

PairFloat A DoubleDouble uses a representation containing two double-precision values. A number x is represented as a pair of doubles, x.hi and x.lo

func ValueOf

func ValueOf(x float64) *PairFloat

ValueOf Converts the argument to a number.

func (*PairFloat) CompareTo

func (d *PairFloat) CompareTo(other *PairFloat) int

CompareTo Compares two objects numerically.

func (*PairFloat) Equals

func (d *PairFloat) Equals(y *PairFloat) bool

Equals Tests whether this value is equal to another value.

func (*PairFloat) Ge

func (d *PairFloat) Ge(y *PairFloat) bool

Ge Tests whether this value is greater than or equals to another value.

func (*PairFloat) Gt

func (d *PairFloat) Gt(y *PairFloat) bool

Gt Tests whether this value is greater than another value.

func (*PairFloat) IsZero

func (d *PairFloat) IsZero() bool

IsZero Tests whether this value is equal to 0.

func (*PairFloat) Le

func (d *PairFloat) Le(y *PairFloat) bool

Le Tests whether this value is less than or equal to another value.

func (*PairFloat) Lt

func (d *PairFloat) Lt(y *PairFloat) bool

Lt Tests whether this value is less than another value.

func (*PairFloat) SelfAdd

func (d *PairFloat) SelfAdd(yhi, ylo float64) *PairFloat

SelfAdd Adds the argument to the value of DD. To prevent altering constants, this method must only be used on values known to be newly created.

func (*PairFloat) SelfAddOne

func (d *PairFloat) SelfAddOne(y float64) *PairFloat

SelfAddOne Adds the argument to the value of DD. To prevent altering constants, this method must only be used on values known to be newly created.

func (*PairFloat) SelfDivide

func (d *PairFloat) SelfDivide(yhi, ylo float64) *PairFloat

SelfDivide Divides this object by the argument, returning DD. To prevent altering constants, this method must only be used on values known to be newly created.

func (*PairFloat) SelfMultiply

func (d *PairFloat) SelfMultiply(yhi, ylo float64) *PairFloat

SelfMultiply Multiplies this object by the argument, returning DD. To prevent altering constants, this method must only be used on values known to be newly created.

func (*PairFloat) SelfMultiplyPair

func (d *PairFloat) SelfMultiplyPair(y *PairFloat) *PairFloat

SelfMultiplyPair Multiplies this object by the argument, returning DD. To prevent altering constants, this method must only be used on values known to be newly created.

func (*PairFloat) SelfSubtract

func (d *PairFloat) SelfSubtract(yhi, ylo float64) *PairFloat

SelfSubtract Subtracts the argument from the value of DD. To prevent altering constants, this method must only be used on values known to be newly created.

func (*PairFloat) Signum

func (d *PairFloat) Signum() int

Signum Returns an integer indicating the sign of this value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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