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 ] ] r=13r=13
A vector in basis form. Simplify[ Magnitude[ BaseVector[3, 4], r ] ] r=5r=5
The result can be a root. Simplify[ Magnitude[ CartesianVector[1, 1], r ] ] r=2r=\sqrt{2}
A polar vector. Simplify[ Magnitude[ PolarVector[5, 1/3 Pi], r ] ] r=5r=5
Components can be expressions. Simplify[ Magnitude[ CartesianVector[a, 2], r ] ] r=a2+4r=\sqrt{a^2+4}
The magnitude of a number is its absolute value. Simplify[ Magnitude[ -3, r ] ] r=3r=3
Details
  • Without Simplify, the command is not calculated.
  • The variable is required: Simplify[ Magnitude[ CartesianVector[3, 4] ] ], without r, is not calculated.

See also: PolarForm, ComponentForm, CalcAbs