Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Aide de Scilab >> Fonctions Elémentaires > Opérations matricielles > cross

cross

vector cross product

Syntax

C = cross(A,B)

Arguments

A

real, complex, polynomial or boolean matrix of size 3-by-N or 1-by-3.

B

real, complex, polynomial or boolean matrix of same size as A.

C

real, complex, polynomial or boolean matrix of same size as A and B.

Description

cross returns the cross product of A and B, that is:

A and B can be full or sparse matrix. However, rational matrix are not supported. Concerning boolean matrix, cross computes as if %t (resp. %f) was 1 (resp. 0), and '&' (resp. '|') was '*' (resp. '+').

To finish, if A and B are 3-by-N matrix, column-wise computations are done.

Example

A=[1;2;3];
B=[2;3;4];
cross(A,B) //expected: [-1;2;-1]
A=[%i,2,1+%i];
B=[1,%i,2+%i];
cross(A,B) //expected: [5+%i,2-%i,-3]
A=[%t;%f;%t];
B=[%t;%f;%f];
cross(A,B) //expected: [0;1;0]

History

VersionDescription
5.5.0 Function cross introduced.
Report an issue
<< and Opérations matricielles cumprod >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:15:26 CET 2018