changeset 34655:112b5b45b3a8 stable

doc: Expand on orthogonality properties of the cross product (bug #67186). * cross.m: Expand documentation on orthogonality properties of the cross product in case of complex output.
author A.R. Burgers <arburgers@gmail.com>
date Fri, 06 Jun 2025 12:18:13 +0200
parents 04752ce59089
children 3e07a1a837b1 1113ac3b3d27
files scripts/linear-algebra/cross.m
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/linear-algebra/cross.m
+++ b/scripts/linear-algebra/cross.m
@@ -32,10 +32,23 @@
 ## If @var{x} and @var{y} are arrays, the cross product is applied along the
 ## first dimension with three elements.
 ##
-## The optional argument  @var{dim} forces the cross product to be calculated
+## The optional argument @var{dim} forces the cross product to be calculated
 ## along the specified dimension.  An error will be produced if the specified
 ## dimension is not three elements in size.
 ##
+## In the case of a complex output, orthogonality of the output with respect
+## to the inputs is also satisfied, and the condition
+## @example
+## @code{dot (conj (@var{z}), @var{x}) @equiv{} dot (conj (@var{z}), @var{y}) = 0}
+## @end example
+## is met.  @code{dot (@var{z}, @var{x}) = 0} and
+## @code{dot (@var{z}, @var{y}) = 0} will not hold.  Also note that instead of
+## using the @code{dot} function, the inner product
+## @example
+## @code{@var{z}(:).' * @var{x}(:) @equiv{} @var{z}(:).' * @var{y}(:) = 0}
+## @end example
+## will meet the orthogonality condition for vector input.
+##
 ## Example Code:
 ##
 ## @example
@@ -56,7 +69,7 @@
 ## @end group
 ## @end example
 ##
-## @seealso{dot, curl, divergence}
+## @seealso{dot, curl, divergence, conj}
 ## @end deftypefn
 
 function z = cross (x, y, dim)