Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/jesus/devel/php/pear/Science/Chemistry/Atom.php
Chemical classes - Science_Chemistry

Science_Chemistry_Atom

Science_Chemistry_Atom

Base class representing an Atom

 

public class Science_Chemistry_Atom

Base class representing an Atom

AuthorsJesus M. Castagnetto <jmcastagnetto@php.net>
Version1.0

 
Direct known subclasses: Science_Chemistry_Atom_PDB

Public Method Summary

object Science_Chemistry_Atom

Science_Chemistry_Atom(string $element, [ string $coords ])

Constructor for the class, requires the element symbol
boolean

setCoordinates(array $coords)

Sets the coordinates for the atom object
string

getElement()

Returns the chemical symbol for the atom
object Science_Chemistry_Coordinates

getCoordinates()

Returns the coordinates object for the atom
float

distance(object Science_Chemistry_Atom $atom2)

Calculates the cartesian distance from this atom
boolean

isAtom(object Science_Chemistry_Atom $obj)

Checks if the object is an instance of Science_Chemistry_Atom
string

toString()

Returns a string representation of the Science_Chemistry_Atom object
string

toCML([ integer $id ])

Returns a CML representation of the Science_Chemistry_Atom object

Private Field Summary

string

$element

Element symbol
object Science_Chemistry_Coordinates

$xyz

Science_Chemistry_Coordinates object

Public Method Details

Science_Chemistry_Atom

public object Science_Chemistry_Atom Science_Chemistry_Atom( string $element, [ string $coords ] )

  Constructor for the class, requires the element symbol
and an optional array of coordinates

Parameter
string $element
chemical symbol
string $coords = >>""<<
array of coordinates (x, y, z)
Returns object Science_Chemistry_Atom

See Also setCoordinates()

setCoordinates

public boolean setCoordinates( array $coords )

  Sets the coordinates for the atom object

Parameter
array $coords
array of coordinates (x, y, z)
Returns boolean


getElement

public string getElement( )

  Returns the chemical symbol for the atom

Returns string

See Also $element

getCoordinates

public object Science_Chemistry_Coordinates getCoordinates( )

  Returns the coordinates object for the atom

Returns object Science_Chemistry_Coordinates

See Also $xyz

distance

public float distance( object Science_Chemistry_Atom $atom2 )

  Calculates the cartesian distance from this atom
instance to another

Parameter
object Science_Chemistry_Atom $atom2
Returns float

distance


isAtom

public boolean isAtom( object Science_Chemistry_Atom $obj )

  Checks if the object is an instance of Science_Chemistry_Atom

Parameter
object Science_Chemistry_Atom $obj
Returns boolean


toString

public string toString( )

  Returns a string representation of the Science_Chemistry_Atom object

Returns string


toCML

public string toCML( [ integer $id ] )

  Returns a CML representation of the Science_Chemistry_Atom object
Accepts an optional id

Parameter
integer $id = >>1<<
Returns string


Private Field Details

$element

private string $element

>>""<<

Element symbol

See Also getElement()

$xyz

private object Science_Chemistry_Coordinates $xyz

>><<

Science_Chemistry_Coordinates object

See Also getCoordinates()


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta