.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Chemistry::Bond 3pm" .TH Chemistry::Bond 3pm "2022-07-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Chemistry::Bond \- Chemical bonds as objects in molecules .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Chemistry::Bond; \& \& # assuming we have molecule $mol with atoms $a1 and $a2 \& $bond = Chemistry::Bond\->new( \& id => "b1", \& type => \*(Aq=\*(Aq, \& atoms => [$a1, $a2] \& order => \*(Aq2\*(Aq, \& ); \& $mol\->add_bond($bond); \& \& # simpler way of doing the same: \& $mol\->new_bond( \& id => "b1", \& type => \*(Aq=\*(Aq, \& atoms => [$a1, $a2] \& order => \*(Aq2\*(Aq, \& ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module includes objects to describe chemical bonds. A bond is defined as a list of atoms (typically two), with some associated properties. .SS "Bond Attributes" .IX Subsection "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. .SH "METHODS" .IX Header "METHODS" .IP "Chemistry::Bond\->new(name => value, ...)" 4 .IX Item "Chemistry::Bond->new(name => value, ...)" Create a new Bond object with the specified attributes. Sensible defaults are used when possible. .ie n .IP "$bond\->\fBorder()\fR" 4 .el .IP "\f(CW$bond\fR\->\fBorder()\fR" 4 .IX Item "$bond->order()" Sets or gets the bond order. .ie n .IP "$bond\->length" 4 .el .IP "\f(CW$bond\fR\->length" 4 .IX Item "$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. .ie n .IP "$bond\->aromatic($bool)" 4 .el .IP "\f(CW$bond\fR\->aromatic($bool)" 4 .IX Item "$bond->aromatic($bool)" Set or get whether the bond is considered to be aromatic. .ie n .IP "$bond\->print" 4 .el .IP "\f(CW$bond\fR\->print" 4 .IX Item "$bond->print" Convert the bond to a string representation. .ie n .IP "$bond\->\fBatoms()\fR" 4 .el .IP "\f(CW$bond\fR\->\fBatoms()\fR" 4 .IX Item "$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 \f(CW$atom\fR\->add_bond for each atom in the list. Note: changing the atoms in a bond may have strange side effects; it is safer to treat bonds as immutable except with respect to properties such as name and type. .ie n .IP "$bond\->delete" 4 .el .IP "\f(CW$bond\fR\->delete" 4 .IX Item "$bond->delete" Calls \f(CW$mol\fR\->delete_bond($bond) on the bond's parent molecule. Note that a bond should belong to only one molecule or strange things may happen. .SH "SOURCE CODE REPOSITORY" .IX Header "SOURCE CODE REPOSITORY" .SH "SEE ALSO" .IX Header "SEE ALSO" Chemistry::Mol, Chemistry::Atom, Chemistry::Tutorial .SH "AUTHOR" .IX Header "AUTHOR" Ivan Tubert-Brohman .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2005 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.