Documentation ¶
Overview ¶
Package geometry contains geometric algorithms
Package geometry contains geometric algorithms
Index ¶
- Variables
- func Distance(a, b *Point) float64
- func EuclideanDistance(p1 EuclideanPoint, p2 EuclideanPoint) (float64, error)
- func IsParallel(l1, l2 *Line) bool
- func IsPerpendicular(l1, l2 *Line) bool
- func PointDistance(p *Point, equation [3]float64) float64
- func Slope(l *Line) float64
- func YIntercept(p *Point, slope float64) float64
- type EuclideanPoint
- type Line
- type Point
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDimMismatch = errors.New("mismatched dimensions")
Functions ¶
func EuclideanDistance ¶
func EuclideanDistance(p1 EuclideanPoint, p2 EuclideanPoint) (float64, error)
EuclideanDistance returns the Euclidean distance between points in any `n` dimensional Euclidean space.
func IsParallel ¶
IsParallel checks if two lines are parallel or not.
func IsPerpendicular ¶
IsPerpendicular checks if two lines are perpendicular or not.
func PointDistance ¶
PointDistance calculates the distance of a given Point from a given line. The slice should contain the coefficiet of x, the coefficient of y and the constant in the respective order.
func YIntercept ¶
YIntercept calculates the Y-Intercept of a line from a specific Point.
Types ¶
type EuclideanPoint ¶
type EuclideanPoint []float64
EuclideanPoint defines a point with x and y coordinates.
Click to show internal directories.
Click to hide internal directories.