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 |
|
|
Returns |
string |
|