axiom-developer
[Top][All Lists]

## [Axiom-developer] [FAQ]

 From: Bill Page Subject: [Axiom-developer] [FAQ] Date: Tue, 25 Oct 2005 14:53:20 -0500

Changes http://page.axiom-developer.org/zope/mathaction/FAQ/diff
--

How to multiply two vectors??

Multiplication element by element:

\begin{axiom}
a:= vector [1,2,3,5,6]
map(*,a,a)
\end{axiom}

otherwise use Matrix:
\begin{axiom}
a:= matrix [[1,2,3,4,5,6]]
a * transpose a
\end{axiom}

Tim Daly replies:

make three vectors
\begin{axiom}
)clear all
u : VECTOR INT := new(5,12)
v : VECTOR INT := vector([1,2,3])
w : VECTOR INT := vector([2,3,4])
\end{axiom}
multiply them
\begin{axiom}
cross(v,w)
\end{axiom}
dot product
\begin{axiom}
dot(v,w)
\end{axiom}
\begin{axiom}
#(v)
\end{axiom}
access an element
\begin{axiom}
v.2
\end{axiom}
set an element
\begin{axiom}
v.3 := 99
\end{axiom}
show the vector
\begin{axiom}
v
\end{axiom}
multiply by a constant
on either side
\begin{axiom}
5 * v
v * 7
\end{axiom}

\begin{axiom}
v + w
\end{axiom}

substract them
\begin{axiom}
v - w
\end{axiom}

display all possible functions
\begin{axiom}
)show Vector(Integer)
\end{axiom}

--