OrthogonalMatrixQ
更多信息和选项
- 若有 p≥q 且 Transpose[m].m 为 q×q 单位矩阵,或者 p≤q 且 m.Transpose[m] 为 p×p 单位矩阵,则 p×q 矩阵 m 为正交的.
- OrthogonalMatrixQ 适用于符号和数值矩阵.
- 可以给出以下选项:
-
Normalized True 测试矩阵的列是否被归一化 SameTest Automatic 检验表达式相等的函数 Tolerance Automatic 数值近似的误差允许值 - 对于精确和符号式矩阵,选项 SameTest->f 表明,如果 f[aij,bij] 给出 True,则认为 aij 和 bij 两项相等.
- 对于近似矩阵,选项 Tolerance->t 可用于表示满足 γ≤t 的范数 γ=m.mT-In∞ 当作零,其中 In 为单位矩阵.
范例
打开所有单元 关闭所有单元基本范例 (2)
OrthogonalMatrixQ[(1/Sqrt[2])(| | |
| - | -- |
| 1 | -1 |
| 1 | 1 |)]m = (| | | |
| - | ------ | ------- |
| 1 | 0 | 0 |
| 0 | Cos[α] | -Sin[α] |
| 0 | Sin[α] | Cos[α] |);OrthogonalMatrixQ[m]Transpose[m].m == IdentityMatrix[3]//Simplify范围 (14)
基本用法 (6)
m = (1/Sqrt[5]){{1, 2}, {-2, 1}};OrthogonalMatrixQ[m]UnitaryMatrixQ[m]m = (1/Sqrt[3]){{2, -I}, {I, 2}};OrthogonalMatrixQ[m]m.m == IdentityMatrix[2]UnitaryMatrixQ[m]m = (| | | |
| - | -- | -- |
| 4 | -5 | 2 |
| 3 | -3 | -3 |
| 5 | 5 | 5 |);OrthogonalMatrixQ[m]OrthogonalMatrixQ[Orthogonalize[m]]用 OrthogonalMatrixQ 测试任意精度的矩阵:
m = RandomReal[5, {3, 3}, WorkingPrecision -> 15]OrthogonalMatrixQ[m]用 OrthogonalMatrixQ 测试符号矩阵:
OrthogonalMatrixQ[{{a, b}, {c, d}} / Sqrt[a^2 + b^2]]Block[{c = b, d = -a}, OrthogonalMatrixQ[{{a, b}, {c, d}} / Sqrt[a^2 + b^2]]]OrthogonalMatrixQ 可高效处理大型数值矩阵:
m = RandomReal[1, {1000, 1000}];AbsoluteTiming[OrthogonalMatrixQ[m]]a = Orthogonalize[m];
AbsoluteTiming[OrthogonalMatrixQ[a]]特殊矩阵 (4)
用 OrthogonalMatrixQ 测试稀疏矩阵:
SparseArray[{Band[{1, 1}] -> -1}, {5, 5}]OrthogonalMatrixQ[%]用 OrthogonalMatrixQ 测试结构矩阵:
SymmetrizedArray[{{1, 1} -> (1/Sqrt[2]), {1, 2} -> (1/Sqrt[2]), {2, 2} -> -(1/Sqrt[2])}, {2, 2}, Symmetric[All]]OrthogonalMatrixQ[%]OrthogonalMatrixQ[IdentityMatrix[3]]HilbertMatrix 不是正交矩阵:
OrthogonalMatrixQ[HilbertMatrix[5]]矩形半正交矩阵 (4)
m = (1/2)(| | | | |
| -- | - | - | -- |
| 1 | 1 | 1 | -1 |
| -1 | 1 | 1 | 1 |);OrthogonalMatrixQ[m]m.ConjugateTranspose[m]ConjugateTranspose[m].mm = (1/2)(| | |
| -- | -- |
| 1 | -1 |
| 1 | 1 |
| 1 | 1 |
| -1 | 1 |);OrthogonalMatrixQ[m]ConjugateTranspose[m].mm.ConjugateTranspose[m]m = RandomVariate[CircularRealMatrixDistribution[4]];OrthogonalMatrixQ[m]OrthogonalMatrixQ[m[[RandomSample[Range[4], 2]]]]OrthogonalMatrixQ[m[[All, RandomSample[Range[4], 2]]]]OrthogonalMatrixQ[IdentityMatrix[{3, 4}]]选项 (4)
Normalized (2)
m = {{a, b}, {b, -a}};
OrthogonalMatrixQ[m]OrthogonalMatrixQ[m, Normalized -> False]m = MapAt[2#&, RotationMatrix[π / 4, {1, 0, 1}], {All, 2}]NormalizedFalse 的 OrthogonalMatrixQ 对 m 的测试结果依然为 True:
OrthogonalMatrixQ[m, Normalized -> False]但是,对 Transpose[m] 的结果则不会为真:
OrthogonalMatrixQ[Transpose[m], Normalized -> False]MatrixForm /@ {m.m, m.m}//FullSimplifySameTest (1)
对于正实数
,该矩阵是正交的,但 OrthogonalMatrixQ 给出 False:
m = {{Log[x ^ 2], 1}, {-1, 2Log[x]}} / Sqrt[1 + 4Log[x] ^ 2];OrthogonalMatrixQ[m]使用选项 SameTest 得到正确答案:
OrthogonalMatrixQ[m, SameTest -> (Simplify[#1 - #2, x > 0] == 0&)]Tolerance (1)
SeedRandom[5];n = 3;
q = Orthogonalize[RandomVariate[NormalDistribution[], {n, n}]] + 10 ^ -13 * RandomReal[1, {n, n}];OrthogonalMatrixQ[q]q.q//MatrixForm调整选项 Tolerance,以接受矩阵为正交矩阵:
OrthogonalMatrixQ[q, Tolerance -> 10 ^ -12]Tolerance 应用于下值:
Norm[q.q - IdentityMatrix[3], ∞]应用 (10)
正交矩阵的来源 (5)
Subscript[e, 1] = {(1/Sqrt[2]), (1/Sqrt[2]), 0};Subscript[e, 2] = {(1/Sqrt[2]), -(1/Sqrt[2]), 0};Subscript[e, 3] = {0, 0, 1};Table[Subscript[e, i].Subscript[e, j], {i, 3}, {j, 3}]OrthogonalMatrixQ[{Subscript[e, 1], Subscript[e, 2], Subscript[e, 3]}]OrthogonalMatrixQ[{Subscript[e, 1], Subscript[e, 2], Subscript[e, 3]}]将 Orthogonalize 应用于实线性独立向量可生成正交矩阵:
m = Orthogonalize[RandomReal[1., {5, 5}]];OrthogonalMatrixQ[m]m = Orthogonalize[RandomReal[1., {5, 3}]];OrthogonalMatrixQ[m]m = Orthogonalize[RandomReal[1., {3, 5}]];OrthogonalMatrixQ[m]m = (| | |
| - | - |
| 1 | 2 |
| 1 | 2 |);MatrixRank[m]OrthogonalMatrixQ[Orthogonalize[m]]OrthogonalMatrixQ[RotationMatrix[RandomReal[2 Pi]]]w = RandomReal[1., {3}];
OrthogonalMatrixQ[RotationMatrix[RandomReal[2 Pi], w]]u = RandomReal[1., {3}];
OrthogonalMatrixQ[RotationMatrix[RandomReal[2 Pi], {u, w}]]m = PermutationMatrix[{2, 4, 1, 3}, TargetStructure -> "Dense"]OrthogonalMatrixQ[m]从 CircularRealMatrixDistribution 得到的矩阵是正交矩阵:
OrthogonalMatrixQ /@ RandomVariate[CircularRealMatrixDistribution[3], 10]正交矩阵的用途 (5)
正交矩阵保留了
上的标准内积. 换句话说,如果
是正交矩阵,
和
为向量,则
:
o = RotationMatrix[Pi / 3, RandomReal[1, 3]];
{u, v} = RandomReal[1, {2, 3}];
OrthogonalMatrixQ[o] && u.v == (o.u).(o.v)VectorAngle[u, v] == VectorAngle[o.u, o.v]Norm[u] == Norm[o.u]Norm[v] == Norm[o.v]任何正交矩阵都表示旋转和/或反射. 如果矩阵的行列式为
,则为旋转. 如果行列式是
,则矩阵包含反射. 考虑以下矩阵:
m = (| | |
| ------------------- | -------------------- |
| -0.9980858626557927 | -0.06184343753901693 |
| 0.06184343753901693 | -0.9980858626557927 |);OrthogonalMatrixQ[m] && Det[m] == 1o = {0, 0};i = UnitVector[1];j = UnitVector[2];
Graphics[{{Blue, {Arrow[{o, m.i}], Dotted, Arrow[{o, i}]}}, {Red, {Arrow[{o, m.j}], Dotted, Arrow[{o, j}]}}}]m = (| | |
| ------------------- | ------------------- |
| -0.6512037846116245 | -0.7589029127019458 |
| -0.7589029127019458 | 0.6512037846116244 |);OrthogonalMatrixQ[m] && Det[m] == -1Graphics[{{Blue, {Arrow[{o, m.i}], Dotted, Arrow[{o, i}]}}, {Red, {Arrow[{o, m.j}], Dotted, Arrow[{o, j}]}}}]m = RandomReal[{-1., 1.}, {50, 50}];
{q, r} = QRDecomposition[m];
OrthogonalMatrixQ[q]{u, w, v} = SingularValueDecomposition[m];
{OrthogonalMatrixQ[u], OrthogonalMatrixQ[v]}{s, t} = SchurDecomposition[m];
OrthogonalMatrixQ[s]{p, h} = HessenbergDecomposition[m];
OrthogonalMatrixQ[p]n = 5;
Subscript[ℋ, v_] := IdentityMatrix[n] - 2 vv / v.v;
v = RandomReal[1, n];
OrthogonalMatrixQ[Subscript[ℋ, v]]Det[Subscript[ℋ, v]]Subscript[ℋ, v].v == -vperp = Block[{w = RandomReal[1, n]}, w - Projection[w, v]];
Subscript[ℋ, v].perp == perpx = RandomReal[1, n];v = x - x[[1]] / Abs[x[[1]]] Norm[x]UnitVector[n, 1];
Subscript[ℋ, v].{x}//Chop(ⅆx/ⅆt) = Overscript[v, ⇀]⨯x, Overscript[v, ⇀] = {2, -1, 1}, x(0) = {1, 0, -1};vvec = {2, -1, 1};
(v = -LeviCivitaTensor[3].vvec)//MatrixFormAntisymmetricMatrixQ[v]v.{Subscript[x, 1], Subscript[x, 2], Subscript[x, 3]} == vvec⨯{Subscript[x, 1], Subscript[x, 2], Subscript[x, 3]}u[t_] := MatrixExp[v t]
x0 = {1, 0, -1};
x[t_] = u[t].x0x'[t] == v.x[t] && x[0] == x0//SimplifyOrthogonalMatrixQ[u[t]]Show[ParametricPlot3D[x[t], {t, 0., 5.}, PlotStyle -> Tube[0.02]], Graphics3D[{Opacity[.5], Sphere[{0, 0, 0}, Norm[x0]]}], PlotRange -> All]属性和关系 (14)
如果 m.Transpose[m]IdentityMatrix[n],则矩阵是正交的:
m = {{Cos[α], -Sin[α]}, {Sin[α], Cos[α]}};{OrthogonalMatrixQ[m], m.m//Simplify}m = RandomVariate[CircularRealMatrixDistribution[3]];{OrthogonalMatrixQ[m], Norm[m.m - IdentityMatrix[3]]}o = RandomVariate[CircularRealMatrixDistribution[3]];Inverse[o] == Transpose[o]{OrthogonalMatrixQ[Inverse[o]], OrthogonalMatrixQ[Transpose[o]]}o = RandomVariate[CircularRealMatrixDistribution[4]];
{u, v} = RandomReal[1, {2, 4}];
OrthogonalMatrixQ[o] && u.v == (o.u).(o.v)Norm[u] == Norm[o.u]Norm[v] == Norm[o.v]m = Orthogonalize[RandomReal[1, {3, 3}]];{OrthogonalMatrixQ[m], UnitaryMatrixQ[m]}m = Orthogonalize[RandomComplex[1 + I, {3, 3}]];{OrthogonalMatrixQ[m], UnitaryMatrixQ[m]}{m1, m2} = RandomVariate[CircularRealMatrixDistribution[3], 2];
{OrthogonalMatrixQ[m1], OrthogonalMatrixQ[m2]}OrthogonalMatrixQ[m1.m2]m = Orthogonalize[RandomReal[1, {3, 3}]];{OrthogonalMatrixQ[m], NormalMatrixQ[m]}c = (1/Sqrt[-1 - 2I])(| | |
| ----- | ----- |
| I - 1 | I |
| I | 1 - I |);{OrthogonalMatrixQ[c], NormalMatrixQ[c]}m = RandomVariate[CircularRealMatrixDistribution[3]];OrthogonalMatrixQ[m]用 Eigenvalues 求特征值:
Eigenvalues[m]Abs[%]c = (1/Sqrt[3]){{2, -I}, {I, 2}};
OrthogonalMatrixQ[c]Eigenvalues[c]m = RandomVariate[CircularRealMatrixDistribution[3]];OrthogonalMatrixQ[m]DiagonalizableMatrixQ[m]用 Eigenvectors 求特征向量:
Eigenvectors[m]c = (| | | |
| ----- | ------ | ----- |
| 1 + I | -1 + I | -1 |
| 1 - I | 1 | 1 + I |
| -1 | -1 - I | 1 - I |);{OrthogonalMatrixQ[c], DiagonalizableMatrixQ[c]}m = Orthogonalize[RandomReal[1, {3, 3}]];OrthogonalMatrixQ[m]SingularValueList[m]c = (1/5Sqrt[3])(| | |
| ------ | ------ |
| 4 - 2I | 8 + I |
| -8 - I | 4 - 2I |);OrthogonalMatrixQ[c]SingularValueList[c]m = RandomVariate[CircularRealMatrixDistribution[3]];{OrthogonalMatrixQ[m], RealAbs[Det[m]]}m = Orthogonalize[RandomReal[1, {3, 3}]];{OrthogonalMatrixQ[m], Norm[m]}c = (1/5Sqrt[3])(| | |
| -------- | ------- |
| 8 + I | 4 - 2 I |
| -4 + 2 I | 8 + 1I |);{OrthogonalMatrixQ[c], Norm[c]}m = RandomVariate[CircularRealMatrixDistribution[3]];OrthogonalMatrixQ[m]UnitaryMatrixQ[MatrixPower[m, RandomInteger[{-10, 10}]]]对于实非对称矩阵 m,MatrixExp[m] 是正交矩阵和酉矩阵:
m = Symmetrize[RandomReal[1, {5, 5}], Antisymmetric[{1, 2}]];
expm = MatrixExp[m];{OrthogonalMatrixQ[expm], UnitaryMatrixQ[expm]}对于复非对称矩阵 m,矩阵指数是正交矩阵,但(一般情况下)不是酉矩阵:
mc = Symmetrize[RandomComplex[1 + I, {5, 5}], Antisymmetric[{1, 2}]];
expmc = MatrixExp[mc];{OrthogonalMatrixQ[expmc], UnitaryMatrixQ[expmc]}OrthogonalMatrix 可用于明确构建正交矩阵:
OrthogonalMatrix[RandomVariate[CircularRealMatrixDistribution[3]]]这满足 OrthogonalMatrixQ:
OrthogonalMatrixQ[%]可能存在的问题 (1)
OrthogonalMatrixQ 对实矩阵和复矩阵都使用定义
:
c = (1/Sqrt[-1 - 8 I])(| | |
| -------- | -------- |
| I | -2 + 2 I |
| -2 + 2 I | -I |);{OrthogonalMatrixQ[c] , c.c == IdentityMatrix[2]}NormalMatrixQ[c]UnitaryMatrixQ 测试的是更常见的定义
,可确保复矩阵是正规矩阵:
UnitaryMatrixQ[c]orthogonalMatrixQ[m_] := OrthogonalMatrixQ[m] && Element[m, Reals]orthogonalMatrixQ[c]巧妙范例 (1)
cow = ExampleData[{"Geometry3D", "Cow"}, "GraphicsComplex"];
p = {0, 0, -0.25161901116371155};Table[OrthogonalMatrixQ[RotationMatrix[k Pi / 4., {0, 0, 1}]], {k, -1, 1}]Graphics3D[{EdgeForm[None], Opacity[0.5], Table[{Lighter[ColorData[97, k + 2]], GeometricTransformation[cow, {RotationMatrix[k Pi / 4., {0, 0, 1}], p}]}, {k, -1, 1}]}, Lighting -> "Neutral", ImageSize -> Large, Boxed -> False]相关指南
-
▪
- 矩阵判断
文本
Wolfram Research (2014),OrthogonalMatrixQ,Wolfram 语言函数,https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html.
CMS
Wolfram 语言. 2014. "OrthogonalMatrixQ." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html.
APA
Wolfram 语言. (2014). OrthogonalMatrixQ. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html 年
BibTeX
@misc{reference.wolfram_2026_orthogonalmatrixq, author="Wolfram Research", title="{OrthogonalMatrixQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html}", note=[Accessed: 06-December-2026]}
BibLaTeX
@online{reference.wolfram_2026_orthogonalmatrixq, organization={Wolfram Research}, title={OrthogonalMatrixQ}, year={2014}, url={https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html}, note=[Accessed: 06-December-2026]}