calc

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 2 Imported by: 0

Documentation

Overview

Package calc methods and parameters be realized ouble precision calculation.

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

	// DecimalPlaces ...
	DecimalPlaces = "%.10f"

	// DefaultTolerance6 ...
	DefaultTolerance6 = 1.0e-6

	// DefaultTolerance7 ...
	DefaultTolerance7 = 1.0e-7

	// DefaultTolerance8 ...
	DefaultTolerance8 = 1.0e-8

	// DefaultTolerance9 ...
	DefaultTolerance9 = 1.0e-9

	// DefaultTolerance10 ...
	DefaultTolerance10 = 1.0e-10

	// DefaultTolerance12 ...
	DefaultTolerance12 = 1.0e-12

	// DefaultTolerance13 ...
	DefaultTolerance13 = 1.0e-13

	// DefaultTolerance15 ...
	DefaultTolerance15 = 1.0e-15

	AccuracyFloat = DefaultTolerance12

	DefaultTolerance = DefaultTolerance10
)

Defined constant variable

View Source
const (
	// OverlayPoints ...
	OverlayPoints = iota
	// OverlayClosed edge is closed.
	OverlayClosed
	// OverlayMain overlay main polygon.
	OverlayMain
	// OverlayCut overlay cut polygon.
	OverlayCut
	// OverlayClip overlay clip.
	OverlayClip
	// OverlayMerge overlay merge.
	OverlayMerge
)

const Defined constant variable overlay parameters.

View Source
const (
	// ClockWise ...
	ClockWise        = -1
	CounterClockWise = 1

	SideLeft  = 1
	SideRight = 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 Defined constant variable 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
	ImInterior = 0
	ImBoundary = 1
	ImExterior = 2

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

	ImP          = 0
	ImL          = 1
	ImA          = 2
	ImSymFalse   = 'F'
	ImSymTrue    = 'T'
	ImSymNotCare = '*'
	ImSymP       = '0'
	ImSymL       = '1'
	ImSymA       = '2'
)

const default DE-9IM and Dimension parameters.

View Source
const (
	// Split The value to split a double-precision value on during multiplication
	Split = 134217729.0 // 2^27+1, for IEEE
)

const Defined constant variable calc parameter

Variables

This section is empty.

Functions

func DecimalFloat10 added in v1.1.0

func DecimalFloat10(x float64) float64

DecimalFloat10 Returns float64 , DecimalPlaces 10.

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 Determinant added in v1.0.2

func Determinant(x1, y1, x2, y2 float64) *PairFloat

Determinant Computes the determinant of the 2x2 matrix with the given entries.

func DeterminantPair added in v1.0.2

func DeterminantPair(x1, y1, x2, y2 *PairFloat) *PairFloat

DeterminantPair Computes the determinant of the 2x2 matrix with the given entries.

func ValueOf

func ValueOf(x float64) *PairFloat

ValueOf Converts the argument to a number.

func (*PairFloat) Add added in v1.0.2

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

Add 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) AddOne added in v1.0.2

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

AddOne 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) AddPair added in v1.0.2

func (d *PairFloat) AddPair(y *PairFloat) *PairFloat

AddPair 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) CompareTo

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

CompareTo Compares two objects numerically.

func (*PairFloat) Divide added in v1.0.2

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

Divide 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) DividePair added in v1.0.2

func (d *PairFloat) DividePair(y *PairFloat) *PairFloat

DividePair 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) 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) Multiply added in v1.0.2

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

Multiply 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) MultiplyPair added in v1.0.2

func (d *PairFloat) MultiplyPair(y *PairFloat) *PairFloat

MultiplyPair 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) Pow2 added in v1.1.1

func (d *PairFloat) Pow2() *PairFloat

Pow2 Returns the square of this 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) SelfAddPair added in v1.0.2

func (d *PairFloat) SelfAddPair(y *PairFloat) *PairFloat

SelfAddPair 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) SelfDividePair added in v1.0.2

func (d *PairFloat) SelfDividePair(y *PairFloat) *PairFloat

SelfDividePair 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) SelfPow2 added in v1.1.1

func (d *PairFloat) SelfPow2() *PairFloat

SelfPow2 Squares this object. 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) SelfSubtractPair added in v1.0.2

func (d *PairFloat) SelfSubtractPair(y *PairFloat) *PairFloat

SelfSubtractPair 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.

func (*PairFloat) Subtract added in v1.0.2

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

Subtract 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) SubtractPair added in v1.0.2

func (d *PairFloat) SubtractPair(y *PairFloat) *PairFloat

SubtractPair 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) Value added in v1.0.2

func (d *PairFloat) Value() float64

Value Converts this value to the nearest double-precision number.

Directories

Path Synopsis
Package angle define angel calculation function.
Package angle define angel calculation function.
Package bytevalues ead and write primitive datatypes from/to byte
Package bytevalues ead and write primitive datatypes from/to byte

Jump to

Keyboard shortcuts

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