DEFINITION MODULE VectorExtras;

(*
    Title: 	more vector and box operations
    LastEdit:	"Tue Aug 20 13:37:16 1985"
    Author: 	ahj
		Cambridge University Computer Laboratory
*)


FROM Vector IMPORT AXIS, BOUND, IVEC, IBOX, RBOX, RBox, RVEC ;

EXPORT QUALIFIED FloatBox, ExpandBox, ExpandRBoxAxis, ShiftBox, MakeRBox,
                 ExpandRBoxToSquare, SquashRBoxToSquare ;
                 
PROCEDURE FloatBox (ibox : IBOX ; VAR rbox : RBOX) ;
(* Turn an IBOX into an RBOX *)

PROCEDURE ExpandBox (VAR Box : RBOX ; f: REAL) ;
(* Expand box about it's centre by a factor of f *)

PROCEDURE ExpandRBoxAxis (VAR Box : RBOX ;
                          Factor : REAL ;
                          Axis : AXIS) ;

PROCEDURE ShiftBox (VAR Box : RBOX ;
                    f : REAL ;
                    a : AXIS) ;
(* Shift box along axis a in a positive direction by it's
   own width times f (i.e. make f negative to shift negatively *)

PROCEDURE MakeRBox (VAR Box : RBOX ;
                    Vec1, Vec2 : RVEC) ;

PROCEDURE ExpandRBoxToSquare (VAR Box : RBOX) ;

PROCEDURE SquashRBoxToSquare (VAR Box : RBOX) ;

END VectorExtras.
