MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / YIntercept

Function YIntercept

math/geometry/straightlines.go:37–39  ·  view source on GitHub ↗

YIntercept calculates the Y-Intercept of a line from a specific Point.

(p *Point, slope float64)

Source from the content-addressed store, hash-verified

35
36// YIntercept calculates the Y-Intercept of a line from a specific Point.
37func YIntercept(p *Point, slope float64) float64 {
38 return p.Y - (slope * p.X)
39}
40
41// IsParallel checks if two lines are parallel or not.
42func IsParallel(l1, l2 *Line) bool {

Callers 1

TestInterceptFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestInterceptFunction · 0.68