2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
27 Color startCol = Color.lightGray;
\r
28 Color endCol = Color.lightGray;
\r
32 public Bond(float[] start, float[] end, Atom at1, Atom at2)
\r
36 this.startCol = at1.color;
\r
37 this.endCol = at2.color;
\r
42 /* public Bond(Bond bond) {
\r
43 this.start = new float[3];
\r
45 this.start[0] = bond.start[0];
\r
46 this.start[1] = bond.start[1];
\r
47 this.start[2] = bond.start[2];
\r
49 this.end = new float[3];
\r
51 this.end[0] = bond.end[0];
\r
52 this.end[1] = bond.end[1];
\r
53 this.end[2] = bond.end[2];
\r
55 this.startCol = bond.startCol;
\r
56 this.endCol = bond.endCol;
\r
59 public float length() {
\r
60 float len = ((end[0] - start[0]) * (end[0] - start[0])) +
\r
61 ((end[1] - start[1]) * (end[1] - start[1])) +
\r
62 ((end[2] - start[2]) * (end[2] - start[2]));
\r
64 len = (float) (Math.sqrt(len));
\r
69 public void translate(float x, float y, float z)
\r
71 start[0] = (start[0] + x);
\r
72 end[0] = (end[0] + x);
\r
74 start[1] = (start[1] + y);
\r
75 end[1] = (end[1] + y);
\r
77 start[2] = (start[2] + z);
\r
78 end[2] = (end[2] + z);
\r