VectorOperations extension
- on
Properties
- direction → dynamic
-
Available on Vector, provided by the VectorOperations extension
Returns the direction (or angle) of the vector, in radians.no setter - magnitude → dynamic
-
Available on Vector, provided by the VectorOperations extension
Returns the magnitude (or norm) of the vector.no setter
Methods
-
abs(
) → Vector -
Available on Vector, provided by the VectorOperations extension
Returns a new vector with the absolute values of the original vector's elements. -
cross(
Vector other) → Vector -
Available on Vector, provided by the VectorOperations extension
Calculates the cross product of the vector with another vector. -
dot(
Vector other) → dynamic -
Available on Vector, provided by the VectorOperations extension
Calculates the dot product of the vector with another vector. -
exp(
) → Vector -
Available on Vector, provided by the VectorOperations extension
Returns a new vector with each element being the exponential function of the corresponding element in the original vector. -
innerProduct(
Vector other) → dynamic -
Available on Vector, provided by the VectorOperations extension
Computes the inner product of two vectors. -
isParallelTo(
Vector other) → bool -
Available on Vector, provided by the VectorOperations extension
Checks if this Vector is parallel toother. -
isPerpendicularTo(
Vector other) → bool -
Available on Vector, provided by the VectorOperations extension
Checks if this Vector is perpendicular toother. -
mean(
) → dynamic -
Available on Vector, provided by the VectorOperations extension
Returns the arithmetic mean of the vector. -
median(
) → dynamic -
Available on Vector, provided by the VectorOperations extension
Returns the median value of the vector. If the vector has an even number of elements, the median is calculated as the mean of the two central elements. -
norm(
[Norm normType = Norm.frobenius]) → Complex -
Available on Vector, provided by the VectorOperations extension
Returns the norm (or length) of this vector. -
normalize(
[Norm normType = Norm.frobenius]) → Vector -
Available on Vector, provided by the VectorOperations extension
Returns this vector normalized. -
outerProduct(
Vector other) → Matrix -
Available on Vector, provided by the VectorOperations extension
Computes the outer product of two vectors. -
pow(
num exponent) → Vector -
Available on Vector, provided by the VectorOperations extension
Returns a new vector with each element being raised to the provided exponent. -
product(
) → dynamic -
Available on Vector, provided by the VectorOperations extension
Returns the product of all elements in the vector. -
rescale(
) → Vector -
Available on Vector, provided by the VectorOperations extension
Rescales the vector to the range 0-1. -
round(
[int decimalPlaces = 0]) → Vector -
Available on Vector, provided by the VectorOperations extension
Rounds each element in the vector to the specified number of decimal places. -
scale(
dynamic scalar) → Vector -
Available on Vector, provided by the VectorOperations extension
Scales a vector by a given scalar. -
sum(
) → dynamic -
Available on Vector, provided by the VectorOperations extension
Returns the sum of all elements in the vector.
Operators
-
operator *(
dynamic other) → Vector -
Available on Vector, provided by the VectorOperations extension
-
operator +(
dynamic other) → dynamic -
Available on Vector, provided by the VectorOperations extension
-
operator -(
dynamic other) → dynamic -
Available on Vector, provided by the VectorOperations extension
-
operator /(
dynamic other) → Vector -
Available on Vector, provided by the VectorOperations extension
-
operator unary-(
) → Vector -
Available on Vector, provided by the VectorOperations extension
Negates this vector element-wise.