tesseract  3.03
/usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/vecfuncs.h
Go to the documentation of this file.
00001 /* -*-C-*-
00002  ********************************************************************************
00003  *
00004  * File:        vecfuncs.h  (Formerly vecfuncs.h)
00005  * Description:  Vector calculations
00006  * Author:       Mark Seaman, OCR Technology
00007  * Created:      Wed Dec 20 09:37:18 1989
00008  * Modified:     Tue Jul  9 17:44:37 1991 (Mark Seaman) marks@hpgrlt
00009  * Language:     C
00010  * Package:      N/A
00011  * Status:       Experimental (Do Not Distribute)
00012  *
00013  * (c) Copyright 1989, Hewlett-Packard Company.
00014  ** Licensed under the Apache License, Version 2.0 (the "License");
00015  ** you may not use this file except in compliance with the License.
00016  ** You may obtain a copy of the License at
00017  ** http://www.apache.org/licenses/LICENSE-2.0
00018  ** Unless required by applicable law or agreed to in writing, software
00019  ** distributed under the License is distributed on an "AS IS" BASIS,
00020  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00021  ** See the License for the specific language governing permissions and
00022  ** limitations under the License.
00023  *
00024  *********************************************************************************/
00025 #ifndef VECFUNCS_H
00026 #define VECFUNCS_H
00027 
00028 #include <math.h>
00029 #include "blobs.h"
00030 
00031 struct EDGEPT;
00032 
00033 /*----------------------------------------------------------------------
00034               M a c r o s
00035 ----------------------------------------------------------------------*/
00036 /**********************************************************************
00037  * point_diff
00038  *
00039  * Return the difference from point (p1) to point (p2).  Put the value
00040  * into point (p).
00041  **********************************************************************/
00042 
00043 #define point_diff(p,p1,p2)  \
00044 ((p).x = (p1).x - (p2).x,        \
00045         (p).y = (p1).y - (p2).y)
00046 
00047 /**********************************************************************
00048  * CROSS
00049  *
00050  * cross product
00051  **********************************************************************/
00052 
00053 #define CROSS(a,b) \
00054 ((a).x * (b).y - (a).y * (b).x)
00055 
00056 /**********************************************************************
00057  * SCALAR
00058  *
00059  * scalar vector product
00060  **********************************************************************/
00061 
00062 #define SCALAR(a,b) \
00063 ((a).x * (b).x + (a).y * (b).y)
00064 
00065 /**********************************************************************
00066  * LENGTH
00067  *
00068  * length of vector
00069  **********************************************************************/
00070 
00071 #define LENGTH(a) \
00072 ((a).x * (a).x + (a).y * (a).y)
00073 
00074 /*----------------------------------------------------------------------
00075               F u n c t i o n s
00076 ----------------------------------------------------------------------*/
00077 int direction(EDGEPT *point); 
00078 
00079 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines