I currently have two points and a line between them. I have created a function called Rotate() that rotates the point along the x-axis, y-axis and z-axis. The problem I have is that I am using rotational matrices and if the points are not at the global coordinate center, the rotations mess up. So I have found a solution here, but cannot get it to work.
How can I translate these two points, so that one sits directly on [0 0 0]? ( I am trying to keep the distance and angles between them the same)
origin = [2 4 2]; % This is the point I want to put on [0 0 0]
point = [3 2 4];
I tried using "local2globalcoord" but I could not manage...