Polar.js

Defines the Polar class.

Description

The Polar class, just like the Complex class, is used by the Hypertree, ST and RGraph as a 2D point representation.

See also

http://en.wikipedia.org/wiki/Polar_coordinates

Summary
Polar.jsDefines the Polar class.
PolarA multi purpose polar representation.
Functions
getcReturns a complex number.
getpReturns a Polar representation.
setSets a number.
setcSets a Complex number.
setpSets a polar number.
cloneReturns a copy of the current object.
toComplexTranslates from polar to cartesian coordinates and returns a new Complex instance.
addAdds two Polar instances.
scaleScales a polar norm.
equalsComparison method.
$addAdds two Polar instances affecting the current object.
$maddAdds two Polar instances affecting the current object.
$scaleScales a polar instance affecting the object.
isZeroReturns true if the number is zero.
interpolateCalculates a polar interpolation between two points at a given delta moment.

Polar

A multi purpose polar representation.

Description

The Polar class, just like the Complex class, is used by the Hypertree, ST and RGraph as a 2D point representation.

See also

http://en.wikipedia.org/wiki/Polar_coordinates

Parameters

thetaAn angle.
rhoThe norm.
Summary
Functions
getcReturns a complex number.
getpReturns a Polar representation.
setSets a number.
setcSets a Complex number.
setpSets a polar number.
cloneReturns a copy of the current object.
toComplexTranslates from polar to cartesian coordinates and returns a new Complex instance.
addAdds two Polar instances.
scaleScales a polar norm.
equalsComparison method.
$addAdds two Polar instances affecting the current object.
$maddAdds two Polar instances affecting the current object.
$scaleScales a polar instance affecting the object.
isZeroReturns true if the number is zero.
interpolateCalculates a polar interpolation between two points at a given delta moment.

Functions

getc

getc: function(simple)

Returns a complex number.

Parameters

simpleoptional If true, this method will return only an object holding x and y properties and not a Complex instance.  Default’s false.

Returns

A complex number.

getp

getp: function()

Returns a Polar representation.

Returns

A variable in polar coordinates.

set

set: function(v)

Sets a number.

Parameters

vA Complex or Polar instance.

setc

setc: function(x,
y)

Sets a Complex number.

Parameters

xA Complex number real part.
yA Complex number imaginary part.

setp

setp: function(theta,
rho)

Sets a polar number.

Parameters

thetaA Polar number angle property.
rhoA Polar number rho property.

clone

clone: function()

Returns a copy of the current object.

Returns

A copy of the real object.

toComplex

toComplex: function(simple)

Translates from polar to cartesian coordinates and returns a new Complex instance.

Parameters

simpleoptional If true this method will only return an object with x and y properties (and not the whole Complex instance).  Default’s false.

Returns

A new Complex instance.

add

add: function(polar)

Adds two Polar instances.

Parameters

polarA Polar number.

Returns

A new Polar instance.

scale

scale: function(number)

Scales a polar norm.

Parameters

numberA scale factor.

Returns

A new Polar instance.

equals

equals: function(c)

Comparison method.

Returns true if the theta and rho properties are equal.

Parameters

cA Polar number.

Returns

true if the theta and rho parameters for these objects are equal.  false otherwise.

$add

$add: function(polar)

Adds two Polar instances affecting the current object.

Paramters

polarA Polar instance.

Returns

The changed object.

$madd

$madd: function(polar)

Adds two Polar instances affecting the current object.  The resulting theta angle is modulo 2pi.

Parameters

polarA Polar instance.

Returns

The changed object.

$scale

$scale: function(number)

Scales a polar instance affecting the object.

Parameters

numberA scaling factor.

Returns

The changed object.

isZero

isZero: function ()

Returns true if the number is zero.

interpolate

interpolate: function(elem,
delta)

Calculates a polar interpolation between two points at a given delta moment.

Parameters

elemA Polar instance.
deltaA delta factor ranging [0, 1].

Returns

A new Polar instance representing an interpolation between this and elem

A multi purpose polar representation.
getc: function(simple)
Returns a complex number.
getp: function()
Returns a Polar representation.
set: function(v)
Sets a number.
setc: function(x,
y)
Sets a Complex number.
A multi-purpose Complex Class with common methods.
setp: function(theta,
rho)
Sets a polar number.
clone: function()
Returns a copy of the current object.
toComplex: function(simple)
Translates from polar to cartesian coordinates and returns a new Complex instance.
add: function(polar)
Adds two Polar instances.
scale: function(number)
Scales a polar norm.
equals: function(c)
Comparison method.
$add: function(polar)
Adds two Polar instances affecting the current object.
$madd: function(polar)
Adds two Polar instances affecting the current object.
$scale: function(number)
Scales a polar instance affecting the object.
isZero: function ()
Returns true if the number is zero.
interpolate: function(elem,
delta)
Calculates a polar interpolation between two points at a given delta moment.
A Hyperbolic Tree/Graph visualization.
A Tree layout with advanced contraction and expansion animations.
A radial graph visualization with advanced animations.
Close