Computer program for the tracing of however sinuous curves

The ideea to realize this program appeared when the A4 paper sheet for the labyrinth psychological test needed to be copyed. The test comprises the visual tracking of a curves set, everyone starting from a certain point placed on the left side of a rectangle and reaching, everyone, a certain point located in the right side of the same rectangle. The X axis coordinate of the curves start points is the same for all of them but the Y axis coordinate is located at equal distances for every two consecutive start points. The same for the points where the curves are reaching. The number of start points is the same with the reaching points and is equal with the number of curves. The test verifies the athletes ability to visualy tracking the curves, without using an indicator, as a pencil and deciding the reaching point mi of a curve i starting from the point ni , where i=1…n, n beeing the number of curves.

A question naturally arises: why we have not used the photocopying as the method of copy? The answer, simply in fact and given by the practical aspect of the problem, is that the A4 paper sheet becomed insufficiently clear due to repeted photocopying and the curves reproducing accuracy must be enough good that the human eye to be not influenced by eventualy imperfections of the curves intersection points and their paths also.

Theoreticaly there are three ways to redraw the test:

-Manualy, excluded because the repeated contact between the operators hand and the paper sheet whoud rapidly lead to the test degradation.

-The using of a specialized program, like Corel Draw, for the curves drawing could be a good ideea but implies a great financial investment, Corel Draw package beeing extremely expensive and finaly beeing unable to exclude the esential operations of the curves editing.

-Developing an interactive graphic drawing program able to simulate the milimetric paper on the computer display and allowing the usual funtions of an editor: insert, modify, delete, replace and magnification. Also a further develop of the program will follow the direction need by the user.

It has been decided to chosethe last alternative. The program starts from a points set witch approximately chracterize every curve, and join them by tangent arcs ones following the others. Witch are the points characterizing the path of a curve? It can be taken into account the points of extrem, inflection and also the intersection points. The last ones could be named control points. Because the start points set for a certain curve can not be exactly determined and the aproximation method by arcs also leads to imperfections it compulsory arises the need to edit and modify the start points set. By interactive and recursive modifying, of course graphicaly, the points set witch aproximately characterize a curve we can finaly obtain the points set witch acurately, at least for the human eye, characterize this curve. The action flows recursively in a certain curve points set as in the entire curves set.

The program was developed with Visual C++.Net 2003 and uses MFC clases. The database with the points sets is kept simply in a text file.

- 1 -

Program pe calculator pentru trasarea curbelor oricat de sinuoase

Ideea de a realiza acest program a pornit de la necesitatea de a copia testul psihologic de urmarire dinamica. Testul constă din urmarirea vizuala a traseului unui set de curbe ce pleaca fiecare dintr-un punct determinat, situat, in principiu, in partea stanga a unei coli A4 si ajunge fiecare intr-un punct determinat situat in partea dreapta a unei coli A4 traseul fiecarei curbe incadrandu-se intr-un dreptunghi. Coordonata pe axa X a punctelor din care pleca curbele este aceeasi pentru toate acestea, iar coordonata pe axa Y este situata la distante egale pentru fiecare doua puncte consecutive. La fel pentru punctele in care ajung curbele. Numarul punctelor din care pleca curbele este acelas cu numarul de puncte in care ajung si este egal cu numarul de curbe.Testul verifica abilitatea sportivilor de a urmari vizual curbele, fara a folosi un indicator cum este varful creionului si a decide in ce punct miajunge o curba i plecata dintr-un punct ni, unde i=1…nr_curbe.

Apare in mod firesc intrebarea de ce nu s-a utilizat xeroxarea ca metoda de copiere. Raspunsul, foarte simplu, este acela ca pagina initiala a testului s-a pierdut iar testul copiat de mai multe ori prin xeroxare s-a degradat foarte mult ca imagine. Precizia necesara reproducerii curbelor este foarte mare intrucat conteaza extrem de mult pozitia punctelor in care se intersecteaza curbele si acuratetea traseelor acestora.

Exista teoretic mai multe cai de refacere:

-Refacerea manuala este practic imposibila datorita faptului ca ar implica contactul repetat al mainii desenatorului cu pagina testului ceea ce ar duce la degradarea rapida a foii de test.

-Folosirea unui program specializat, gen Corel Draw pentru trasarea curbelor. Este o idee destul de buna dar implica investitii initiale destul de mari, pachetul Corel Draw fiind extrem de scump, oferind functii care in cazul de fata nu sunt neaparat necesare.

-Realizarea unui program de trasare grafica interactiva care sa simuleze pe ecran hartia milimetrica, si sa permita utilizarea functiilor obisnuite de editare: inserare, modificare, stergere, marire si micsorare imagine. In plus programul poate fi dezvoltat pe directia in care se doreste.

S-a optat pentru ultima varianta. Programul porneste de la un set de puncte care determina aproximativ fiecare curba si le uneste prin arce de cerc tangente unele in continuarea celorlalte. Punctele pot fi obtinute prin orice metoda de discretizare sau prin introducere manuala. Se pune intrebarea care este setul de puncte determinante ale formei unei curbe.Se poate considera ca setul de puncte determinante ale fiecarei curbe sunt, cel putin, punctele de extrem, inflexiune precum si punctele de intersectie ale curbelor care se mai pot numi si puncte de control. Deoarece punctele din setul de pornire pentru fiecare curba nu poate fi determinat perfect iar metoda de aproximare prin arce de cerc implica la randul ei unele imprecizii apare in mod obligatoriu necesitatea editarii setului de puncte care determina fiecare curba. Prin modificarea interactiva si recursiva, in mod grafic, a setului determinant de puncte pentru fiecare curba se ajunge in final la setul de puncte care o determina in mod precis. Trasarea corecta a unei curbe poate duce la modificarea curbelor trasate anterior.

Programul este scris in Visual C++.Net 2003 si foloseste clasele de functii specifice MFC. Baza de date cu seturile de puncte este pastrata intr-un fisier de tip text.

- 1 -