Converting direction to Vector2

I have an angle (direction) and I need to move a rectangle in that direction. This is the code I have so far where `pos` is a rectangle and `dir` is the direction:

pos.x += Time.deltaTime * 500 * Mathf.Cos(dir);
pos.y += Time.deltaTime * 500 * Mathf.Sin(dir);

When I run it the object goes off in a random direction!

Edit:

I guess this was not clear: dir is a float and pos is a Rect.

It's not random, it's Trigonometric. I don't know if you need that, so try this and see if it's more like what you want:

    var p : Vector3;

function Start()
  p.x = pos.x;
  p.y = pos.y;
  p.z = 0;

function Update()

    p += Time.deltaTime * 500 * dir;
    pos.x = p.x;
    pos.y = p.y;

It's worth a mention that dir (your angle) should be in radians.