Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Projects-3-Computer Graphics & Virtual Reality (algorithms, modeling, programs)

# Projects-3-Computer Graphics & Virtual Reality (algorithms, modeling, programs)

Ratings:

4.0

(1)
|Views: 938|Likes:
Projects-3-Computer Graphics & Virtual Reality (algorithms, modeling, programs)
Projects-3-Computer Graphics & Virtual Reality (algorithms, modeling, programs)

### Availability:

See more
See less

05/11/2014

pdf

text

original

Conf. Dr. Marin Vlada, Universitatea din Bucuresti

Grafica pe calculator / Geometrie computationala

Computer Graphics / Computation Geometry

Course: COMPUTER GRAPHICS | Bachelor of Science (
Computer Science

Conf. Dr. Marin Vlada, Universitatea din Bucuresti

PROIECT – generare curbe plane remarcabile
Nota: Codul in C++
,…, Grafica pe calculator in limbajele Pascal si C, vol. I,II, , Implementare si aplicatii,
Ed. Tehnica,1992
/*cout <<"*******************************************************"<<"\n";cout <<"
CURBE PLANE REMARCABILE
"<<"\n";cout <<" autor : M . Vlada "<<"\n";cout <<"*******************************************************"<<"\n";cout <<" 1 =concoida NICOMEDE 2 =melcul lui PASCAL "<<"\n";cout <<" 3 =cisoida DIOCLES 4 =cisoida elipsei "<<"\n";cout <<" 5 =trisectoarea MAC-LAURIN 6 =trisectoarea LONGCHAMPS"<<"\n";cout <<" 7 =cicloida 8 =epicicloida "<<"\n";cout <<" 9 =hipocicloida 10=astroida "<<"\n";cout <<" 11=strofoida 12=bucla MARIA AGNESI "<<"\n";cout <<" ( centrul ecranului = originea sistemului cartezian ) "<<"\n";cout <<"*******************************************************"<<"\n";*///{=========================================================}//program CURBE ;
curbe plane remarcabile - ecuatii parametrice
#include <graphics.h>#include <math.h>#include <iostream.h>#include <conio.h>#include <stdlib.h>#define pi M_PIdouble round(double number){double x = ceil(number)-number;if( number >= 0 ){if(x <= 0.5) return ceil(number);else return floor(number);}else{if(x < 0.5) return ceil(number);else return floor(number);}}char solid[8]={255,255,255,255,255,255,255,255};int graphdriver , graphmode;char ch;int graphX[740], graphY[740]; //array[-319..319] of integer;double a , b , arg , val1 , val2;int i , t1 , t2 , flag;//==========================================================void INIT(){graphdriver = DETECT;

Conf. Dr. Marin Vlada, Universitatea din Bucuresti

initgraph (&graphdriver ,&graphmode , "C:\\Borlandc\\bgi"); //initmod graficsetfillpattern ( solid , 15);bar ( 0,0 ,700,500 );setcolor( 0 ) ;setviewport ( 320 , 175 , 500 , 200 , 0 );//fixare originerectangle ( -150 , -150 , 150 , 150 ); //deseneaza un chenarsetviewport ( 170 , 25 , 470 , 325 , 1 ); //fixare fereastra}void STOP()//iesire din modul grafic{getch(); // inghetare imagineclosegraph(); // iesire mod grafic}void AXE()//------------// deseneaza axele (format mic) in origine{moveto ( 120 , 150 );lineto ( 180 , 150 );moveto ( 150 , 120 );lineto ( 150 , 180 );}void GRAPH1 (int t1 ,int t2)//------------------------------------------------//deseneaza curba data de ecuatiile parametrice// x = f (t) , y = g(t) pe intervalul [t1 ,t2]{int i;moveto ( graphX[t1+319] , graphY[t1+319] ) ; // fara trasarefor(i = t1+1; i <= t2; i++)lineto ( graphX [ i+319 ] , graphY [ i+319 ] );// trasare}//{----------------------------------------------------}// mainvoid main(){cout <<"*******************************************************"<<"\n";cout <<" CURBE PLANE REMARCABILE "<<"\n";cout <<" autor : M . Vlada "<<"\n";cout <<"*******************************************************"<<"\n";cout <<" 1 =concoida NICOMEDE 2 =melcul lui PASCAL "<<"\n";cout <<" 3 =cisoida DIOCLES 4 =cisoida elipsei "<<"\n";cout <<" 5 =trisectoarea MAC-LAURIN 6 =trisectoarea LONGCHAMPS"<<"\n";cout <<" 7 =cicloida 8 =epicicloida "<<"\n";cout <<" 9 =hipocicloida 10=astroida "<<"\n";cout <<" 11=strofoida 12=bucla MARIA AGNESI "<<"\n";cout <<" ( centrul ecranului = originea sistemului cartezian ) "<<"\n";cout <<"*******************************************************"<<"\n";cout <<" precizitati numarul de ordine pentru curba dorita : "<<"\n";cin >> flag;switch (flag){