MCPcopy
hub / github.com/tdewolff/canvas / PerpDot

Method PerpDot

util.go:312–314  ·  view source on GitHub ↗

PerpDot returns the perp dot product between OP and OQ, i.e. zero if aligned and |OP|*|OQ| if perpendicular. This is the cross product in two dimensions.

(q Point)

Source from the content-addressed store, hash-verified

310
311// PerpDot returns the perp dot product between OP and OQ, i.e. zero if aligned and |OP|*|OQ| if perpendicular. This is the cross product in two dimensions.
312func (p Point) PerpDot(q Point) float64 {
313 return p.X*q.Y - p.Y*q.X
314}
315
316// Length returns the length of OP.
317func (p Point) Length() float64 {

Callers 15

TestPointFunction · 0.95
AngleBetweenMethod · 0.95
SimplifyMethod · 0.80
LineToMethod · 0.80
ellipseCurvatureRadiusFunction · 0.80
flattenQuadraticBezierFunction · 0.80
flattenSmoothCubicBezierFunction · 0.80
AreaMethod · 0.80
CentroidMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestPointFunction · 0.76