convert function

Synopsis

float convert(coordSelector, fromSysSelector, toSysSelector, typeSelector, x, y, z)

Parameters

Returns

The selected coordinate component of the tuple (x, y, z), converted from the fromSys coordinate system to the toSys coordinate system. The tuple can either describe angles or a position.

 

The convert function converts positions and orientations between different coordinate systems.

Related

Examples

Using convert() to find the position and orientation of the scope origin in world and pivot coordinates as well as the highest point of the scope in world coordinates


convert a
version "2009.2"

Init-->
   extrude(3)
   t('0.2, 0, '0.7)
   s('0.5, '1, '0.5)
   r(-10, 70, 0)
	 
   print("pos. of scopeOrigin in world coords " +
      convert(x, scope, world, pos, 0, 0, 0) + ", " +
      convert(y, scope, world, pos, 0, 0, 0) + ", " +
      convert(z, scope, world, pos, 0, 0, 0) )
   print("orient. of scopeOrigin rel. to world axes " +
      convert(x, scope, world, orient, 0, 0, 0) + ", " +
      convert(y, scope, world, orient, 0, 0, 0) + ", " +
      convert(z, scope, world, orient, 0, 0, 0) )
   print("pos. of scopeOrigin in pivot coords " +
      convert(x, scope, pivot, pos, 0, 0, 0) + ", " +
      convert(y, scope, pivot, pos, 0, 0, 0) + ", " +
      convert(z, scope, pivot, pos, 0, 0, 0) )
   print("highest point in world coords " +
      convert(x, scope, world, pos, scope.sx, scope.sy, scope.sz)
      + ", " +
      convert(y, scope, world, pos, scope.sx, scope.sy, scope.sz)
      + ", " +
      convert(z, scope, world, pos, scope.sx, scope.sy, scope.sz) )
 
The output of the cga code above in the scene on the left is: convert b

Copyright ©2008-2017 Esri R&D Center Zurich. All rights reserved.