Magnitude
Magnitude
Magnitude[ v, r ] calculates the magnitude (length) of a vector, as an equation for the variable r.
Usages
Magnitude[ v, r ]
Magnitude[ v, r ] calculates the magnitude of the vector v. The result is the equation r = ..., so r is the name of the variable for the magnitude. v can be a column vector, a vector in basis form, a polar vector or a number. In a script, wrap the command in Simplify.
| Example | in | rendered |
|---|---|---|
| A column vector in three dimensions. | Simplify[ Magnitude[ CartesianVector[3, 4, 12], r ] ] |
|
| A vector in basis form. | Simplify[ Magnitude[ BaseVector[3, 4], r ] ] |
|
| The result can be a root. | Simplify[ Magnitude[ CartesianVector[1, 1], r ] ] |
|
| A polar vector. | Simplify[ Magnitude[ PolarVector[5, 1/3 Pi], r ] ] |
|
| Components can be expressions. | Simplify[ Magnitude[ CartesianVector[a, 2], r ] ] |
|
| The magnitude of a number is its absolute value. | Simplify[ Magnitude[ -3, r ] ] |
Details
- Without
Simplify, the command is not calculated. - The variable is required:
Simplify[ Magnitude[ CartesianVector[3, 4] ] ], withoutr, is not calculated.
See also: PolarForm, ComponentForm, CalcAbs