Returns the components of this
vector. The index values start
from 1
instead of the commonly used starting index 0
.
Returns the class of which this object is an instance of.
The number of components this
has.
Evaluates and returns the negated value of a vector constant. A negative vector \( - \overrightarrow{A} \) is defined such that
\[ \overrightarrow{A} + \left( - \overrightarrow{A} \right) = \overrightarrow{0} \].
Component wise, if \( \overrightarrow{A} = a_i \hat{e_i} \), it can be expressed as
\[ - \overrightarrow{A} = -a_i \hat{e_i} \].
Adds two Vectors together. If this
and that
are both constants
then vectorially adds the two and returns a new Vector.Constant object
otherwise creates an Expression out of them and returns the same.
The scalar to add this
with.
The result of algebraic addition.
Evaluates the vector product of this
and that
. If both are constants
then numerically computes the product and returns a Vector.Constant object
otherwise creates an Expression out of them and returns the same.
The scalar to subtract from this
.
The vector product of this
and that
.
Evaluates the scalar product of this
and that
. If both are constants
then numerically computes the product and returns a Scalar.Constant object
otherwise creates an Expression out of them and returns the same.
The scalar to subtract from this
.
The inner product of this
and that
.
Checks whether a method exists on the object or as a static member of the class.
Name of the method.
Scales, or multiplies the "size" (magnitude) of, this
vector by given
amount. If this
and k
are both constants then numerically calculates
the scaled vector otherwise creates an Expression out of them and
returns the same.
The scale factor.
The scaled vector.
Subtracts that
from this
. If this
and that
are both constants
then vectorially subtracts one from the other and returns a new
Vector.Constant object otherwise creates an Expression out of them
and returns the same.
The scalar to subtract from this
.
The result of algebraic subtraction.
Creates a new Vector.Constant object from a list of numbers if it has not been created before. Otherwise just returns the previously created object.
This is the recommended way of creating Vector.Constant objects instead of using the constructor.
The fixed value the Vector.Constant is supposed to represent.
Defines a named Vector.Constant object from a list of numbers if it has not been created before. Otherwise just returns the previously created object.
This is the recommended way of creating named Vector.Constant objects instead of using the constructor.
The fixed value the Vector.Constant is supposed to represent.
The string with which this
object is identified.
Creates a new Vector.Constant object from a list of Scalar.Constant objects if it has not been created before. Otherwise just returns the previously created object.
This is the recommended way of creating Vector.Constant objects instead of using the constructor.
The fixed value the Vector.Constant is supposed to represent.
Defines a named Vector.Constant object from a list of Scalar.Constant objects if it has not been created before. Otherwise just returns the previously created object.
This is the recommended way of creating named Vector.Constant objects instead of using the constructor.
The fixed value the Vector.Constant is supposed to represent.
The string with which this
object is identified.
Returns a previously declared named Vector.Constant object.
The name of the named Vector.Constant object to be retrieved.
Returns a single cartesian vector unit corresponding to a given index. The indexing starts from 1. With \( \hat{e_1} = \hat{i} \) and so on (for \( i>0 \)) are the orthogonal cartesian vector units.
The index.
Computes the magnitude of a constant vector numerically.
Computes the magnitude of a given vector. If A
vector is a constant
vector then numerically calculates the magnitude otherwise creates a
scalar Expression and returns the same.
For a given constant vector A
, numerically evaluates the unit vector along A
.
The Vector.Constant along which the unit vector is to be calculated.
The unit vector along the given Vector A
.
For a given variable vector A
, creates an Expression for the unit vector along A
.
The Vector.Constant along which the unit vector is to be calculated.
The unit vector along the given Vector A
.
Creates a new Vector.Variable object if it has not been created before. Otherwise just returns the previously created object.
This is the recommended way of creating Vector.Variable objects instead of using the constructor.
The string with which this
object will be identified.
Creates a new Vector.Variable object if it has not been created before. Otherwise just returns the previously created object.
This is the recommended way of creating Vector.Variable objects instead of using the constructor.
The string with which this
object will be identified.
Creates a Vector.Variable object from an array. The array may
contain known scalar constants and, for the components yet unknown,
__. Passing __
as an element of the value
array automatically
gets interpreted as having a variable at that index. This allows for
creation of vectors whose few components are known before hand and
the rest are not. For example,
const A = Vector.variable("A", [1, __, 4, __, 2]);
console.log(A);
This line of code will create a vector whose 2nd and 4th components are Scalar.Variable objects and the remaining will be Scalar.Constant objects.
This is the recommended way of creating Vector.Variable objects instead of using the constructor.
The name with which the Vector.Variable is going to be identified.
The array containing the values with which to initialise the vector variable object.
Generated using TypeDoc
Base class to work with vector quantities. Vectors can be represented as a list of numbers, the vector components. The current implementation of this class work only with Cartesian vector systems and therefore, Cartesian coordinates. Any particular vector object has a pre-assigned value for dimension. The dimensionality of vectors which are results of vector operations are calculated depending on the dimension of the vectors being operated upon.