Ivan Tubert-Brohman > Chemistry-Mol-0.10 > Chemistry::Bond

Download:
Chemistry-Mol-0.10.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  2
View Bugs
Report a bug
Module Version: 0.10   Source   Latest Release: Chemistry-Mol-0.37

NAME ^

Chemistry::Bond

SYNOPSIS ^

    use Chemistry::Bond;

    my $bond = new Chemistry::Bond(
        id => "b1", 
        type => '=', 
        atoms => [$a1, $a2]
        order => '2',
    );
    print $bond->print;

DESCRIPTION ^

This module includes objects to describe chemical bonds. A bond is defined as a list of atoms (typically two), with some associated properies.

Bond Attributes

In addition to common attributes such as id, name, and type, bonds have the order attribute. The bond order is a number, typically the integer 1, 2, 3, or 4.

METHODS ^

Chemistry::Bond->new(name => value, ...)

Create a new Bond object with the specified attributes. Sensible defaults are used when possible.

$bond->order()

Sets or gets the bond order.

$bond->length()

Returns the length of the bond, i.e., the distance between the two atom objects in the bond. Returns zero if the bond does not have exactly two atoms.

$bond->print

Convert the bond to a string representation.

$bond->atoms()

If called with no parameters, return a list of atoms in the bond. If called with a list (or a reference to an array) of atom objects, define the atoms in the bond and call $atom->add_bond for each atom in the list.

SEE ALSO ^

Chemistry::Mol, Chemistry::Atom, Chemistry::Tutorial

AUTHOR ^

Ivan Tubert <itub@cpan.org>

COPYRIGHT ^

Copyright (c) 2003 Ivan Tubert. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.