Class de.aitools.js.Vector
Representation of a vector
Defined in: Vector.js.
Constructor Attributes | Constructor Name and Description |
---|---|
A data-structure that representes a mathematical vector
with a set of essential functions to handle some vector instances.
|
Method Attributes | Method Name and Description |
---|---|
add(vector)
Add the given de.aitools.js.Vector to this one
|
|
clone()
Returns a duplicate of this de.aitools.js.Vector
|
|
<static> |
de.aitools.js.Vector.computeCentroid(vectorArr)
Computes the centroid over all given de.aitools.js.Vector instances
|
equals(vector)
Compares this instance with the given de.aitools.js.Vector and
returns the result
|
|
Get the deminsion of this de.aitools.js.Vector
|
|
Get the number of Elementens within this de.aitools.js.Vector
|
|
Get a array of all the indices of this de.aitools.js.Vector
|
|
<static> |
de.aitools.js.Vector.getMaxDimension(vectorArr)
Computes the highest dimension of over all given
de.aitools.js.Vector instances
|
getValue(index)
Get the value at the specified index
|
|
Get an array of all values within this de.aitools.js.Vector
|
|
Returns the normalized state of this de.aitools.js.Vector
|
|
multiply(vector)
Multiplies this and the given de.aitools.js.Vector and
stores the results within this one
|
|
Normalizes this de.aitools.js.Vector
|
|
scalarProduct(vector)
Computes and returns the scalar product between this and the given de.aitools.js.Vector
|
|
scale(factor)
Scales each component according to the specified factor
|
|
setDimension(dimension)
Set the dimension of this de.aitools.js.Vector
|
|
setValue(index, value)
Set a value at a specific index in this de.aitools.js.Vector
|
Class Detail
de.aitools.js.Vector()
A data-structure that representes a mathematical vector
with a set of essential functions to handle some vector instances.
Author: Alexander Kümmel [email protected], Christof Bräutigam [email protected].
Author: Alexander Kümmel [email protected], Christof Bräutigam [email protected].
Method Detail
add(vector)
Add the given de.aitools.js.Vector to this one
- Parameters:
- {de.aitools.js.Vector} vector
- A de.aitools.js.Vector instance
{de.aitools.js.Vector}
clone()
Returns a duplicate of this de.aitools.js.Vector
- Returns:
- {de.aitools.js.Vector} Cloned vector
<static>
{de.aitools.js.Vector}
de.aitools.js.Vector.computeCentroid(vectorArr)
Computes the centroid over all given de.aitools.js.Vector instances
- Parameters:
- {Array} vectorArr
- Array of de.aitools.js.Vector instances
- Returns:
- {de.aitools.js.Vector}
{Boolean}
equals(vector)
Compares this instance with the given de.aitools.js.Vector and
returns the result
- Parameters:
- {de.aitools.js.Vector} vector
- A de.aitools.js.Vector instance
- Returns:
- {Boolean} True if equals
{Number}
getDimension()
Get the deminsion of this de.aitools.js.Vector
- Returns:
- {Number}
{Number}
getElementCount()
Get the number of Elementens within this de.aitools.js.Vector
- Returns:
- {Number}
{Array}
getIndices()
Get a array of all the indices of this de.aitools.js.Vector
- Returns:
- {Array} Array of numbers
<static>
{Number}
de.aitools.js.Vector.getMaxDimension(vectorArr)
Computes the highest dimension of over all given
de.aitools.js.Vector instances
- Parameters:
- {Array} vectorArr
- Array of de.aitools.js.Vector instances
- Returns:
- {Number}
{Number}
getValue(index)
Get the value at the specified index
- Parameters:
- {Number} index
- Returns:
- {Number}
{Array}
getValues()
Get an array of all values within this de.aitools.js.Vector
- Returns:
- {Array} Array of Numbers
{Boolean}
isNormalized()
Returns the normalized state of this de.aitools.js.Vector
- Returns:
- {Boolean} True if already normalized
multiply(vector)
Multiplies this and the given de.aitools.js.Vector and
stores the results within this one
- Parameters:
- {de.aitools.js.Vector} vector
- A de.aitools.js.Vector instance
normalize()
Normalizes this de.aitools.js.Vector
{Number}
scalarProduct(vector)
Computes and returns the scalar product between this and the given de.aitools.js.Vector
- Parameters:
- {de.aitools.js.Vector} vector
- A de.aitools.js.Vector instance
- Returns:
- {Number}
scale(factor)
Scales each component according to the specified factor
- Parameters:
- {Number} factor
- Numeric value
setDimension(dimension)
Set the dimension of this de.aitools.js.Vector
- Parameters:
- {Number} dimension
setValue(index, value)
Set a value at a specific index in this de.aitools.js.Vector
- Parameters:
- {Number} index
- {Number} value