/*
          __
         / /_______________  ____  ___
        / __/ ___/ ___/ __ \/ __ \/ _ \
       / /_(__  ) /__/ /_/ / /_/ /  __/
       \__/____/\___/\____/ .___/\___/
                         /_/

    coordinates1.c
    usage of the Cartesian coordinate system
*/

#include <tscope.h>

int main()
{
    ts_scrsize(SIZE1);

    // cartesian coordinates - this is the default system
    ts_printf_centre(0, 150, "with the cartesian coordinate system");
    ts_printf_centre(0, 130, "(0,0) will be the centre of the screen");
    ts_circle(0, 0, 5);

    ts_printf_centre(75, 75, "(+,+)");
    ts_printf_centre(75, -75, "(+,-)");
    ts_printf_centre(-75, 75, "(-,+)");
    ts_printf_centre(-75, -75, "(-,-)");
    ts_line(0, 100, 0, -100);
    ts_line(100, 0, -100, 0);

    ts_printf_centre(0, -120,
                     "positive X coordinates will be to the right of the screen centre");
    ts_printf_centre(0, -140,
                     "negative X coordinates will be to the left of the screen centre");
    ts_printf_centre(0, -160,
                     "positive Y coordinates will be above the screen centre");
    ts_printf_centre(0, -180,
                     "negative Y coordinates will be below the screen centre");

    ts_button(XMAX - 20, -YMAX + 20);

    // XMAX and YMAX macro's
    ts_clrscr();
    ts_printf_centre(0, 100, "the macros XMAX and YMAX contain the");
    ts_printf_centre(0, 80,
                     "horizontal and vertical sizes of each quadrant");
    ts_circle(XMAX, YMAX, 20);
    ts_circle(-XMAX, -YMAX, 20);
    ts_button(XMAX - 20, -YMAX + 20);

    ts_printf_centre(0, 40,
                     "these values can be used to compute the coordinates of your stimuli");
    ts_line(XMAX / 2, YMAX / 2, XMAX, YMAX);
    ts_line(-XMAX / 2, -YMAX / 2, -XMAX, -YMAX);
    ts_button(XMAX - 20, -YMAX + 20);

    // ax and ay functions
    ts_printf_centre(0, 0,
                     "similar things can be done with the functions ax and ay");
    ts_line(ax(.5), -ay(.5), ax(1), -ay(1));
    ts_line(-ax(.5), ay(.5), -ax(1), ay(1));

    ts_button(XMAX - 20, -YMAX + 20);
    return 0;
}

END_OF_MAIN();


top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information