convert function

Syntax

float convert(coordinate, fromSystem, toSystem, type, x, y, z)

float[] convert(fromSystem, toSystem, type, coordinates)

Parameters

Returns

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

Description

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

Related

Example

convert example
Init -->
   extrude(3)
   t('0.2, 0, '0.7)
   s('0.5, '1, '0.5)
   r(-10, 70, 0)
	 
   // position of scope origin in world coordinates
   print(convert(scope, world, pos, [0,0,0]))
   // (3)[1.0452611297369,0,2.183733612298965]
   
   // x-position of scope origin in world coordinates
   print(convert(x, scope, world, pos, 0, 0, 0))
   // 1.0452611297369
     
   // position of scope origin in pivot coordinates
   print(convert(scope, pivot, pos, [0,0,0]))
   // (3)[0.3999996185302735,0,-0.6000001430511476]
   
   // orientation of scope origin relative to world axes
   print(convert(scope, world, orient, [0,0,0]))
   //(3)[-10,23.45978546142578,0]
   
   // position of scope center in world coordinates
   print(convert(scope, world, pos, 
                 [scope.sx/2,scope.sy/2,scope.sz/2]))

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