targetPos is likely to be a Vector as [].pos method returns a vector. So, youâ€™ve been dealing with vectors longer than you realized. I havenâ€™t played with Vector.magnitude() yet, however, so I canâ€™t comment further.

Example 2: The example is correct. diff is a Vector and the angle is in radians. Math.PI * 2 = 360 degrees. Math.PI / 2 = 90 degrees turn, thus the variable name â€śtangentâ€ť. I agree, the title needs work:
Vector.rotate(theta, angle) would probably be better.

Example3: Agreed, thatâ€™s java. It is not difficult to translate that, however.

targetPos = self.getNearestEnemy().pos
diff = Vector(5,5)
res = Vector.add(targetPos, diff)

I would note that the odds of folks still having access to getNearestEnemy() at this stage is fairly low. Iâ€™d suggest a slightly different example: