Documentation ¶
Overview ¶
Package math contins generic math functions that we need for doing transforms. this package will augment the go math library.
Index ¶
- Constants
- func AreaOfPolygon(p tegola.Polygon) (area float64)
- func AreaOfPolygonLineString(line tegola.LineString) (area float64)
- func DegToRad(deg float64) float64
- func DistOfLine(l tegola.LineString) (dist float64)
- func RadToDeg(rad float64) float64
- type Line
- type Pointer
- type Pt
- type WindingOrder
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func AreaOfPolygon ¶
AreaOfPolygon will calculate the Area of a polygon using the surveyor's formula (https://en.wikipedia.org/wiki/Shoelace_formula)
func AreaOfPolygonLineString ¶ added in v0.4.0
func AreaOfPolygonLineString(line tegola.LineString) (area float64)
func DistOfLine ¶ added in v0.4.0
func DistOfLine(l tegola.LineString) (dist float64)
DistOfLine will calculate the Manhattan distance of a line.
Types ¶
type Line ¶ added in v0.4.0
type Line [2]Pt
func (Line) Clamp ¶ added in v0.4.0
Clamp will return a point that is on the line based on pt. It will do this by restricting each of the coordiantes to the line.
func (Line) DistanceFromPoint ¶ added in v0.4.0
DistanceFromPoint will return the perpendicular distance from the point.
func (Line) ExInBetween ¶ added in v0.4.0
func (Line) InBetween ¶ added in v0.4.0
InBetween will check to see if the given point lies the line provided inbetween the endpoints.
func (Line) SlopeIntercept ¶ added in v0.4.0
SlopeIntercept will find the slop (if there is one) and the intercept of the two provided lines. If there isn't a slope because the lines are verticle, the slopeDefined will be false.
type Pt ¶ added in v0.4.0
Pt describes a 2d Point.
func DouglasPeucker ¶ added in v0.4.0
type WindingOrder ¶ added in v0.4.0
type WindingOrder uint8
WindingOrder the direction the line strings.
const ( Clockwise WindingOrder CounterClockwise )
func WindingOrderOf ¶ added in v0.4.0
func WindingOrderOf(sub []float64) WindingOrder
func WindingOrderOfLine ¶ added in v0.4.0
func WindingOrderOfLine(l tegola.LineString) WindingOrder
func (WindingOrder) IsClockwise ¶ added in v0.4.0
func (w WindingOrder) IsClockwise() bool
func (WindingOrder) IsCounterClockwise ¶ added in v0.4.0
func (w WindingOrder) IsCounterClockwise() bool
func (WindingOrder) Not ¶ added in v0.4.0
func (w WindingOrder) Not() WindingOrder
func (WindingOrder) String ¶ added in v0.4.0
func (w WindingOrder) String() string
Directories ¶
Path | Synopsis |
---|---|
Package webmercator does the translation to and from WebMercator and WGS84 Gotten from: http://wiki.openstreetmap.org/wiki/Mercator#C.23
|
Package webmercator does the translation to and from WebMercator and WGS84 Gotten from: http://wiki.openstreetmap.org/wiki/Mercator#C.23 |