Documentation ¶
Overview ¶
Package arithm implements points, affine transformations, arithmetic for polynomials, and a linear equations solver.
BSD License ¶
Copyright (c) 2017–21, Norbert Pillmayer ¶
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of this software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index ¶
- Variables
- func Is0(n float64) bool
- func Is1(n float64) bool
- func Round(n float64) float64
- func T() tracing.Trace
- func Zap(n float64) float64
- type AT
- type Pair
- func (p Pair) C() complex128
- func (p Pair) Equal(p2 Pair) bool
- func (p Pair) F() (float64, float64)
- func (p Pair) IsOrigin() bool
- func (p Pair) Rotated(theta float64) Pair
- func (p Pair) Rotatedaround(v Pair, theta float64) Pair
- func (p Pair) Scaled(a float64) Pair
- func (p Pair) Shifted(v Pair) Pair
- func (p Pair) String() string
- func (p Pair) X() float64
- func (p Pair) XScaled(a float64) Pair
- func (p Pair) Y() float64
- func (p Pair) YScaled(a float64) Pair
- func (p Pair) Zap() Pair
Constants ¶
This section is empty.
Variables ¶
var Deg2Rad float64 = 0.01745329251
Deg2Rad is a constant for converting from DEG to RAD or vice versa
var Epsilon float64 = 0.0000001
Epsilon : numbers below ε are considered 0
var Origin = P(float64(0), float64(0))
Origin represents the frequently used constant (0,0).
Functions ¶
Types ¶
type AT ¶
type AT []float64 // a 3x3 matrix, flattened by rows
AT is an affine transform, a matrix type used for transforming vectors.
func Rotation ¶
Rotation transform. Rotate a point counter-clockwise around the origin. Argument is in radians.
type Pair ¶
type Pair complex128
Pair is an interface for pairs / 2D-points
func (Pair) Rotatedaround ¶
Rotatedaround returns a new pair rotated around v by theta (counterclockwise).
Directories ¶
Path | Synopsis |
---|---|
Package jhobby deals with MetaFont/MetaPost-like paths.
|
Package jhobby deals with MetaFont/MetaPost-like paths. |
Package polygon deals with polygons, ie paths with straight lines.
|
Package polygon deals with polygons, ie paths with straight lines. |
Package polyn is for arithmetic with linear polynomials and linear equations.
|
Package polyn is for arithmetic with linear polynomials and linear equations. |