position.h revision 75584
1157308Sume// -*- C++ -*- 2157308Sume/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. 3157308Sume Written by James Clark (jjc@jclark.com) 4157308Sume 5157308SumeThis file is part of groff. 6157308Sume 7157308Sumegroff is free software; you can redistribute it and/or modify it under 8157308Sumethe terms of the GNU General Public License as published by the Free 9157308SumeSoftware Foundation; either version 2, or (at your option) any later 10157308Sumeversion. 11157308Sume 12157308Sumegroff is distributed in the hope that it will be useful, but WITHOUT ANY 13157308SumeWARRANTY; without even the implied warranty of MERCHANTABILITY or 14157308SumeFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15157308Sumefor more details. 16157308Sume 17157308SumeYou should have received a copy of the GNU General Public License along 18157308Sumewith groff; see the file COPYING. If not, write to the Free Software 19157308SumeFoundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 20157308Sume 21157308Sumestruct place; 22157308Sumestruct position { 23157308Sume double x; 24157308Sume double y; 25157308Sume position(double, double ); 26157308Sume position(); 27157308Sume position(const place &); 28157308Sume position &operator+=(const position &); 29157308Sume position &operator-=(const position &); 30157308Sume position &operator*=(double); 31157308Sume position &operator/=(double); 32157308Sume}; 33157308Sume 34157308Sumeposition operator-(const position &); 35157308Sumeposition operator+(const position &, const position &); 36157308Sumeposition operator-(const position &, const position &); 37157308Sumeposition operator/(const position &, double); 38157308Sumeposition operator*(const position &, double); 39157308Sume// dot product 40157308Sumedouble operator*(const position &, const position &); 41157308Sumeint operator==(const position &, const position &); 42157308Sumeint operator!=(const position &, const position &); 43157308Sume 44157308Sumedouble hypot(const position &a); 45157308Sume 46157308Sumetypedef position distance; 47157308Sume 48157308Sume