Packageindex Classtrees Modulegroups Elementlist Report XML Files

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

Science_Chemistry_Coordinates

Science_Chemistry_Coordinates

Utility class for defining 3D coordinates and

 

public class Science_Chemistry_Coordinates

Utility class for defining 3D coordinates and
its associated distance() method

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

 

Public Method Summary

object Science_Chemistry_Coordinates

Science_Chemistry_Coordinates(array $coords)

Constructor for the class, returns null if parameter is
float

distance(object Science_Chemistry_Coordinates $coord)

Castesian distance calculation method
boolean

areCoordinates(object Science_Chemistry_Coordinates $obj)

Checks if the object is an instance of Science_Chemistry_Coordinates
array

getCoordinates()

Returns the array of coordinates
string

toString()

Returns a string representation of the coordinates: x y z
string

toCML()

Returns a CML representation of the coordinates

Private Field Summary

array

$coords

Array of tridimensional coordinates: (x, y, z)

Public Method Details

Science_Chemistry_Coordinates

public object Science_Chemistry_Coordinates Science_Chemistry_Coordinates( array $coords )

  Constructor for the class, returns null if parameter is
not an array with 3 entries

Parameter
array $coords
array of three floats (x, y, z)
Returns object Science_Chemistry_Coordinates


distance

public float distance( object Science_Chemistry_Coordinates $coord )

  Castesian distance calculation method

Parameter
object Science_Chemistry_Coordinates $coord
Returns float

distance


areCoordinates

public boolean areCoordinates( object Science_Chemistry_Coordinates $obj )

  Checks if the object is an instance of Science_Chemistry_Coordinates

Parameter
object Science_Chemistry_Coordinates $obj
Returns boolean


getCoordinates

public array getCoordinates( )

  Returns the array of coordinates

Returns array

array (x, y, z)


toString

public string toString( )

  Returns a string representation of the coordinates: x y z

Returns string


toCML

public string toCML( )

  Returns a CML representation of the coordinates

Returns string


Private Field Details

$coords

private array $coords

>><<

Array of tridimensional coordinates: (x, y, z)



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta