2d游戏中求出一个向量的两个垂直向量

function cc.exports.VerticalVector(vec)--求出两个垂直向量

    local result = {}

    result[1] = cc.p(vec.y/vec.x,-1)--向下方向

    result[2] = cc.p(-vec.y/vec.x,1)--向上方向

    return result

end

原文地址:https://www.cnblogs.com/HemJohn/p/4817072.html