sgSpaceMath.h
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 2k
Category:

Graph program

Development Platform:

Visual C++

  1. #ifndef  __sgSpaceMath__
  2. #define  __sgSpaceMath__
  3. namespace  sgSpaceMath
  4. {
  5. sgCore_API   bool  IsPointsOnOneLine(const SG_POINT& p1,
  6. const SG_POINT& p2,
  7. const SG_POINT& p3);
  8. sgCore_API   double  PointsDistance(const SG_POINT& p1, const SG_POINT& p2);
  9. sgCore_API   bool  NormalVector(SG_VECTOR& vect);
  10. sgCore_API   SG_VECTOR   VectorsAdd(const SG_VECTOR& v1,const SG_VECTOR& v2);
  11. sgCore_API   SG_VECTOR   VectorsSub(const SG_VECTOR& v1,const SG_VECTOR& v2);
  12. sgCore_API   double      VectorsScalarMult(const SG_VECTOR& v1,const SG_VECTOR& v2);
  13. sgCore_API   SG_VECTOR   VectorsVectorMult(const SG_VECTOR& v1,const SG_VECTOR& v2);
  14. sgCore_API   double      ProjectPointToLineAndGetDist(const SG_POINT& lineP, 
  15.     const SG_VECTOR& lineDir, 
  16. const SG_POINT& pnt, 
  17. SG_POINT& resPnt);
  18. typedef enum
  19. {
  20. SG_LINE_PARALLEL = -1,
  21. SG_LINE_ON_PLANE = 0,
  22. SG_EXIST_INTERSECT_PONT = 1
  23. }  SG_PLANE_AND_LINE;
  24. sgCore_API   SG_PLANE_AND_LINE  IntersectPlaneAndLine(const SG_VECTOR& planeNorm, 
  25. const double planeD, 
  26. const SG_POINT& lineP, 
  27. const SG_VECTOR& lineDir,
  28. SG_POINT& resP);
  29. sgCore_API   bool        IsSegmentsIntersecting(const SG_LINE& ln1, 
  30. bool as_line1,
  31. const SG_LINE& ln2, 
  32. bool as_line2,
  33. SG_POINT& resP);
  34. sgCore_API   bool        PlaneFromPoints(const SG_POINT& p1, 
  35. const SG_POINT& p2, 
  36. const SG_POINT& p3,
  37. SG_VECTOR& resPlaneNorm,
  38. double& resPlaneD);
  39. sgCore_API   void        PlaneFromNormalAndPoint(const SG_POINT& planePnt, 
  40. const SG_VECTOR& planeNorm,
  41. double& resPlaneD); 
  42. sgCore_API   double      GetPlanePointDistance(const SG_POINT& pnt, 
  43. const SG_VECTOR& planeNorm, 
  44. const double planeD);
  45. };
  46. #endif