Documentation

Math
in package
Uses Term, Sphere

Table of Contents

$termPattern  : string
$operatorPattern  : string
calculateTerm()  : mixed
haversine()  : float
isTerm()  : bool|int

Properties

$termPattern

public static string $termPattern = '/^[0-9\.]* ?([\+\-\*\/]+ ?[0-9\.]*)*$/'

$operatorPattern

private static string $operatorPattern = '[\+\-\*\/]+'

Methods

calculateTerm()

public static calculateTerm(string $term[, mixed $returnInvalid = null ]) : mixed
Parameters
$term : string
$returnInvalid : mixed = null
Return values
mixed

haversine()

public static haversine(object|array<string|int, mixed> $pos1, object|array<string|int, mixed> $pos2[, float|string|null $radius = null ][, string|int|null $lat1PropertyName = 'lat' ][, string|int|null $lon1PropertyName = 'lon' ][, string|int|null $lat2PropertyName = 'lat' ][, string|int|null $lon2PropertyName = 'lon' ]) : float
Parameters
$pos1 : object|array<string|int, mixed>
$pos2 : object|array<string|int, mixed>
$radius : float|string|null = null
$lat1PropertyName : string|int|null = 'lat'
$lon1PropertyName : string|int|null = 'lon'
$lat2PropertyName : string|int|null = 'lat'
$lon2PropertyName : string|int|null = 'lon'
Return values
float

isTerm()

public static isTerm(string $term) : bool|int
Parameters
$term : string
Return values
bool|int

Search results