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

Function IsParallel

math/geometry/straightlines.go:42–44  ·  view source on GitHub ↗

IsParallel checks if two lines are parallel or not.

(l1, l2 *Line)

Source from the content-addressed store, hash-verified

40
41// IsParallel checks if two lines are parallel or not.
42func IsParallel(l1, l2 *Line) bool {
43 return Slope(l1) == Slope(l2)
44}
45
46// IsPerpendicular checks if two lines are perpendicular or not.
47func IsPerpendicular(l1, l2 *Line) bool {

Callers 1

TestIsParallelFunction · 0.85

Calls 1

SlopeFunction · 0.85

Tested by 1

TestIsParallelFunction · 0.68