2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2006 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
35 this.startCol = at1.color;
\r
36 this.endCol = at2.color;
\r
41 /* public Bond(Bond bond) {
\r
42 this.start = new float[3];
\r
44 this.start[0] = bond.start[0];
\r
45 this.start[1] = bond.start[1];
\r
46 this.start[2] = bond.start[2];
\r
48 this.end = new float[3];
\r
50 this.end[0] = bond.end[0];
\r
51 this.end[1] = bond.end[1];
\r
52 this.end[2] = bond.end[2];
\r
54 this.startCol = bond.startCol;
\r
55 this.endCol = bond.endCol;
\r
58 public float length() {
\r
59 float len = ((end[0] - start[0]) * (end[0] - start[0])) +
\r
60 ((end[1] - start[1]) * (end[1] - start[1])) +
\r
61 ((end[2] - start[2]) * (end[2] - start[2]));
\r
63 len = (float) (Math.sqrt(len));
\r
68 public void translate(float x, float y, float z) {
\r
69 start[0] = (start[0] + x);
\r
70 end[0] = (end[0] + x);
\r
72 start[1] = (start[1] + y);
\r
73 end[1] = (end[1] + y);
\r
75 start[2] = (start[2] + z);
\r
76 end[2] = (end[2] + z);
\r