I'm writing an API for a JavaScript library to let my users offset an object from another.
I have to provide my user with a way to describe a "vertical" and "horizontal" offset.
My problem is that I don't have any point of reference except for the very same position and orientation of the said objects.
In the above example, I have two blocks that face themselves, and the green one is offset from the yellow one by 60 on the Y axis, and 40 on X.
I can't describe this as:
{
x: 40,
y: 60,
}
Because if the blocks are rotated together by 90 degrees:
I would have to invert the axes, and my users really just want to express the "distance between them" and the "distance between their bottom edge" (bottom in this example, it may actually be "right" or "left" or "top" if rotated differently).
I need a way to describe the distances so that they don't need to be changed if the boxes rotate.
What's a good way to describe these two distances?
x, y, rotation
will work), or do you mean you need some alternate words that are more general, to use in the API? And if the latter, given that the users don't see anything, why horizontal/vertical or x/y do not work for you? Specifically, how and when rotation comes into it, and in what way that may cause confusion to the consumers of the API (how is the rotation relevant to them)?