aboutsummaryrefslogtreecommitdiff
path: root/generic/Transfo.h
diff options
context:
space:
mode:
authorlecoanet1999-10-29 14:10:50 +0000
committerlecoanet1999-10-29 14:10:50 +0000
commit4bdc612c3ae34c75694cd02d8e89f5838597466a (patch)
tree4cbdaaebab619504cd4f8460a6531c29d2871a94 /generic/Transfo.h
parentb35900bca91efb1f4bce9ef8fa07bb97d3f36dca (diff)
downloadtkzinc-4bdc612c3ae34c75694cd02d8e89f5838597466a.zip
tkzinc-4bdc612c3ae34c75694cd02d8e89f5838597466a.tar.gz
tkzinc-4bdc612c3ae34c75694cd02d8e89f5838597466a.tar.bz2
tkzinc-4bdc612c3ae34c75694cd02d8e89f5838597466a.tar.xz
Ajout du module de transformations
Diffstat (limited to 'generic/Transfo.h')
-rw-r--r--generic/Transfo.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/generic/Transfo.h b/generic/Transfo.h
new file mode 100644
index 0000000..46ce803
--- /dev/null
+++ b/generic/Transfo.h
@@ -0,0 +1,112 @@
+/*
+ * Transfo.h -- Header for common geometric routines.
+ *
+ * Authors : Patrick Lecoanet.
+ * Creation date :
+ *
+ * $Id$
+ */
+
+/*
+ * Copyright (c) 1993 - 1999 CENA, Patrick Lecoanet --
+ *
+ * This code is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This code is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this code; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+
+#ifndef _Transfo_h
+#define _Transfo_h
+
+
+#include "Types.h"
+
+#include <math.h>
+#include <limits.h>
+
+
+/*
+ * First subscript is matrix row, second is matrix column.
+ * So a[0][1] is upper right corner of matrix a and a[2][0]
+ * is lower left corner.
+ */
+typedef struct _RadarTransfo {
+ RadarReal _[3][2];
+} RadarTransfo;
+
+
+RadarTransfo *
+RadarTransfoNew(void);
+RadarTransfo *
+RadarTransfoDuplicate(RadarTransfo *t);
+void
+RadarTransfoFree(RadarTransfo *t);
+void
+RadarPrintTransfo(RadarTransfo *t);
+void
+RadarTransfoSetIdentity(RadarTransfo *t);
+RadarBool
+RadarTransfoIsIdentity(RadarTransfo *t);
+RadarTransfo *
+RadarTransfoCompose(RadarTransfo *res,
+ RadarTransfo *t1,
+ RadarTransfo *t2);
+RadarTransfo *
+RadarTransfoInvert(RadarTransfo *t,
+ RadarTransfo *inv);
+void
+RadarTransfoDecompose(RadarTransfo *t,
+ RadarPoint *scale,
+ RadarPoint *trans,
+ RadarReal *rotation,
+ RadarReal *shearxy);
+RadarBool
+RadarTransfoEqual(RadarTransfo *t1,
+ RadarTransfo *t2,
+ RadarBool include_translation);
+RadarBool
+RadarTransfoHasShear(RadarTransfo *t);
+RadarBool
+RadarTransfoIsTranslation(RadarTransfo *t);
+RadarPoint *
+RadarTransformPoint(RadarTransfo *t,
+ RadarPoint *p,
+ RadarPoint *xp);
+void
+RadarTransformPoints(RadarTransfo *t,
+ RadarPoint *p,
+ RadarPoint *xp,
+ int num);
+RadarTransfo *
+RadarTranslate(RadarTransfo *t,
+ RadarReal delta_x,
+ RadarReal delta_y);
+RadarTransfo *
+RadarSetTranslation(RadarTransfo *t,
+ RadarReal delta_x,
+ RadarReal delta_y);
+RadarTransfo *
+RadarScale(RadarTransfo *t,
+ RadarReal scale_x,
+ RadarReal scale_y);
+RadarTransfo *
+RadarRotateRad(RadarTransfo *t,
+ RadarReal angle);
+RadarTransfo *
+RadarRotateDeg(RadarTransfo *t,
+ RadarReal angle);
+
+
+#endif /* _Transfo_h */