mirror of
https://github.com/gonum/gonum.git
synced 2025-10-08 08:30:14 +08:00
spatial/r3: implement Vec.Dot
This commit is contained in:
@@ -33,6 +33,11 @@ func (p Vec) Scale(f float64) Vec {
|
||||
return p
|
||||
}
|
||||
|
||||
// Dot returns the dot product p·q.
|
||||
func (p Vec) Dot(q Vec) float64 {
|
||||
return p.X*q.X + p.Y*q.Y + p.Z*q.Z
|
||||
}
|
||||
|
||||
// Box is a 3D bounding box.
|
||||
type Box struct {
|
||||
Min, Max Vec
|
||||
|
Reference in New Issue
Block a user