An easier way of doing that is by using sine and cosine. You can define a circle using sin and cos, so this is what I use for orbits.
a#=wrapvalue(a#+1)
position camera x#+(sin(a#)*dist#),height#,z#+(cos(a#)*dist#)
point camera x#,y#,z#
a# is an angle that determines where the camera is.
x# is the x position of the point to be orbited.
z# is the z position of the point to be orbited.
dist# is the distance from the camera to the object.
height# is the height above the point to be orbited.
Note this orbits in the xz plane only, to orbit in other planes just put the sin and cos functions in different camera axes. If you are making an editor then you will most likely need 3d orbits (homeworld-style camera), I wrote some code for that a while back, I'll tell you if I can remember it.