2
$\begingroup$

My algebra books are in storage and Google is not being helpful...

In figure 6.5.5, how do I apply the angle operator to the matrix columns to determine a value for theta?

http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes

Thanks for any pointers,

Paul

  • 0
    Right, sorry, it's been about 15 years since I tackled this stuff, thanks!2011-02-02

1 Answers 1

1

Well, it's the angle between two vectors, in this case the vectors

$\begin{pmatrix} 1 \\ 0 \end{pmatrix} ~~ \textrm{and} ~~ \begin{pmatrix} \frac{x_1 - c_x}{r_x} \\ \frac{y_1 - c_y}{r_y} \end{pmatrix}$

In general, if you have two real vectors $v_1$ and $v_2$, and want to calculate the angle between them, use the scalar product, $\langle v_1, v_2 \rangle = v_2^T v_1$ and the formula

$\langle v_1, v_2 \rangle = \|v_1\| \|v_2\| \cos \theta$

where $\theta$ is the angle. This gives you:

$\cos \theta = \frac{v_2^T v_1}{\|v_1\| \|v_2\|} = \frac{\sum_{i = 1}^n v^1_i v^2_i}{\|v_1\| \|v_\|}$

where $v^1_i$ and $v^2_i$ are the components at position $i$ of the vectors $v_1$ and $v_2$ respectively.

In your case you get:

$\cos \theta = \frac{\frac{x_1-c_x}{r_x}}{\sqrt{\left( \frac{x_1 - c_x}{r_x} \right)^2 + \left( \frac{y_1 - c_y}{r_y} \right)^2}}$

use $\arccos$ to get a value for $\theta$.

  • 0
    Great! Good luck with your project!2011-02-02