MCPcopy Index your code
hub / github.com/EngoEngine/engo / Normal

Method Normal

math.go:371–378  ·  view source on GitHub ↗

Normal returns the left hand normal of the line segment l

()

Source from the content-addressed store, hash-verified

369
370// Normal returns the left hand normal of the line segment l
371func (l *Line) Normal() Point {
372 dx := l.P2.X - l.P1.X
373 dy := l.P2.Y - l.P1.Y
374 inverse := Point{dy, -dx}
375 unit, _ := inverse.Normalize()
376
377 return unit
378}
379
380// IdentityMatrix returns a new identity matrix.
381func IdentityMatrix() *Matrix {

Callers 1

TestLineNormalFunction · 0.80

Calls 1

NormalizeMethod · 0.95

Tested by 1

TestLineNormalFunction · 0.64