home *** CD-ROM | disk | FTP | other *** search
- /* Coordinate transformations for plotting package */
-
- #include "plplot.h"
- #include "declare.h"
- #include <math.h>
-
- /* dcmm. converts from device coordinates to millimetres from bottom */
- /* left-hand corner */
-
- PLFLT dcmmx(x)
- PLFLT x;
- {
- return((PLFLT)(x * abs(phyxma-phyxmi) / xpmm));
- }
-
- PLFLT dcmmy(y)
- PLFLT y;
- {
- return((PLFLT)(y * abs(phyyma-phyymi) / ypmm));
- }
-
- /* dcsc. define transformations between device coordinates and subpage */
- /* coordinates */
-
- PLFLT dcscx(x)
- PLFLT x;
- {
- return((PLFLT)((x - spdxmi)/(spdxma-spdxmi)));
- }
-
- PLFLT dcscy(y)
- PLFLT y;
- {
- return((PLFLT)((y - spdymi)/(spdyma-spdymi)));
- }
-
- /* mmdc. converts millimetres from bottom left corner into device */
- /* coordinates */
-
- PLFLT mmdcx(x)
- PLFLT x;
- {
- return((PLFLT)(x * xpmm / abs(phyxma - phyxmi)));
- }
-
- PLFLT mmdcy(y)
- PLFLT y;
- {
- return((PLFLT)(y * ypmm / abs(phyyma - phyymi)));
- }
-
- /* scdc. converts subpage coordinates to device coordinates */
-
- PLFLT scdcx(x)
- PLFLT x;
- {
- return((PLFLT)(spdxmi + (spdxma-spdxmi) * x));
- }
-
- PLFLT scdcy(y)
- PLFLT y;
- {
- return((PLFLT)(spdymi + (spdyma-spdymi) * y));
- }
-
- /* wcmm. converts world coordinates into millimetres */
-
- PLFLT wcmmx(x)
- PLFLT x;
- {
- return((PLFLT)(wmxoff + wmxscl*x));
- }
-
- PLFLT wcmmy(y)
- PLFLT y;
- {
- return((PLFLT)(wmyoff + wmyscl*y));
- }
-
- PLFLT w3wcx(x,y,z)
- PLFLT x, y, z;
- {
- return((PLFLT)((x-basecx)*cxx + (y-basecy)*cxy));
- }
-
- PLFLT w3wcy(x,y,z)
- PLFLT x, y, z;
- {
- return((PLFLT)((x-basecx)*cyx+(y-basecy)*cyy+(z-ranmi)*cyz));
- }
-
-
-