Source for file Atom.php
Documentation is available at Atom.php
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Jesus M. Castagnetto <jmcastagnetto@php.net> |
// +----------------------------------------------------------------------+
require_once "Science/Chemistry.php";
* Base class representing an Atom
* @author Jesus M. Castagnetto <jmcastagnetto@php.net>
* @package Science_Chemistry
* Science_Chemistry_Coordinates object
* @var object Science_Chemistry_Coordinates
* Constructor for the class, requires the element symbol
* and an optional array of coordinates
* @param string $element chemical symbol
* @param optional array $coords array of coordinates (x, y, z)
* @return object Science_Chemistry_Atom
if ($element && preg_match("/[[:alpha:]]{1,2}/", $element))
$this->element = $element;
* Sets the coordinates for the atom object
* @param array $coords array of coordinates (x, y, z)
return (is_object($this->xyz) && !empty ($this->xyz));
* Returns the chemical symbol for the atom
* Returns the coordinates object for the atom
* @return object Science_Chemistry_Coordinates
* Calculates the cartesian distance from this atom
* @param object Science_Chemistry_Atom $atom2
return $this->xyz->distance($atom2->xyz );
* Checks if the object is an instance of Science_Chemistry_Atom
* @param object Science_Chemistry_Atom $obj
* Returns a string representation of the Science_Chemistry_Atom object
* Returns a XYZ representation of the Science_Chemistry_Atom object
if ($this->element && $this->xyz)
* Returns a CML representation of the Science_Chemistry_Atom object
* @param optional string $id
$out = " <atom title=\"atom\" id=\"$id\">\n";
$out .= " <string title=\"name\">". $this->element. "</string>\n";
$out .= " ". $this->xyz->toCML();
} // end of class Science_Chemistry_Atom
// vim: expandtab: ts=4: sw=4
Documentation generated on Mon, 11 Mar 2019 15:48:15 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|