MCPcopy Index your code
hub / github.com/fogleman/ln / MulDirection

Method MulDirection

ln/matrix.go:148–153  ·  view source on GitHub ↗
(b Vector)

Source from the content-addressed store, hash-verified

146}
147
148func (a Matrix) MulDirection(b Vector) Vector {
149 x := a.x00*b.X + a.x01*b.Y + a.x02*b.Z
150 y := a.x10*b.X + a.x11*b.Y + a.x12*b.Z
151 z := a.x20*b.X + a.x21*b.Y + a.x22*b.Z
152 return Vector{x, y, z}.Normalize()
153}
154
155func (a Matrix) MulRay(b Ray) Ray {
156 return Ray{a.MulPosition(b.Origin), a.MulDirection(b.Direction)}

Callers 1

MulRayMethod · 0.95

Calls 1

NormalizeMethod · 0.80

Tested by

no test coverage detected