예제 #1
0
파일: main.c 프로젝트: hugonomura/CG2
int main(){

	Ponto P1,P2,P3,P4,P5;
	float dx,dy,dz,sx,sy,ang;
	struct matriz M,N;

	//Pontos:
	P1.x=3; P1.y=3; P1.z=3; P1.w=1;
	P2.x=6; P2.y=3;
	P3.x=6; P3.y=6;
	P4.x=4.5; P4.y=8;
	P5.x=3; P5.y=6;

	//Matriz translaçao: foi utilizada na funcao translaçao2, dx=dy=dz=3
	M.a11=1;M.a12=0;M.a13=0;M.a14=3;
	M.a21=0;M.a22=1;M.a23=0;M.a24=3;
	M.a31=0;M.a32=0;M.a33=1;M.a34=3;
	M.a41=0;M.a42=0;M.a43=0;M.a44=3;

	//Matriz escalonamento: foi utilizada na funcao escalonamento, sx=2,sy=3,sz=4
	M.a11=2;M.a12=0;M.a13=0;M.a14=0;
	M.a21=0;M.a22=3;M.a23=0;M.a24=0;
	M.a31=0;M.a32=0;M.a33=4;M.a34=0;
	M.a41=0;M.a42=0;M.a43=0;M.a44=1;

	translacao(&P1,3,3,3);
	translacao2(&P1,&M);
	escalona(&P1,&M);

}
int main(void){
	tarefa agenda[tar];
	int i;

	i=0;
	while(i<tar){
		scanf("%d %d %d",&agenda[i].tarefa, &agenda[i].Ti, &agenda[i].Tf);
		i++;
	}
	i=0;
	while(i<tar){
		printf("%d %d %d\n",agenda[i].tarefa, agenda[i].Ti, agenda[i].Tf);
		i++;
	}

	printf("-------------------------------------\n");
	escalona(agenda);
	printf("-------------------------------------\n");
	escalonatudo(agenda);

	return 0;
}
예제 #3
0
파일: Lista3_ex2.c 프로젝트: hugonomura/CG2
int main() {
    Ponto P1,P2,P3,P4,P5;
    float dx,sx,sy,ang;

    //Pontos:
    P1.x=3;
    P1.y=3;
    P1.w=1;
    P2.x=6;
    P2.y=3;
    P3.x=6;
    P3.y=6;
    P4.x=4.5;
    P4.y=8;
    P5.x=3;
    P5.y=6;

    translacao(&P1,3,3);
    escalona(&P1,2,3);
    rotacao(&P1,90);
    espelhaX(&P1);
    espelhaY(&P1);
    espelhaXY(&P1);
}