class Bio::PDB::Coordinate

Bio::PDB::Coordinate is a class to store a 3D coordinate. It inherits Vector (in bundled library in Ruby).

Public Class Methods

[](x,y,z) click to toggle source

same as Vector.

Calls superclass method
   # File lib/bio/db/pdb/atom.rb
33 def self.[](x,y,z)
34   super
35 end
elements(array, *a) click to toggle source

same as Vector.elements

Calls superclass method
   # File lib/bio/db/pdb/atom.rb
38 def self.elements(array, *a)
39   raise 'Size of given array must be 3' if array.size != 3
40   super
41 end

Public Instance Methods

distance(object2) click to toggle source

distance between object2.

   # File lib/bio/db/pdb/atom.rb
70 def distance(object2)
71   Utils::convert_to_xyz(object2)
72   (self - object2).r
73 end
to_ary() click to toggle source

Implicit conversion to an array.

Note that this method would be deprecated in the future.

   # File lib/bio/db/pdb/atom.rb
64 def to_ary; self.to_a; end
x() click to toggle source

x

   # File lib/bio/db/pdb/atom.rb
44 def x; self[0]; end
x=(n) click to toggle source

x=(n)

   # File lib/bio/db/pdb/atom.rb
50 def x=(n); self[0]=n; end
xyz() click to toggle source

returns self.

   # File lib/bio/db/pdb/atom.rb
67 def xyz; self; end
y() click to toggle source

y

   # File lib/bio/db/pdb/atom.rb
46 def y; self[1]; end
y=(n) click to toggle source

y=(n)

   # File lib/bio/db/pdb/atom.rb
52 def y=(n); self[1]=n; end
z() click to toggle source

z

   # File lib/bio/db/pdb/atom.rb
48 def z; self[2]; end
z=(n) click to toggle source

z=(n)

   # File lib/bio/db/pdb/atom.rb
54 def z=(n); self[2]=n; end