public AngleDR Fk45z(AngleDR r1950, double bepoch) {
        double w;
        int i, j;

        /* Position and position+velocity vectors */
        double r0[], a1[] = new double[3], v1[] = new double[3], v2[] = new double[6];

        /* Radians per year to arcsec per century */
        final double pmf = 100.0 * 60.0 * 60.0 * 360.0 / D2PI;

        /*
     * Canonical constants (see references)
     */

        /* vectors a and adot, and matrix m (only half of which is needed here) */
        final double a[] = {-1.62557e-6, -0.31919e-6, -0.13843e-6};
        final double ad[] = {1.245e-3, -1.580e-3, -0.659e-3};
        final double em[][] = {{0.9999256782, -0.0111820611, -0.0048579477},
                               {0.0111820610, 0.9999374784, -0.0000271765},
                               {0.0048579479, -0.0000271474, 0.9999881997},
                               {-0.000551, -0.238565, 0.435739},
                               {0.238514, -0.002667, -0.008541},
                               {-0.435623, 0.012254, 0.002117}};

        /* Spherical to Cartesian */
        r0 = Dcs2c(r1950);

        /* Adjust vector a to give zero proper motion in FK5 */
        w = (bepoch - 1950.0) / pmf;
        for (i = 0; i < 3; i++) {
            a1[i] = a[i] + w * ad[i];
        }

        /* Remove e-terms */
        w = r0[0] * a1[0] + r0[1] * a1[1] + r0[2] * a1[2];
        for (i = 0; i < 3; i++) {
            v1[i] = r0[i] - a1[i] + w * r0[i];
        }

        /* Convert position vector to Fricke system */
        for (i = 0; i < 6; i++) {
            w = 0.0;
            for (j = 0; j < 3; j++) {
                w += em[i][j] * v1[j];
            }
            v2[i] = w;
        }

        /* Allow for fictitious proper motion in FK4 */
        w = (Epj(Epb2d(bepoch)) - 2000.0) / pmf;
        for (i = 0; i < 3; i++) {
            v2[i] += w * v2[i + 3];
        }

        /* Revert to spherical coordinates */
        AngleDR r2000 = Dcc2s(v2);
        r2000.setAlpha(Dranrm(r2000.getAlpha()));
        return r2000;
    }