#include "math/Vector.h"

template<>
Vector3& Vector3::setAngles(float lengthAngle, float widthAngle) {
    float sWidth = 0.0f;
    float cWidth = 0.0f;
    sincosf(widthAngle * (M_PI / 180.0f), &sWidth, &cWidth);

    float sLength = 0.0f;
    float cLength = 0.0f;
    sincosf(lengthAngle * (M_PI / 180.0f), &sLength, &cLength);

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

template<>
Vector3 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]);
}