00001
00002 #ifndef jAPIvectorielsH
00003 #define jAPIvectorielsH
00004
00005
00006 #include <vector.h>
00007 #include <math.h>
00008 #include <stdio.h>
00009
00010 double __fastcall jMATnorme(TPoint deb, TPoint fin) { return sqrt((fin.x-deb.x)*(fin.x-deb.x)+(fin.y-deb.y)*(fin.y-deb.y)); }
00011 double __fastcall jMATangle(TPoint deb, TPoint origine, TPoint fin);
00012 double __fastcall jMATlength(TPoint p) { return sqrt(p.x*p.x+p.y*p.y); }
00013
00014 bool __fastcall jDRWpoint(TCanvas * cv, TPoint p, int size);
00015 bool __fastcall jDRWrectangle(TCanvas * cv, int x1, int y1, int x2, int y2);
00016
00017 bool __fastcall jVCTcopy(vector <TPoint> * src, vector <TPoint> * dst);
00018
00019 bool __fastcall jVCTrotation(const TPoint point, TPoint & dst, const TPoint origine, double angle);
00020 bool __fastcall jVCTrotation(const TPoint & point, const TPoint origine, double angle);
00021
00022 bool __fastcall jVCTstretch(vector <TPoint> * src, vector <TPoint> * dst, TPoint origine, double coeffx, double coeffy);
00023 bool __fastcall jVCTstretch(vector <TPoint> * v, TPoint origine, double coeffx, double coeffy);
00024
00025 bool __fastcall jVCTrotate(vector <TPoint> * src, vector <TPoint> * dst, TPoint origine, double angle);
00026 bool __fastcall jVCTrotate(vector <TPoint> * v, TPoint origine, double angle);
00027
00028 bool __fastcall jVCTmove(vector <TPoint> * src, vector <TPoint> * dst, int x, int y);
00029 bool __fastcall jVCTmove(vector <TPoint> * v, int x, int y);
00030 TRect __fastcall jVCTzone(vector <TPoint> * v);
00031 bool __fastcall jVCTmove(vector <TPoint> * src, vector <TPoint> * dst, TPoint p);
00032 bool __fastcall jVCTmove(vector <TPoint> * v, TPoint p);
00033
00034 bool __fastcall jVCTfetch(vector <TPoint> * src, vector <TPoint> * dst, TRect zone);
00035 bool __fastcall jVCTfetch(vector <TPoint> * v, TRect zone);
00036 bool __fastcall jVCTfetch(vector <TPoint> * src, vector <TPoint> * dst, TRect z_src, TRect z_dst);
00037 bool __fastcall jVCTfetch(vector <TPoint> * v, TRect z_src, TRect z_dst);
00038
00039 bool __fastcall jVCTdirection(vector <TPoint> * src, vector <TPoint> * dst, TPoint debX, TPoint debY, bool conserveProportion = false);
00040 bool __fastcall jVCTdirection(vector <TPoint> * v, TPoint debX, TPoint debY, bool conserveProportion = false);
00041
00042 bool __fastcall jVCTloadFromFile(vector<TPoint> * v, FILE * f);
00043 bool __fastcall jVCTsaveToFile(vector<TPoint> * v, FILE * f);
00044 bool __fastcall jVCTloadFromStream(vector<TPoint> * v, TStream * _str);
00045 bool __fastcall jVCTsaveToStream(vector<TPoint> * v, TStream * _str);
00046
00047 TRect __fastcall jVCTunion(TRect & r1, TRect & r2);
00048 TRect __fastcall jVCTinter(TRect & r1, TRect & r2);
00049 bool __fastcall jVCTcollision(TRect & r1, TRect & r2);
00050 bool __fastcall jVCTinside(TRect & r1, TRect & r2);
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 TRect __fastcall jVCTcenteredCadre(TRect container, TRect content);
00061
00062
00063 TRect __fastcall jVCTfetch(const TRect & _container, const TRect & _content);
00064 TPoint __fastcall jVCTfetch(const TRect & _newCadre, const TRect & _oldCadre, const TPoint & _point);
00065
00066 bool __fastcall jDRWline(TCanvas * cv, TPoint a, TPoint b, int Size, int style, TColor couleur);
00067 bool __fastcall jDRWshape(TCanvas * cv, vector <TPoint> * v);
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 bool __fastcall jDRWtext(TCanvas * cv, AnsiString _text, int _posX, int _posY, int _angle);
00080
00081
00082 bool __fastcall jVCTinside(TPoint p, vector <TPoint> * v);
00083
00084 bool __fastcall jPNTinside(TPoint p, TRect zone);
00085 bool __fastcall jPNTinside(TPoint p, TPoint center, int rayon);
00086
00087 #endif