Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
opt /
lampp /
lib /
php /
Science /
Chemistry /
[ HOME SHELL ]
Name
Size
Permission
Action
Atom_PDB.php
6.34
KB
-rw-r--r--
Atom.php
5.26
KB
-rw-r--r--
Coordinates.php
4.03
KB
-rw-r--r--
Element.php
3.51
KB
-rw-r--r--
Macromolecule_PDB.php
3.12
KB
-rw-r--r--
Macromolecule.php
5.74
KB
-rw-r--r--
Molecule.php
11.8
KB
-rw-r--r--
Molecule_XYZ.php
3.92
KB
-rw-r--r--
PDBFile.php
5.72
KB
-rw-r--r--
PDBParser.php
9.01
KB
-rw-r--r--
Periodic_Table.php
15.68
KB
-rw-r--r--
Residue_PDB.php
4.14
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Atom.php
<?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | 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> | // +----------------------------------------------------------------------+ // // $Id$ // require_once "Science/Chemistry.php"; /** * Base class representing an Atom * * @author Jesus M. Castagnetto <jmcastagnetto@php.net> * @version 1.0 * @access public * @package Science_Chemistry */ class Science_Chemistry_Atom { /** * Element symbol * * @var string * @access private * * @see getElement(); */ var $element=""; /** * Science_Chemistry_Coordinates object * * @var object Science_Chemistry_Coordinates * @access private * * @see getCoordinates(); */ var $xyz; /** * 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) * @access public * @return object Science_Chemistry_Atom * * @see setCoordinates() */ function Science_Chemistry_Atom($element, $coords="") { if ($element && preg_match("/[[:alpha:]]{1,2}/", $element)) $this->element = $element; else return null; if (is_array($coords) && count($coords) == 3) if (!$this->xyz = new Science_Chemistry_Coordinates($coords)) return null; } /** * Sets the coordinates for the atom object * * @param array $coords array of coordinates (x, y, z) * @return boolean * @access public */ function setCoordinates($coords) { $this->xyz = new Science_Chemistry_Coordinates($coords); return (is_object($this->xyz) && !empty($this->xyz)); } /** * Returns the chemical symbol for the atom * * @return string * @access public * * @see $element; */ function getElement() { return $this->element; } /** * Returns the coordinates object for the atom * * @return object Science_Chemistry_Coordinates * @access public * * @see $xyz; */ function getCoordinates() { return $this->xyz; } /** * Calculates the cartesian distance from this atom * instance to another * * @param object Science_Chemistry_Atom $atom2 * @return float distance * @access public */ function distance($atom2) { if (!empty($this->xyz) && Science_Chemistry_Coordinates::areCoordinates($this->xyz) && Science_Chemistry_Atom::isAtom($atom2)) return $this->xyz->distance($atom2->xyz); else return -1.0; } /** * Checks if the object is an instance of Science_Chemistry_Atom * * @param object Science_Chemistry_Atom $obj * @return boolean * @access public */ function isAtom($obj) { return (is_object($obj) && (strtolower(strtolower(get_class($obj))) == strtolower("Science_Chemistry_Atom") || is_subclass_of($obj, strtolower("Science_Chemistry_Atom"))) ); } /** * Returns a string representation of the Science_Chemistry_Atom object * Alias of toXYZ() * * @return string * @access public * @see toXYZ() */ function toString() { return $this->toXYZ(); } /** * Returns a XYZ representation of the Science_Chemistry_Atom object * * @return string * @access public * @see toString() */ function toXYZ() { if ($this->element && $this->xyz) return sprintf("%2s",$this->element)." ".$this->xyz->toString(); } /** * Returns a CML representation of the Science_Chemistry_Atom object * Accepts an optional id * * @param optional string $id * @return string * @access public */ function toCML($id=1) { $out = " <atom title=\"atom\" id=\"$id\">\n"; $out .= " <string title=\"name\">".$this->element."</string>\n"; $out .= " ".$this->xyz->toCML(); $out .= " </atom>\n"; return $out; } } // end of class Science_Chemistry_Atom // vim: expandtab: ts=4: sw=4 ?>
Close