Mercurial > 3de
view rotate.c @ 18:22df18cf00c3
Move pentagon to xy-plane - updated to use new render engine
author | Josef "Jeff" Sipek <jeffpc@optonline.net> |
---|---|
date | Sat, 03 Dec 2005 00:32:38 -0500 |
parents | 51e9b6b85edd |
children | ebc55ce699ec |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> void rotate_header(float omega, float phi, float rho) { printf("%f %f %f\n" "%f %f %f\n" "%f %f %f", cos(phi)*cos(rho), cos(rho)*sin(omega)*sin(phi)-cos(omega)*sin(rho), cos(omega)*cos(rho)*sin(phi)+sin(omega)*sin(rho), cos(phi)*sin(rho), cos(omega)*cos(rho)+sin(omega)*sin(phi)*sin(rho), -cos(rho)*sin(omega)+cos(omega)*sin(phi)*sin(rho), -sin(phi), cos(phi)*sin(omega), cos(omega)*cos(phi)); } int main(int argc, char** argv) { float omega, phi, rho; char c; scanf("%f %f %f", &omega, &phi, &rho); rotate_header(omega, phi, rho); while((c = getc(stdin)) != EOF) putc(c, stdout); return 0; }