Action:

Creates a new gvector given coordinates
x,
y, and
z.


Filename:

kern/kern_scm/gvec_scm.cxx


Syntax:

(gvector x y z [space=model])


Arg Types:

x

real


y

real


z

real


space

string


Returns:

gvector



x defines the
xcoordinate relative to the active coordinate system.



y defines the
ycoordinate relative to the active coordinate system.



z defines the
zcoordinate relative to the active coordinate system.



The optional
space argument defaults to
"WCS". If no active WCS exists,space defaults to
"model". The other optional
space arguments return agvector in the new coordinate system. The values for thespace argument are:





"wcs" is the default if an active WCS exists. Otherwise, the default is
"model".




"model" means that the
x,
y, and
z values are with respect to the model. If the model has an origin other than the active WCS, this returns the position relative to the active coordinate system in rectangular Cartesian coordinates.




"polar" or
"cylindrical" mean that the
x,
y, and
z values are interpreted as the radial distance from the
zaxis, the polar angle in degrees measured from the
xz plane (using righthand rule), and the
z coordinate, respectively. This returns the
x,
y, and
z terms with respect to the active coordinate system.




"spherical" means that the provided
x,
y, and
z values are the radial distance from the origin, the angle of declination from the
zaxis in degrees, and the polar angle measured from the xz plane in degrees, respectively. This returns the
x,
y, and
z terms with respect to the active coordinate system.


Example:

; gvector


; Create gvectors of various types.


(gvector 3 3 3)


;; #[gvector 3 3 3]


(gvector 5 5 5 "wcs")


;; #[gvector 5 5 5]


(gvector 5 5 5 "model")


;; #[gvector 5 5 5]


(gvector 5 5 5 "polar")


;; #[gvector 4.98097349045873 0.435778713738291 5]


(gvector 5 5 5 "cylindrical")


;; #[gvector 4.98097349045873 0.435778713738291 5]


(gvector 5 5 5 "spherical")


;; #[gvector 0.434120444167326 0.0379806174694798


;; 4.98097349045873]
