require("lualibs.vec2")
require("lualibs.vec3")


function length(v)
	if (v.z) then
		return length3(v)
	else
		return length2(v)
	end

end

function dot(a,b)
	if (a.z and b.z) then
		return dot3(a,b)
	else
		return dot2(a,b)
	end
end

function cross(a,b)
	print("may not work!")
	--return a.x*b.y - a.y*b.x
end

function normalize(v)
	if (v.z) then
		return normalize3(v)
	else
		return normalize2(v)
	end
end

function abs(v)
	if (v.z) then
		return abs3(v)
	else
		return abs2(v)
	end
end

function vecstr(v)
	if (v.z) then
		return vecstr3(v)
	else
		return vecstr2(v)
	end
end
