MCPcopy Create free account
hub / github.com/angular/components / getSlope

Function getSlope

src/cdk/menu/menu-aim.ts:66–68  ·  view source on GitHub ↗

Calculate the slope between point a and b.

(a: Point, b: Point)

Source from the content-addressed store, hash-verified

64
65/** Calculate the slope between point a and b. */
66function getSlope(a: Point, b: Point) {
67 return (b.y - a.y) / (b.x - a.x);
68}
69
70/** Calculate the y intercept for the given point and slope. */
71function getYIntercept(point: Point, slope: number) {

Callers 1

_isMovingToSubmenuMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected