math.Range Extends
A number range.

Inheritance

Constructor

goog.math.Range(ab)

Parameters

a : number
One end of the range.
b : number
The other end of the range.

Instance Methods

Public Protected Private
clone() !goog.math.Range
No description.
Returns: !goog.math.Range  A clone of this Range.
code »
getLength() number
No description.
Returns: number  Length of the range.
code »
includePoint(point)
Extends this range to include the given point.
Arguments:
point : number
No description.
code »
includeRange(range)
Extends this range to include the given range.
Arguments:
range : !goog.math.Range
No description.
code »
toString() string
Returns a string representing the range.
Returns: string  In the form [-3.5, 8.13].
code »

Instance Properties

end :
The highest value in the range.
Code »
start :
The lowest value in the range.
Code »

Static Methods

goog.math.Range.boundingRange(ab) !goog.math.Range
Given two ranges on the same dimension, this returns a range that covers both ranges.
Arguments:
a : goog.math.Range
A Range.
b : goog.math.Range
A Range.
Returns: !goog.math.Range  A new Range representing the bounding range.
code »
goog.math.Range.contains(ab) boolean
Given two ranges, returns true if the first range completely overlaps the second.
Arguments:
a : goog.math.Range
The first Range.
b : goog.math.Range
The second Range.
Returns: boolean  True if b is contained inside a, false otherwise.
code »
goog.math.Range.containsPoint(rangep) boolean
Given a range and a point, returns true if the range contains the point.
Arguments:
range : goog.math.Range
The range.
p : number
The point.
Returns: boolean  True if p is contained inside range, false otherwise.
code »
goog.math.Range.equals(ab) boolean
Compares ranges for equality.
Arguments:
a : goog.math.Range
A Range.
b : goog.math.Range
A Range.
Returns: boolean  True iff both the starts and the ends of the ranges are equal, or if both ranges are null.
code »
goog.math.Range.fromPair(pair) !goog.math.Range
Creates a goog.math.Range from an array of two numbers.
Arguments:
pair : !Array.<number>
No description.
Returns: !goog.math.Range  No description.
code »
goog.math.Range.hasIntersection(ab) boolean
Given two ranges on the same dimension, determines whether they intersect.
Arguments:
a : goog.math.Range
A Range.
b : goog.math.Range
A Range.
Returns: boolean  Whether they intersect.
code »
goog.math.Range.intersection(ab) goog.math.Range
Given two ranges on the same dimension, this method returns the intersection of those ranges.
Arguments:
a : goog.math.Range
A Range.
b : goog.math.Range
A Range.
Returns: goog.math.Range  A new Range representing the intersection of two ranges, or null if there is no intersection. Ranges are assumed to include their end points, and the intersection can be a point.
code »

Package math

Package Reference