public AngleDR Mapqk(Stardata s, AMParams amprms) {
        int i;
        double pmt, gr2e, ab1, eb[], ehn[], abv[], q[], pxr, w, em[] = new double[3], p[] = new double[3], pn[] =
                new double[3], pde, pdep1, p1[] = new double[3], p1dv, p2[] = new double[3], p3[] = new double[3];

        TRACE("Mapqk");
        /* Unpack scalar and vector parameters */
        pmt = amprms.getTimeint();
        gr2e = amprms.getGrad();
        ab1 = amprms.getRoot();
        eb = amprms.getBary();
        ehn = amprms.getHelio();
        abv = amprms.getEarthv();

        /* Spherical to x,y,z */
        AngleDR r = s.getAngle();
        double rm = r.getAlpha();
        double dm = r.getDelta();
        double pm[] = s.getMotion();
        double px = s.getParallax();
        double rv = s.getRV();
        q = Dcs2c(r);

        /* Space motion (radians per year) */
        pxr = px * DAS2R;
        w = VF * rv * pxr;
        em[0] = (-pm[0] * q[1]) - (pm[1] * Math.cos(rm) * Math.sin(dm)) + (w * q[0]);
        em[1] = (pm[0] * q[0]) - (pm[1] * Math.sin(rm) * Math.sin(dm)) + (w * q[1]);
        em[2] = (pm[1] * Math.cos(dm)) + (w * q[2]);

        /* Geocentric direction of star (normalized) */
        for (i = 0; i < 3; i++) {
            p[i] = q[i] + (pmt * em[i]) - (pxr * eb[i]);
        }
        w = Dvn(p, pn);

        /* Light deflection (restrained within the Sun's disc) */
        pde = Dvdv(pn, ehn);
        pdep1 = 1.0 + pde;
        w = gr2e / gmax(pdep1, 1.0e-5);
        for (i = 0; i < 3; i++) {
            p1[i] = pn[i] + (w * (ehn[i] - pde * pn[i]));
        }

        /* Aberration (normalization omitted) */
        p1dv = Dvdv(p1, abv);
        w = 1.0 + p1dv / (ab1 + 1.0);
        for (i = 0; i < 3; i++) {
            p2[i] = ab1 * p1[i] + w * abv[i];
        }

        /* Precession and nutation */
        p3 = Dmxv(amprms.getPrecess(), p2);

        /* Geocentric apparent RA,dec */
        AngleDR ra = Dcc2s(p3);

        ra.setAlpha(Dranrm(ra.getAlpha()));
        ENDTRACE("Mapqk");
        return ra;
    }