当前位置: 首页>>代码示例>>C++>>正文


C++ vector2::get方法代码示例

本文整理汇总了C++中vector2::get方法的典型用法代码示例。如果您正苦于以下问题:C++ vector2::get方法的具体用法?C++ vector2::get怎么用?C++ vector2::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vector2的用法示例。


在下文中一共展示了vector2::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{
    freopen ("in.txt", "r", stdin);

    int n, m, x, y, z, p;

    scanf ("%d %d %d %d %d %d", &n, &m, &x, &y, &z, &p);

    x %= 4;
    y %= 2;
    z %= 4;

    center = vector2((float)(n) / 2.0f, (float) (m) / 2.0f);

    vector2 v;
    vector2 location;

    printf ("center: "); center.print_debug();

    for (int i = 0; i < p; i++)
    {
        input.get();

        if (input.x < center.x)
            input.x += 0.5f;
        else if (input.x > center.x)
            input.x -= 0.5f;

        if (input.y < center.y)
            input.y += 0.5f;
        else if (input.y > center.y)
            input.y -= 0.5f;

        printf ("input: "); input.print_debug();

        v.x = input.x - center.x;
        v.y = input.y - center.y;

        printf ("v: "); v.print_debug();

        v.clockwise(x);

        v.print_debug();

        input.x = v.x + center.x;
        input.y = v.y + center.y;

        if (y > 0 && !cmp (input.y, center.y))
            input.y = center.y - input.y + center.y;

        v.x = input.x - center.x;
        v.y = input.y - center.y;

        v.counter_clockwise(z);

        location.x = center.x + v.x;
        location.y = center.y + v.y;

        location.print_debug();
    }

    return 0;
}
开发者ID:elvircrn,项目名称:ccppcodes,代码行数:63,代码来源:C+(17).cpp


注:本文中的vector2::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。