Discover Packages
github.com/TheAlgorithms/Go
math
geometry
package
Version:
v0.0.3-alpha
Opens a new window with list of versions in this module.
Published: Nov 9, 2021
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Calculates the shortest distance between two points.
Calculates the Y-Intercept of a line from a specific Point.
Checks if two lines are parallel or not.
Checks if two lines are perpendicular or not.
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.
Calculates the slope (gradient) of a line.
type Line struct {
P1, P2 Point
}
Defines a point with x and y coordinates.
Calculates the Point that divides a line in specific ratio.
DO NOT specify the ratio in the form m:n, specify it as r, where r = m / n.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.