#include "math/Vector.h"

template<>
Core::Vector3& Core::Vector3::setAngles(float lengthAngle, float widthAngle) {
    float sWidth = 0.0f;
    float cWidth = 0.0f;
    Core::Math::sinCos(Math::degreeToRadian(widthAngle), sWidth, cWidth);

    float sLength = 0.0f;
    float cLength = 0.0f;
    Core::Math::sinCos(Math::degreeToRadian(lengthAngle), sLength, cLength);

    return *this = Vector3(cWidth * cLength, sWidth, -sLength * cWidth);
}

template<>
Core::Vector3 Core::Vector3::cross(const Vector3& other) const {
    return Vector3(values[1] * other.values[2] - values[2] * other.values[1],
                   values[2] * other.values[0] - values[0] * other.values[2],
                   values[0] * other.values[1] - values[1] * other.values[0]);
}