Phang  2.1
 All Classes Files Functions Variables Pages
Static Public Member Functions
Length Class Reference

Calculate between measurements of length. More...

Inheritance diagram for Length:
Base

List of all members.

Static Public Member Functions

static mm_to_inches ($value_mm)
 Convert millimetres to inches.
static inches_to_mm ($value_inches)
 Convert inches to millimetres.
static inches_to_feet ($value_inches, $options=array())
 Convert inches to feet.
static feet_to_inches ($value_feet)
 Convert feet to inches.
static mm_to_feet ($value_mm, $options=array())
 Convert millimetres to feet.
static points_to_distance ($point1, $point2, $unit='k')
 Find the distance between two points (latitude, longitude).
static round_to ($number, $round_to, $round_up_down_closest='closest')
 Round a number.

Additional Inherited Members

- Public Member Functions inherited from Base
 __call ($function, $params)
 The 'magic' call method will get/set for us invoked when the interpreter can not find a method the user is asking for.
 set_parameters ($arguments)
 Set variables from an array to member fields requires $this->optional_arguments or $this->required_arguments to have been set by the subclass.
- Protected Attributes inherited from Base
 $optional_arguments = array()
 Array of options that can be set to variables.
 $required_arguments = array()
 Array of options that need to be set to variables.

Detailed Description

Calculate between measurements of length.


Member Function Documentation

static Length::feet_to_inches (   $value_feet)
static

Convert feet to inches.

Parameters:
$value_feetthe value in mm, e.g. '8'
static Length::inches_to_feet (   $value_inches,
  $options = array() 
)
static

Convert inches to feet.

Parameters:
$value_inchesthe value in mm, e.g. '400'
$options- array of options:
  • decimal_places - the number of decimal places, e.g. '2'
  • is_remainder - use the remainder (true/false)
  • round - how to round the number ('up'/'down'/'closest')
static Length::inches_to_mm (   $value_inches)
static

Convert inches to millimetres.

Parameters:
$value_inchesthe value in inches, e.g. '6'
static Length::mm_to_feet (   $value_mm,
  $options = array() 
)
static

Convert millimetres to feet.

Parameters:
$value_mmthe value in mm, e.g. '450'
$options- array of options:
  • decimal_places - the number of decimal places, e.g. '2'
  • is_remainder - use the remainder (true/false)
  • round - how to round the number ('up'/'down'/'closest')
static Length::mm_to_inches (   $value_mm)
static

Convert millimetres to inches.

Parameters:
$value_mmthe value in mm, e.g. '40'
static Length::points_to_distance (   $point1,
  $point2,
  $unit = 'k' 
)
static

Find the distance between two points (latitude, longitude).

Parameters:
$point1the first point, e.g. array(30,30)
$point2the second point e.g. array(150,-30)
$unitthe unit of distance ('k'=km, 'm'=miles, 'n'=nautical miles)
static Length::round_to (   $number,
  $round_to,
  $round_up_down_closest = 'closest' 
)
static

Round a number.

Parameters:
$numberthe number to round
$round_tothe number of decimal places to round to
$round_up_down_closestround up down or closest, e.g. 'down'

The documentation for this class was generated from the following file: