```;;; -*- Mode:Lisp; Syntax: Common-Lisp; Package:ONTOLINGUA-USER; Base:10 -*-

;;; 3D-Tensor Quantities
;;; (c) 1993,1994 Gregory R. Olsen and Thomas R. Gruber

(in-package "ONTOLINGUA-USER")

(define-theory 3D-TENSOR-QUANTITIES (tensor-quantities)

"This theory specializes the Tensor-Quantities for tensors of spatial.dimension 3.  3D-tensors are ubiquitous in engineering analysis and have important special properties.  The cross product (or vector product) is defined for vector-quantities of spatial.dimension 3."
:issues ("(c) 1993, 1994 Gregory R. Olsen and Thomas R. Gruber"
(:see-also "The EngMath paper on line")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 3-Dimensional Tensor-Quantity Algebra
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(in-theory '3D-tensor-quantities)

"Second order tensors of 3-dimensions."

(spatial.dimension ?x 3)))

(define-class 3D-VECTOR-QUANTITY (?x)

"Vectors of 3-dimensions. (These vectors have important properities
and are of particular interest to engineering analysis)."

:def (and (vector-quantity ?x)
(spatial.dimension ?x 3)))

(define-function CROSS (?v1 ?v2) :-> ?v

"Vector or cross product of two three dimensional vectors.  If we
know the components of two vectors with respect to a common basis, we
can determine the components of the cross product in that basis."

:iff-def (and
(3d-vector-quantity ?v1)
(3d-vector-quantity ?v2)
(3d-vector-quantity ?v)

(= (quantity.dimension ?v)
(* (quantity.dimension ?v1)
(quantity.dimension ?v2)))

(= (dot ?v1 ?v)
(the-zero-scalar-for-dimension
(* (quantity.dimension ?v1)
(quantity.dimension ?v))))

(= (dot ?v2 ?v)
(the-zero-scalar-for-dimension
(* (quantity.dimension ?v2)
(quantity.dimension ?v))))

(and
(= (vector-component ?v 1 ?b)
(-
(* (vector-component ?v1 2 ?b)
(vector-component ?v2 3 ?b))
(* (vector-component ?v2 2 ?b)
(vector-component ?v1 3 ?b))))
(= (vector-component ?v 2 ?b)
(-
(* (vector-component ?v2 1 ?b)
(vector-component ?v1 3 ?b))
(* (vector-component ?v1 1 ?b)
(vector-component ?v2 3 ?b))))
(= (vector-component ?v 3 ?b)
(-
(* (vector-component ?v1 1 ?b)
(vector-component ?v2 2 ?b))
(* (vector-component ?v2 1 ?b)
(vector-component ?v1 2 ?b)))))))

```

This Lisp-to-HTML translation was brought to you by
François Gerbaux and Tom Gruber