Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

testcirc.c File Reference

#include <stdio.h>
#include "posemath.h"

Include dependency graph for testcirc.c:

Include dependency graph

Go to the source code of this file.

Functions

int main ()


Function Documentation

int main  
 

Definition at line 15 of file testcirc.c.

00016 {
00017   double incr;
00018 
00019   PmCircle circle;
00020   PmPose start, end;
00021   PmCartesian center, normal;
00022   int turn;
00023   PmPose out;
00024 
00025   printf("start: ");
00026   fflush(stdout);
00027   scanf("%lf %lf %lf", &start.tran.x, &start.tran.y, &start.tran.z);
00028   start.rot.s = 1.0;
00029   start.rot.x = 0.0;
00030   start.rot.y = 0.0;
00031   start.rot.z = 0.0;
00032 
00033   printf("end: ");
00034   fflush(stdout);
00035   scanf("%lf %lf %lf", &end.tran.x, &end.tran.y, &end.tran.z);
00036   end.rot.s = 1.0;
00037   end.rot.x = 0.0;
00038   end.rot.y = 0.0;
00039   end.rot.z = 0.0;
00040 
00041   printf("center: ");
00042   fflush(stdout);
00043   scanf("%lf %lf %lf", &center.x, &center.y, &center.z);
00044 
00045   printf("normal: ");
00046   fflush(stdout);
00047   scanf("%lf %lf %lf", &normal.x, &normal.y, &normal.z);
00048 
00049   printf("turns: ");
00050   fflush(stdout);
00051   scanf("%d", &turn);
00052 
00053   pmCircleInit(&circle, start, end, center, normal, turn);
00054 
00055   printf("radius: %f\n", circle.radius);
00056   printf("angle: %f\n", circle.angle);
00057   printf("spiral: %f\n", circle.spiral);
00058   printf("rTan: %f %f %f\n", circle.rTan.x, circle.rTan.y, circle.rTan.z);
00059   printf("rPerp: %f %f %f\n", circle.rPerp.x, circle.rPerp.y, circle.rPerp.z);
00060   printf("rHelix: %f %f %f\n", circle.rHelix.x, circle.rHelix.y, circle.rHelix.z);
00061   return 0;
00062 
00063   if (turn >= 0)
00064     {
00065       for (incr = 0.0; incr <= circle.angle; incr += circle.angle / 100.0)
00066         {
00067           pmCirclePoint(&circle, incr, &out);
00068           printf("%f %f %f\n", out.tran.x, out.tran.y, out.tran.z);
00069         }
00070     }
00071   else
00072     {
00073       for (incr = 0.0; incr >= circle.angle; incr += circle.angle / 100.0)
00074         {
00075           pmCirclePoint(&circle, incr, &out);
00076           printf("%f %f %f\n", out.tran.x, out.tran.y, out.tran.z);
00077         }
00078     }
00079 
00080   return 0;
00081 }


Generated on Sun Dec 2 15:58:01 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001