aux.h File Reference

#include "image.h"
#include "math.h"

Go to the source code of this file.

Functions

double dist (double x0, double y0, double x1, double y1)
double dist (DirectPoint &a, DirectPoint &b)
int pos (long A, long B, long P, long T)
void rotate (double x, double y, double cx, double cy, int &a, int &b, double angle)
void rotate (double x, double y, double cx, double cy, double &a, double &b, double angle)


Function Documentation

double dist DirectPoint a,
DirectPoint b
[inline]
 

return the distance between the two points

Definition at line 14 of file aux.h.

References dist(), DirectPoint::x, and DirectPoint::y.

00015 {
00016   return dist(a.x,a.y,b.x,b.y);
00017 }

double dist double  x0,
double  y0,
double  x1,
double  y1
 

return the distance between the two points

Definition at line 2 of file aux.cpp.

00003 {
00004   double x = x1-x0;
00005   double y = y1-y0;
00006   x*=x;
00007   y*=y;
00008   double d = x+y;
00009   d = (double) (sqrt(d) + 1);
00010   return d;
00011 }

int pos long  A,
long  B,
long  P,
long  T
[inline]
 

returns the position along A to B at position P/T

Definition at line 22 of file aux.h.

Referenced by Runtime::crop(), ImageValue::getQImage(), ImageValue::loadImage(), and SpreadSheetTable::saveFile().

00023 {
00024   return A+(B-A)*P/T;
00025 }

void rotate double  x,
double  y,
double  cx,
double  cy,
double &  a,
double &  b,
double  angle
[inline]
 

Definition at line 42 of file aux.h.

00043 {
00044   double dx = x-cx;
00045   double dy = y-cy;
00046   double d = sqrt(dx*dx+dy*dy);
00047   double alfa = atan2(dy,dx);
00048   alfa+=angle;
00049   a=(cos(alfa)*d);
00050   b=(sin(alfa)*d);
00051 }

void rotate double  x,
double  y,
double  cx,
double  cy,
int &  a,
int &  b,
double  angle
[inline]
 

rotates the coordinate (x,y) around (cx,cy) over angle 'angle' and places the result in (a,b).

Definition at line 31 of file aux.h.

Referenced by Runtime::straighten().

00032 {
00033   double dx = x-cx;
00034   double dy = y-cy;
00035   double d = sqrt(dx*dx+dy*dy);
00036   double alfa = atan2(dy,dx);
00037   alfa+=angle;
00038   a=(int)(cos(alfa)*d);
00039   b=(int)(sin(alfa)*d);
00040 }


Generated on Mon Jun 5 22:08:42 2006 for iis by  doxygen 1.4.6