1. package GLOBE_3D.Math is 
  2.  
  3.   ------------- 
  4.   -- Vectors -- 
  5.   ------------- 
  6.  
  7.   function "*" (l : Real; v : Vector_3D) return Vector_3D; 
  8.   pragma Inline ("*"); 
  9.  
  10.   function "*" (v : Vector_3D; l : Real) return Vector_3D; 
  11.   pragma Inline ("*"); 
  12.  
  13.   function "+" (a, b : Vector_3D) return Vector_3D; 
  14.   pragma Inline ("+"); 
  15.  
  16.   function "-" (a : Vector_3D) return Vector_3D; 
  17.   pragma Inline ("-"); 
  18.  
  19.   function "-" (a, b : Vector_3D) return Vector_3D; 
  20.   pragma Inline ("-"); 
  21.  
  22.   function "*" (a, b : Vector_3D) return Real;      -- dot product 
  23.   pragma Inline ("*"); 
  24.  
  25.   function "*" (a, b : Vector_3D) return Vector_3D; -- cross product 
  26.   pragma Inline ("*"); 
  27.  
  28.   function Norm (a : Vector_3D) return Real; 
  29.   pragma Inline (Norm); 
  30.  
  31.   function Norm2 (a : Vector_3D) return Real; 
  32.   pragma Inline (Norm2); 
  33.  
  34.   function Normalized (a : Vector_3D) return Vector_3D; 
  35.  
  36.    -- Angles 
  37.    -- 
  38.  
  39.    function Angle (Point_1, Point_2, Point_3  : Vector_3D) return Real; 
  40.    -- 
  41.    -- returns the angle between the vector Point_1 to Point_2 and the vector Point_3 to Point_2. 
  42.  
  43.    function to_Degrees (Radians  : Real) return Real; 
  44.    function to_Radians (Degrees  : Real) return Real; 
  45.  
  46.   -------------- 
  47.   -- Matrices -- 
  48.   -------------- 
  49.  
  50.   function "*" (A, B : Matrix_33) return Matrix_33; 
  51.  
  52.   function "*" (A : Matrix_33; x : Vector_3D) return Vector_3D; 
  53.   function "*" (A : Matrix_44; x : Vector_3D) return Vector_3D; 
  54.   function "*" (A : Matrix_44; x : Vector_3D) return Vector_4D; 
  55.  
  56.   function Transpose (A : Matrix_33) return Matrix_33; 
  57.   function Transpose (A : Matrix_44) return Matrix_44; 
  58.  
  59.   function Det (A : Matrix_33) return Real; 
  60.  
  61.   function XYZ_rotation (ax, ay, az : Real) return Matrix_33; 
  62.  
  63.   function XYZ_rotation (v : Vector_3D) return Matrix_33; 
  64.  
  65.   -- Gives a rotation matrix that corresponds to look into a certain 
  66.   -- direction. Camera swing rotation is arbitrary. 
  67.   -- Left - multiply by XYZ_Rotation (0.0, 0.0, az) to correct it. 
  68.   function Look_at (direction : Vector_3D) return Matrix_33; 
  69.  
  70.    function Look_at (eye, center, up  : Vector_3D) return Matrix_33; 
  71.  
  72.   -- This is for correcting cumulation of small computational 
  73.   -- errors, making the rotation matrix no more orthogonal 
  74.   procedure Re_Orthonormalize (M : in out Matrix_33); 
  75.  
  76.   -- Right - multiply current matrix by A 
  77.   procedure Multiply_GL_Matrix (A : Matrix_33); 
  78.  
  79.   -- Impose A as current matrix 
  80.   procedure Set_GL_Matrix (A : Matrix_33); 
  81.  
  82.   -- For replacing the " = 0.0" test which is a Bad Thing 
  83.   function Almost_zero (x : Real) return Boolean; 
  84.   pragma Inline (Almost_zero); 
  85.   function Almost_zero (x : GL.C_Float) return Boolean; 
  86.   pragma Inline (Almost_zero); 
  87.  
  88.    function sub_Matrix (Self                : Matrix; 
  89.                         start_Row, end_Row, 
  90.                         start_Col, end_Col  : Positive) return Matrix; 
  91.  
  92. end GLOBE_3D.Math;