# Transform local coordinate to global coordinate

**URL:** <https://tech-community.robotics.abb.com/t/transform-local-coordinate-to-global-coordinate/4856>\
**Category:** Developer Tools\
**Created:** [May 10, 2012, 3:25pm UTC](https://tech-community.robotics.abb.com/t/transform-local-coordinate-to-global-coordinate/4856 "2012-05-10T15:25:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![surgeon](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@surgeon](https://tech-community.robotics.abb.com/u/surgeon)\
**Post date:** [May 10, 2012, 3:25pm UTC](https://tech-community.robotics.abb.com/t/transform-local-coordinate-to-global-coordinate/4856/1 "2012-05-10T15:25:49Z")

</div>

Hi!

When I got the vector3 of a vertex. I can find the body coordinate values, but I find this value is in local coordinate. I want to transform this local coordinate to global coordinate. I use the TransformVector to realize this function.  
The definition of TransformVector as follow:

```auto
public [Vector3](http://forums.robotstudio.com/forum_posts.asp?TID=6092) TransformVector(
	[Matrix4](http://forums.robotstudio.com/forum_posts.asp?TID=6092) from,
	[Matrix4](http://forums.robotstudio.com/forum_posts.asp?TID=6092) to
)

```

```auto
My code:

```

```auto
Vector3 vertextrans = codege.Edge.EndVertex.Position;
                                  
Matrix4 localmatrix = body.Transform.Matrix;

Matrix4 worldmatrix = station.Transform .GlobalMatrix;

Vector3 tmp =vertextrans.TransformVector(localmatrix,worldmatrix);

```

```auto

```

```auto
I want to transform the local vertor3 into world coordinate, but there is no effect.. What is wrong with the code?

```

```auto
Thanks!

```
