#How find rotation btween two points XY and XY

58 messages · Page 1 of 1 (latest)

halcyon loomBOT
raven jay
#

what

opaque sandal
#

Have you tried using the Pythagorean theorem?

#

$a^2 + b^2 = c^2$

frigid warrenBOT
opaque sandal
#

No

#

A triangle has three sides a, b and c. As does your picture.

#

Assuming that the angle to left is 90 degress, we can apply the Pythagorean theorem.

#

Once you established that you would have to use sin or cos

#

ok

#

Wait

#

there's an even simpler solution

#

Do you know how to work with tan($\alpha$)?

frigid warrenBOT
opaque sandal
#

tan($\alpha$) is an mathematical operation

frigid warrenBOT
opaque sandal
#

and $\alpha$ is an angle

frigid warrenBOT
opaque sandal
#

your rotation

#

so you need the point?

#

or do you want the angle

#

?

#

So tan($\alpha$) = $\frac {opposite} {adjacent}$ inside a triangle with one angle being 90 degrees

frigid warrenBOT
opaque sandal
#

If we take your example from earlier with one side being the length of 3 and the other one 4. This would look like tan($\alpha$) = $\frac {4} {3}$.

frigid warrenBOT
opaque sandal
#

But wait

#

no

#

$\alpha$ is still unknown

frigid warrenBOT
opaque sandal
#

now you would have to to the following

frigid warrenBOT
#

f0xy
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)

opaque sandal
#

You would have to tan^-1(4/3)

#

that's your alpha

thick aspen
opaque sandal
frigid warrenBOT
#

animeonfire

opaque sandal
#

yes

#

that would calculate your angle

#

assuming that your sides are the length 3 and 4 as above.

thick aspen
#

What is the actual problem? Like, you have that example, but what is the question?

opaque sandal
#

He's trying to find the angle here

#

i just explained him how to calculate that

thick aspen
#

For this one there is an even easier solution

opaque sandal
#

really?

thick aspen
#

Cause when you take the x and y difference between the points you find that both legs of the triangle are equal to 1

#

Since the angle in the bottom left corner is (most likely) a 90° angle, we have that (since the other two angles need to be of equal size) that the other angles are both equal to 45°

#

Given that the sum of inner angles in any triangle is always 180°

#

Yep

#

Lemme quickly look up the english term for that

#

That kind of triangle is an isosceles triangle, if you ever wanna learn more about it

thick aspen
#

But the equation is flawed, even if it means the right thing:
Take the total sum (180°).
Subtract 90°, as this is the right angle.
Then you have 90° left.
Since the other angles (by construction of an isosceles triangle) are always equal, they both must be equal to X°.
Therefore, 90°=2×X°
And finally X°=45°

cursive pond
#

you dont

opaque sandal