|
Action:
|
Makes a law that is a vector of arbitrary dimensions.
|
|
|
Derivation:
|
vector_law : multiple_law : law : ACIS_OBJECT : -
|
|
|
Syntax:
|
VEC (my_law1, my_law2, ... )
|
|
|
Description:
|
This law is a way of combining several sublaws, each of one dimension, into a single law that has several dimensions. All sublaws have to return one dimensional items, although they can have multiple input items.
|
|
|
Example:
|
; law "VEC"
|
|
; Create two gvectors.
|
|
(define g1 (law (gvector 1 1 0)))
|
|
;; g1
|
|
; => #[law "VEC(1,1,0)"]
|
|
(define g2 (law (gvector 0 0 1)))
|
|
;; g2
|
|
; => #[law "VEC(0,0,1)"]
|
|
(define my_law (law "law1+law2" g1 g2))
|
|
;; my_law
|
|
; => #[law "VEC(1,1,0)+VEC(0,0,1)"]
|
|
;; #[gvector 1 1 1]
|
|
|
; Another example.
|
|
; Create a vec law.
|
|
(define my_vec (law "vec( x^2, 2*x^3, x+1)"))
|
|
;; my_vec
|
|
; => #[law "VEC(X^2,2*X^3,X+1)"]
|
|
; Evaluate the law at a value of x.
|
|
(law:eval-position my_vec 2)
|
|
;; #[position 4 16 3]
|
|
(define dmy_vec (law:derivative my_vec))
|
|
;; dmy_vec
|
|
; => #[law "VEC(2*X,6*X^2,1)"]
|
|
; Create another vector with two input arguments.
|
|
(define my_vec2 (law "vec( x+y, y^2, X^2)"))
|
|
;; my_vec2
|
|
; => #[law "VEC(X+Y,Y^2,X^2)"]
|
|
; Evaluate the law at a value of x and y.
|
|
(law:eval my_vec2 (list 2 1))
|
|
;; (3 1 4)
|