Simple trigonometry / geometry question. Diagram included

rekshaw
Messages
15
Reaction score
0
Hey all,

BACKGROUND: (please note that knowledge of this is not necessary):
I'm currently writing a javascript application using vectors (with jquery and raphaeljs) that enables me to rotate custom text (using font.js file, not normal fonts). However, due to a bug in the new version of raphael, when I rotate a text made up of multiple letters, all the letters rotate on their own relative center.

Don't worry, I'm not asking you to help me debug my scripting language, I'm asking you to help me get around this bug by manually calculating the translating movements (x and y) of each letter.

If I wasn't clear until now, don't worry, I'll show you exactly what I need (quick photoshop):

MATHEMATICAL PROBLEM:

[PLAIN]http://img534.imageshack.us/img534/1780/rotationtranslation.png

Variables I know:

- the angle a
- the angles b
- the 2 sides K

I need to find the blue and orange (y and x) lengths in order to translate my letters properly.
 
Last edited by a moderator:
Mathematics news on Phys.org
Quick reply: find the cartesian location of every letter, switch to polar, rotate them the desire angle, switch back to cartesian
 
gsal said:
Quick reply: find the cartesian location of every letter, switch to polar, rotate them the desire angle, switch back to cartesian
gsal's answer is probably what you really want but, to literally answer your question, what you're looking for is the cosine law...
 
Length of side opposite to angle a, = 2Ksin(a/2) ; for small a it will approximate to K.a (a in radian ) Let, say this side "Black"
Since,"Orange" line is perpendicular to "Blue". Orange, Blue and Black line form Pythagorean triangle. So the problem is reduced to finding the Pythagorean triplet. Length of Black line, l(Black) is already known, now we need to find, l(Orange) and l(Blue).

Length of Black line, l(Black) = 2Ksin(a/2). Now if l(Black) is not an integer, then divide l(Black) by a rational number "k", such that l(Black)/k is an integer. Let call this number "B".

If B is odd then, other two numbers of Pythagorean triplet are P1 = B2/2 - 1/2 and P2 = P1+1

If B is even then, other two numbers of Pythagorean triplet are P1 = B2/4 - 1 and P2 = P1+2

Now, l(orange), l(Blue) = kP1 , kP2 ( if kP1 > kP2 then l(Blue) = kP1 and l(orange)= kP2 otherwise l(Blue) = kP2 and l(orange)= kP1)
 
As far as I can tell, you don't need the angle b.

The blue side is K \ \sin \left(a\right). The orange part is K \ \left(1-\cos\left(a\right)\right).

You'll see that in your diagram, if you switch the blue line over you can make a right triangle with K as the hypotenuse. This means that sin(a) * k = the blue line.

You'll also notice that the other leg of the right triangle with hypotenuse K is cos(a) * k. Subtracting this from your length K gives you the length of your orange section.
 
Consider this:
You have an isosceles triangle
You know the measures of it's angles
You know the lengths of it's legs
You know the length of it's base

What you DON'T know is the angle that the triangle makes with either the vertical or horizontal translation lines.

In other words, you could rotate the triangle, keeping the same physical qualities as the original one, which would change the lengths of those translation lines.
Therefore, each line independently has the potential for having a length ranging from zero to the same length as the base of the triangle.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
I'm interested to know whether the equation $$1 = 2 - \frac{1}{2 - \frac{1}{2 - \cdots}}$$ is true or not. It can be shown easily that if the continued fraction converges, it cannot converge to anything else than 1. It seems that if the continued fraction converges, the convergence is very slow. The apparent slowness of the convergence makes it difficult to estimate the presence of true convergence numerically. At the moment I don't know whether this converges or not.
Back
Top