gcs4.h

0000/**********************************************************************
0001 gcs4.h
0002
0003 3D Geometry Utility
0004**********************************************************************/
0005
0006struct Point2d{
0007 double x;
0008 double y;
0009};
0010
0011typedef struct Point2d Point2d;
0012
0013struct Point3d{
0014 double x;
0015 double y;
0016 double z;
0017};
0018
0019typedef struct Point3d Point3d;
0020
0021struct Line2d{
0022 double sx;
0023 double sy;
0024 double ex;
0025 double ey;
0026};
0027
0028typedef struct Line2d Line2d;
0029
0030struct Line3d{
0031 double sx;
0032 double sy;
0033 double sz;
0034 double ex;
0035 double ey;
0036 double ez;
0037};
0038
0039typedef struct Line3d Line3d;
0040
0041struct TransAngleEuler{
0042 double x;
0043 double y;
0044 double z;
0045 double theta;
0046 double phi;
0047 double psi;
0048};
0049
0050typedef struct TransAngleEuler TransAngleEuler;
0051
0052struct TransAngleMatrix{
0053 double x;
0054 double y;
0055 double z;
0056 double c[3][3];
0057};
0058
0059typedef struct TransAngleMatrix TransAngleMatrix;
0060
0061struct AngleEuler{
0062 double theta;
0063 double phi;
0064 double psi;
0065};
0066
0067typedef struct AngleEuler AngleEuler;
0068
0069struct AngleMatrix{
0070 double c[3][3];
0071};
0072
0073typedef struct AngleMatrix AngleMatrix;
0074
0075enum whichAxis{
0076 xAxis,
0077 yAxis,
0078 zAxis,
0079 yzAxis,
0080 zxAxis,
0081 xyAxis
0082};
0083
0084//typedef enum whichAxis whichAxis;
0085
0086void DegreeToTAE(double theta,double phi,double psi,TransAngleEuler *dest);
0087void DegreeToAE(double theta,double phi,double psi,AngleEuler *dest);
0088void LinesToTAM(Line3d *a,Line3d *b,int w,TransAngleMatrix *dest);
0089void LinesToTAE(Line3d *a,Line3d *b,int w,TransAngleEuler *dest);
0090void PointsToAM(Point3d *a,Point3d *b,int w,AngleMatrix *dest);
0091void PointsToAE(Point3d *a,Point3d *b,int w,AngleEuler *dest);
0092void NormLine3d(Line3d *source,Point3d *dest,double *norm);
0093void NormPoint3d(Point3d *source,Point3d *dest,double *norm);
0094void NormLine2d(Line2d *source,Point2d *dest,double *norm);
0095void NormPoint2d(Point2d *source,Point2d *dest,double *norm);
0096void TAEtoTAM(TransAngleEuler *source,TransAngleMatrix *dest);
0097void TAMtoTAE(TransAngleMatrix *source,TransAngleEuler *dest);
0098void InverseTAM(TransAngleMatrix *source,TransAngleMatrix *dest);
0099void BodyToFrameTAM(Point3d *source,TransAngleMatrix *m,Point3d *dest);
0100void FrameToBodyTAM(Point3d *source,TransAngleMatrix *m,Point3d *dest);
0101void MoveTwiceTAE(TransAngleEuler *src1,TransAngleEuler *src2,TransAngleEuler *dest);
0102void AEtoAM(AngleEuler *source,AngleMatrix *dest);
0103void BodyToFrameAM(Point3d *source,AngleMatrix *m,Point3d *dest);
0104void FrameToBodyAM(Point3d *source,AngleMatrix *m,Point3d *dest);
0105void BodyToFrameAMP(Point2d *source,AngleMatrix *m,Point2d *dest);
0106void FrameToBodyAMP(Point2d *source,AngleMatrix *m,Point2d *dest);
0107void ToPolar3d(Point3d *source,Point2d *dest);
0108void ToCartesian3d(Point2d *source,Point3d *dest);
0109void VectorProduct(Point3d *u,Point3d *v,Point3d *w);
0110int AcuteAngle(Point3d *u,Point3d *v,Point3d *w);
0111