Description Usage Arguments Details Value Author(s) References See Also
Rotates the x-y coordinates by choosing one datapoint as the origin, choosing another to be fixed on the x axis, and choosing a third to be positive or negative.
1 | rotateGraph(coords, scale = NULL, origin, axis, fixedPos = 2)
|
coords |
a nx2 dimensional matrix corresponding to the cartesian coordinates of the n datapoints. |
scale |
a nx2 dimensional matrix. This is used when comparing two graphs to one another. This parameter will scale one graph to the other by ensuring the average of the radi are the same across the two graphs. Defaults to NULL. |
origin |
an integer indicating which datapoint (i.e., which row) should be fixed as the origin. |
axis |
an integer indicating which datapoint (i.e., which row) should be fixed on the x-axis. |
fixedPos |
an integer indicating which datapoint (i.e., which row) must be positive on y. |
Many algorithms exist for projecting m-dimensional datapoints in two-dimensions (e.g., tsne and MDS). However, often they begin the algorithm by randomly placing datapoints in an arbitrary position. Unfortunately, this makes the axes meaningless from one iteration of the algorithm to the next, making comparisons across datasets (for example) impossible. One solution is to fix one datapoint to the origin, while rotating the others about the origin. This algorithm does just that by using polar coordinates.
coords |
the new coordinates obtained after rotation |
radi |
a vector of the radi for each of the datapoints |
Dustin Fife
http://www.mathsisfun.com/polar-cartesian-coordinates.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.