normalizePow

taichi_glsl.vector.normalizePow(v, n, eps=0)

Return a vector with same direction but with a n-powered length.

This can be used in calculating gravitational force or speed around vortex.

Parameters
  • v – Specifies the vector to normalize.

  • n – Specifies the power number to tweak the length.

Returns

The return value can be calculated as normalize(v) * length(v) ** n.