diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/dk3ct.ctr |
Initial commit
Diffstat (limited to 'support/dktools/dk3ct.ctr')
-rw-r--r-- | support/dktools/dk3ct.ctr | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/support/dktools/dk3ct.ctr b/support/dktools/dk3ct.ctr new file mode 100644 index 0000000000..060f8011f0 --- /dev/null +++ b/support/dktools/dk3ct.ctr @@ -0,0 +1,99 @@ +%% options + +copyright owner = Dirk Krause +copyright year = 2012-xxxx +license = bsd + + +%% header + +#ifdef __cplusplus +extern "C" { +#endif + +/** Coordinates transformation: X value. + @param ct Transformation data. + @param x X value. + @param ec Pointer to error code variable, may be NULL. + @return Transformation result. +*/ +double +dk3ct_2d_x(dk3_ct_2d_t const *ct, double x, int *ec); + +/** Coordinates transformation: Y value. + @param ct Transformation data. + @param y X value. + @param ec Pointer to error code variable, may be NULL. + @return Transformation result. +*/ +double +dk3ct_2d_y(dk3_ct_2d_t const *ct, double y, int *ec); + +/** Coordinates transformation: Radius. + @param ct Transformation data. + @param r X value. + @param ec Pointer to error code variable, may be NULL. + @return Transformation result. +*/ +double +dk3ct_2d_r(dk3_ct_2d_t const *ct, double r, int *ec); + +#ifdef __cplusplus +} +#endif + +%% module + +#include "dk3all.h" + + + +$!trace-include + + +double +dk3ct_2d_x(dk3_ct_2d_t const *ct, double x, int *ec) +{ + double back = 0.0; + $? "+ dk3ct_2d_x %lg", x + if(ct) { + back = dk3ma_d_add_ok( + dk3ma_d_mul_ok(ct->mx, x, ec), + ct->nx, + ec + ); + } $? "- dk3ct_2d_x %lg", back + return back; +} + + + +double +dk3ct_2d_y(dk3_ct_2d_t const *ct, double y, int *ec) +{ + double back = 0.0; + $? "+ dk3ct_2d_y %lg", y + if(ct) { + back = dk3ma_d_add_ok( + dk3ma_d_mul_ok(ct->my, y, ec), + ct->ny, + ec + ); + } $? "- dk3ct_2d_y %lg", back + return back; +} + + + +double +dk3ct_2d_r(dk3_ct_2d_t const *ct, double r, int *ec) +{ + double back = 0.0; + $? "+ dk3ct_2d_r %lg", r + if(ct) { + back = dk3ma_d_mul_ok(fabs(ct->mx), r, ec); + } $? "- dk3ct_2d_r %lg", back + return back; +} + + |