func (vec *T) Scale(f float64) *T {
	vec[0] *= f
	vec[1] *= f
	vec[2] *= f
	return vec
}
Scale multiplies all element of the vector by f and returns vec.
package vec3
import (
	"fmt"
	"math"
	"github.com/ungerik/go3d/float64/generic"
)
var (
	Zero = T{}
	UnitX = T{1, 0, 0}
	UnitY = T{0, 1, 0}
	UnitZ = T{0, 0, 1}
	UnitXYZ = T{1, 1, 1}
	Red = T{1, 0, 0}
	Green = T{0, 1, 0}
	Blue = T{0, 0, 1}
	Black = T{0, 0, 0}
	White = T{1, 1, 1}
	MinVal = T{-math.MaxFloat64, -math.MaxFloat64, -math.MaxFloat64}
	MaxVal = T{+math.MaxFloat64, +math.MaxFloat64, +math.MaxFloat64}
)
type T [3]float64
func From(other generic.T) T {
	switch other.Size() {
	case 2:
		return T{other.Get(0, 0), other.Get(0, 1), 0}
	case 3, 4:
		return T{other.Get(0, 0), other.Get(0, 1), other.Get(0, 2)}
	default:
		panic("Unsupported type")
	}
}
func Parse(s string) (r T, err error) {
	_, err = fmt.Sscan(s, &r[0], &r[1], &r[2])
	return r, err
}
func (vec *T) String() string {
	return fmt.Sprint(vec[0], vec[1], vec[2])
}
func (vec *T) Rows() int {
	return 3
}
func (vec *T) Cols() int {
	return 1
}
func (vec *T) Size() int {
	return 3
}
func (vec *T) Slice() []float64 {
	return vec[:]
}
func (vec *T) Get(col, row int) float64 {
	return vec[row]
}
func (vec *T) IsZero() bool {
	return vec[0] == 0 && vec[1] == 0 && vec[2] == 0
}
func (vec *T) Length() float64 {
	return math.Sqrt(vec.LengthSqr())
}
func (vec *T) LengthSqr() float64 {
	return vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]
}