Documentation ¶
Overview ¶
Package trig implements various trigonometrical calculations.
Index ¶
- Constants
- func CircleAngleAtPoint(point, mid image.Point) int
- func CirclePointAtAngle(degrees int, mid image.Point, radius int) image.Point
- func FilterByAngle(points []image.Point, mid image.Point, start, end int) ([]image.Point, error)
- func PointIsIn(p image.Point, points []image.Point) bool
- func RangeMid(start, end int) (int, error)
- func RangeSize(start, end int) (int, error)
Constants ¶
const ( // MinAngle is the smallest valid angle in degrees. MinAngle = 0 // MaxAngle is the largest valid angle in degrees. MaxAngle = 360 )
Variables ¶
This section is empty.
Functions ¶
func CircleAngleAtPoint ¶
CircleAngleAtPoint given a point on a circle and its midpoint, calculates the angle in degrees. Angles are zero at the X axis and grow counter-clockwise.
func CirclePointAtAngle ¶
CirclePointAtAngle given an angle in degrees and a circle midpoint and radius, calculates coordinates of a point on the circle at that angle. Angles are zero at the X axis and grow counter-clockwise.
func FilterByAngle ¶
FilterByAngle filters the provided points, returning only those that fall within the starting and the ending angle on a circle with the provided mid point.
func PointIsIn ¶
PointIsIn asserts whether the provided point is inside of a shape outlined with the provided points. Does not verify that the shape is closed or complete, it merely counts the number of intersections with the shape on one row.
Types ¶
This section is empty.