jdk/src/share/demo/applets/MoleculeViewer/Matrix3D.java
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 2 90ce3da70b43
child 8971 c2519876ef49
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * Redistribution and use in source and binary forms, with or without
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * modification, are permitted provided that the following conditions
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * are met:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *   - Redistributions of source code must retain the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *     notice, this list of conditions and the following disclaimer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 *   - Redistributions in binary form must reproduce the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 *     notice, this list of conditions and the following disclaimer in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 *     documentation and/or other materials provided with the distribution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    15
 *   - Neither the name of Oracle nor the names of its
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *     contributors may be used to endorse or promote products derived
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 *     from this software without specific prior written permission.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/** A fairly conventional 3D matrix object that can transform sets of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
    3D points and perform a variety of manipulations on the transform */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
class Matrix3D {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    float xx, xy, xz, xo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    float yx, yy, yz, yo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    float zx, zy, zz, zo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    static final double pi = 3.14159265;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    /** Create a new unit matrix */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    Matrix3D () {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        xx = 1.0f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        yy = 1.0f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        zz = 1.0f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    /** Scale by f in all dimensions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    void scale(float f) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        xx *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        xy *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        xz *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        xo *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        yx *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        yy *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        yz *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        yo *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        zx *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        zy *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        zz *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        zo *= f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    /** Scale along each axis independently */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    void scale(float xf, float yf, float zf) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        xx *= xf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        xy *= xf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        xz *= xf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        xo *= xf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        yx *= yf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        yy *= yf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        yz *= yf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        yo *= yf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        zx *= zf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        zy *= zf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        zz *= zf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        zo *= zf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    /** Translate the origin */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    void translate(float x, float y, float z) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        xo += x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        yo += y;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        zo += z;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /** rotate theta degrees about the y axis */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    void yrot(double theta) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        theta *= (pi / 180);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        double ct = Math.cos(theta);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        double st = Math.sin(theta);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        float Nxx = (float) (xx * ct + zx * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        float Nxy = (float) (xy * ct + zy * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        float Nxz = (float) (xz * ct + zz * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        float Nxo = (float) (xo * ct + zo * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        float Nzx = (float) (zx * ct - xx * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        float Nzy = (float) (zy * ct - xy * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        float Nzz = (float) (zz * ct - xz * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        float Nzo = (float) (zo * ct - xo * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        xo = Nxo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        xx = Nxx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        xy = Nxy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        xz = Nxz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        zo = Nzo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        zx = Nzx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        zy = Nzy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        zz = Nzz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    /** rotate theta degrees about the x axis */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    void xrot(double theta) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        theta *= (pi / 180);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        double ct = Math.cos(theta);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        double st = Math.sin(theta);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        float Nyx = (float) (yx * ct + zx * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        float Nyy = (float) (yy * ct + zy * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        float Nyz = (float) (yz * ct + zz * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        float Nyo = (float) (yo * ct + zo * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        float Nzx = (float) (zx * ct - yx * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        float Nzy = (float) (zy * ct - yy * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        float Nzz = (float) (zz * ct - yz * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        float Nzo = (float) (zo * ct - yo * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        yo = Nyo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        yx = Nyx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        yy = Nyy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        yz = Nyz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        zo = Nzo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        zx = Nzx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        zy = Nzy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        zz = Nzz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    /** rotate theta degrees about the z axis */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    void zrot(double theta) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        theta *= (pi / 180);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        double ct = Math.cos(theta);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        double st = Math.sin(theta);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        float Nyx = (float) (yx * ct + xx * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        float Nyy = (float) (yy * ct + xy * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        float Nyz = (float) (yz * ct + xz * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        float Nyo = (float) (yo * ct + xo * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        float Nxx = (float) (xx * ct - yx * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        float Nxy = (float) (xy * ct - yy * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        float Nxz = (float) (xz * ct - yz * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        float Nxo = (float) (xo * ct - yo * st);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        yo = Nyo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        yx = Nyx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        yy = Nyy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        yz = Nyz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        xo = Nxo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        xx = Nxx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        xy = Nxy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        xz = Nxz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    /** Multiply this matrix by a second: M = M*R */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    void mult(Matrix3D rhs) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        float lxx = xx * rhs.xx + yx * rhs.xy + zx * rhs.xz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        float lxy = xy * rhs.xx + yy * rhs.xy + zy * rhs.xz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        float lxz = xz * rhs.xx + yz * rhs.xy + zz * rhs.xz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        float lxo = xo * rhs.xx + yo * rhs.xy + zo * rhs.xz + rhs.xo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        float lyx = xx * rhs.yx + yx * rhs.yy + zx * rhs.yz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        float lyy = xy * rhs.yx + yy * rhs.yy + zy * rhs.yz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        float lyz = xz * rhs.yx + yz * rhs.yy + zz * rhs.yz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        float lyo = xo * rhs.yx + yo * rhs.yy + zo * rhs.yz + rhs.yo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        float lzx = xx * rhs.zx + yx * rhs.zy + zx * rhs.zz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        float lzy = xy * rhs.zx + yy * rhs.zy + zy * rhs.zz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        float lzz = xz * rhs.zx + yz * rhs.zy + zz * rhs.zz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        float lzo = xo * rhs.zx + yo * rhs.zy + zo * rhs.zz + rhs.zo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        xx = lxx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        xy = lxy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        xz = lxz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        xo = lxo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        yx = lyx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        yy = lyy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        yz = lyz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        yo = lyo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        zx = lzx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        zy = lzy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        zz = lzz;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        zo = lzo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    /** Reinitialize to the unit matrix */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    void unit() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        xo = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        xx = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        xy = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        xz = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        yo = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        yx = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        yy = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        yz = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        zo = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        zx = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        zy = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        zz = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    /** Transform nvert points from v into tv.  v contains the input
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        coordinates in floating point.  Three successive entries in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        the array constitute a point.  tv ends up holding the transformed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        points as integers; three successive entries per point */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    void transform(float v[], int tv[], int nvert) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        float lxx = xx, lxy = xy, lxz = xz, lxo = xo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        float lyx = yx, lyy = yy, lyz = yz, lyo = yo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        float lzx = zx, lzy = zy, lzz = zz, lzo = zo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        for (int i = nvert * 3; (i -= 3) >= 0;) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            float x = v[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            float y = v[i + 1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            float z = v[i + 2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            tv[i    ] = (int) (x * lxx + y * lxy + z * lxz + lxo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
            tv[i + 1] = (int) (x * lyx + y * lyy + z * lyz + lyo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
            tv[i + 2] = (int) (x * lzx + y * lzy + z * lzz + lzo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        return ("[" + xo + "," + xx + "," + xy + "," + xz + ";"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                + yo + "," + yx + "," + yy + "," + yz + ";"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                + zo + "," + zx + "," + zy + "," + zz + "]");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
}