Class Bio::PDB::Coordinate
In: lib/bio/db/pdb/atom.rb
Parent: Vector

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

Methods

[]   distance   elements   to_ary   x   x=   xyz   y   y=   z   z=  

Public Class methods

same as Vector.[x,y,z]

[Source]

    # File lib/bio/db/pdb/atom.rb, line 32
32:       def self.[](x,y,z)
33:         super
34:       end

same as Vector.elements

[Source]

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

Public Instance methods

distance between object2.

[Source]

    # File lib/bio/db/pdb/atom.rb, line 69
69:       def distance(object2)
70:         Utils::convert_to_xyz(object2)
71:         (self - object2).r
72:       end

Implicit conversion to an array.

Note that this method would be deprecated in the future.

[Source]

    # File lib/bio/db/pdb/atom.rb, line 63
63:       def to_ary; self.to_a; end

x

[Source]

    # File lib/bio/db/pdb/atom.rb, line 43
43:       def x; self[0]; end

x=(n)

[Source]

    # File lib/bio/db/pdb/atom.rb, line 49
49:       def x=(n); self[0]=n; end

returns self.

[Source]

    # File lib/bio/db/pdb/atom.rb, line 66
66:       def xyz; self; end

y

[Source]

    # File lib/bio/db/pdb/atom.rb, line 45
45:       def y; self[1]; end

y=(n)

[Source]

    # File lib/bio/db/pdb/atom.rb, line 51
51:       def y=(n); self[1]=n; end

z

[Source]

    # File lib/bio/db/pdb/atom.rb, line 47
47:       def z; self[2]; end

z=(n)

[Source]

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

[Validate]