コード例 #1
0
ファイル: Vector_Test.cpp プロジェクト: ossama-othman/MaRC
/**
 * @test Test MaRC::Vector magnitude (norm) calculation.
 */
bool test_vector_magnitude()
{
    using vector_type = MaRC::Vector<int, 3>;
    vector_type const v{ 3, 4, 5 };

    double const mag =
        std::sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);

    return MaRC::almost_equal(v.magnitude(), mag, ulps);
}